473,566 Members | 3,307 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Graph optimization

I am working on an interesting graph optimization problem and I would
like to have a few expert opinions for helping me with a solution.

So here goes ...

I have a black box with a complex internal circuitry that is
represented in the form of a graph. I have to abstract the graph by
reducing the number of internal points and constructing cumulative
paths from each input to every possible output in case a path exists (a
series combination of edges). Each edge of the graph has a weight
associated with it. I have to add up all the weights to form the
resultant path.

My representation of the graph is in the form of a linked list
structure as I do not know the number of nodes in the graph apriori ..

A simple situation would be as follows ..

a b a+b
1----> 2 ----> 3 ====> 1 ----> 3

An edge from 1 to 2 with weight 'a' and an edge from 2 to 3 with weight
'b' should be transformed into an edge from 1 to 3 with weight 'a+b'.
Of course, this is a naive example but one can imagine different
scenarios with multiple input arcs and multiple output arcs into/from
internal nodes. I have to find a cumulative path from each input to
every possible output in the most efficient manner. I know the input
points as well as the output points.

Can any C++ guru suggest an detailed algorithm with pseudo code for
solving this problem ?

Feb 24 '06 #1
3 2125
Amol wrote:
I am working on an interesting graph optimization problem and I would
like to have a few expert opinions for helping me with a solution.

So here goes ...
[...]
Can any C++ guru suggest an detailed algorithm with pseudo code for
solving this problem ?


Why are you asking for an algorithm in a _language_ newsgroup? Please
consider posting general programming questions like that to the relevant
newsgroup: 'comp.programmi ng'. Come back when you have a _language_
question, we'll be happy to accommodate you.

V
--
Please remove capital As from my address when replying by mail
Feb 24 '06 #2
In article <11************ *********@t39g2 000cwt.googlegr oups.com>,
"Amol" <am************ *@gmail.com> wrote:
I am working on an interesting graph optimization problem and I would
like to have a few expert opinions for helping me with a solution.

So here goes ...

I have a black box with a complex internal circuitry that is
represented in the form of a graph. I have to abstract the graph by
reducing the number of internal points and constructing cumulative
paths from each input to every possible output in case a path exists (a
series combination of edges). Each edge of the graph has a weight
associated with it. I have to add up all the weights to form the
resultant path.

My representation of the graph is in the form of a linked list
structure as I do not know the number of nodes in the graph apriori ..

A simple situation would be as follows ..

a b a+b
1----> 2 ----> 3 ====> 1 ----> 3

An edge from 1 to 2 with weight 'a' and an edge from 2 to 3 with weight
'b' should be transformed into an edge from 1 to 3 with weight 'a+b'.
Of course, this is a naive example but one can imagine different
scenarios with multiple input arcs and multiple output arcs into/from
internal nodes. I have to find a cumulative path from each input to
every possible output in the most efficient manner. I know the input
points as well as the output points.

Can any C++ guru suggest an detailed algorithm with pseudo code for
solving this problem ?


I would first input the graph as an n-ary tree. Then do a breadth-first
search from each input to all outputs adding the weight of each node as
I go along. There may be a more efficient search algorithm for this
particular problem though. As a bonus, I would have each search run in a
different thread...

If this is professional code, and not a class/learning project, then I
would use the Boost Graph Library.
--
Magic depends on tradition and belief. It does not welcome observation,
nor does it profit by experiment. On the other hand, science is based
on experience; it is open to correction by observation and experiment.
Feb 24 '06 #3
Amol wrote:
I am working on an interesting graph optimization problem and I would
like to have a few expert opinions for helping me with a solution.

So here goes ...

I have a black box with a complex internal circuitry that is
represented in the form of a graph. I have to abstract the graph by
reducing the number of internal points and constructing cumulative
paths from each input to every possible output in case a path exists (a
series combination of edges). Each edge of the graph has a weight
associated with it. I have to add up all the weights to form the
resultant path.

