473,396 Members | 1,840 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 2102
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.programming'. 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*********************@t39g2000cwt.googlegroups. 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.programming.

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
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...
25
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.)...
9
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 =...
8
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...
2
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...
4
by: Man4ish | last post by:
namespace ve/////////////////ve.h { struct VertexProperties { std::size_t index; boost::default_color_type color; }; }...
2
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...
2
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...
0
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"); //...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
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...
0
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.