• Status: Solved
• Priority: Medium
• Security: Public
• Views: 429

C++ source that display connected graphs

I want to display a connected graph. The graph consists of nodes
that are connected to each other. Now I search for algorithms or
source code in C/C++ that help me show the graph in 2D with
the connections but without any connections crossing eachother
(if it is possible).

Where can I find this ?
0
d94stein
• 2
1 Solution

Author Commented:
0

Commented:
I don't know what your background is, but it is best to read a mathematical book about graphs, if you're graphs are simple ( read less then 5-6 nodes ) then it is quit easy, but the problem is that you can't draw fully connected graphs with more than 5 nodes without paths that cross each other. To check if to paths are crossing you can use the fact that if two paths are crosing that there's an intersection point so go back to math and use the equation of lines. If you have a fully connected graph start switching nodes till you find a possible solution.
0

Author Commented:
The graph has about 5000 nodes, but I'm not planning to show them all
at the same time. Just a part of the graph (about 20-40 nodes) that I choose.
Every node is connected to 1-7 other nodes (most have just 1-3 paths).

I could try to create the code myself, but i want to avoid inventing the wheel
once again so if there are some code or examples out there somewhere I
would be happy to know about it.

0

Commented:
If I understand correctly, you are looking for code that helps you visualize your big Graph(s)?
Here is what I propose: goto http://www.mpi-sb.mpg.de/LEDA/leda.html
LEDA stands for Library for efficient Datastructures and Algorithms. It has very powerful algorithms implemented to display, manipulate and traverse all kind of Graphs. It is free for academical purposes. It's available for MS and UNIX.

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.