My representation of the graph is in the form of a linked list
structure as I do not know the number of nodes in the graph apriori ..

A simple situation would be as follows ..

a b a+b
1----> 2 ----> 3 ====> 1 ----> 3

An edge from 1 to 2 with weight 'a' and an edge from 2 to 3 with weight
'b' should be transformed into an edge from 1 to 3 with weight 'a+b'.
Of course, this is a naive example but one can imagine different
scenarios with multiple input arcs and multiple output arcs into/from
internal nodes. I have to find a cumulative path from each input to
every possible output in the most efficient manner. I know the input
points as well as the output points.

Can any C++ guru suggest an detailed algorithm with pseudo code for
solving this problem ?


There is nothing C++ specific about your problem. You will be way better off
in comp.programmin g.

Nonetheless, my understanding is that boost has a nice collection of graph
algorithms. Another thing that comes to mind is LEDA. Here, Google is your
friend.
Best

Kai-Uwe Bux
Feb 24 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
2889
by: Lilith | last post by:
Is there a python module somewhere (been searching today, no luck) which has efficiently coded various graph-handling routines, such as finding the shortest path through a graph, or the set of all paths through a graph? I'm not a compsci-educated person, so coding my own would be less parsimonious. Thanks for any suggestions! D
25
3768
by: Magnus Lie Hetland | last post by:
Is there any interest in a (hypothetical) standard graph API (with 'graph' meaning a network, consisting of nodes and edges)? Yes, we have the standard ways of implementing graphs through (e.g.) dicts mapping nodes to neighbor-sets, but if one wants a graph that's implemented in some other way, this may not be the most convenient (or...
9
2727
by: Mikito Harakiri | last post by:
Transitive closure (TC) of a graph is with TransClosedEdges (tail, head) as ( select tail, head from Edges union all select e.tail, ee.head from Edges e, TransClosedEdges ee where e.head = ee.tail ) select distinct * from TransClosedEdges
8
2429
by: Jef Driesen | last post by:
I'm working on an image segmentation algorithm. An essential part of the algorithm is a graph to keep track of the connectivity between regions. At the moment I have a working implementation, but it's not flexible enough anymore and I need something more advanced. I already have a data structure in mind, but I don't know how to implement that...
2
4126
by: sriniwas | last post by:
Hi Frnd's, m using prefuse visulation,it's have one display class and this class have one saveImage(outPutStream, String jpg,double size);. now graph is converting ia jpg image properly.now my problem is tht,If graph is to large if it going out of screen thn ,i m getting jpg image on screen disply graph,m not getting the image of tht graph...
4
2541
by: Man4ish | last post by:
namespace ve/////////////////ve.h { struct VertexProperties { std::size_t index; boost::default_color_type color; }; } /////////////////////////////////////////////////////////////////////////////////////////////////// namespace ed///////////////////////ed.h
2
2300
by: Man4ish | last post by:
I have created Graph object without vertex and edge property.It is working fine. #include <boost/config.hpp> #include <iostream> #include <vector> #include <string> #include <boost/graph/adjacency_list.hpp> #include <boost/tuple/tuple.hpp> #include <set> using namespace std;
2
1799
by: blaine | last post by:
Hey everyone, Just a friendly question about an efficient way to do this. I have a graph with nodes and edges (networkx is am amazing library, check it out!). I also have a lookup table with weights of each edge. So: weights = .12 weights = .53 weights = 1.23 weights = -2.34 etc.
0
3468
by: eureka2050 | last post by:
Hi all, I am creating a radar chart containing 2 plots using jpgraph. My code is as follows:- include ("./jpgraph/src/jpgraph.php"); include ("./jpgraph/src/jpgraph_radar.php"); // Create the basic radar graph $graph = new RadarGraph(700,500,"auto");
0
7673
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7584
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7893
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7953
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5485
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2085
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1202
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
926
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.