Solved

C++ source that display connected graphs

Posted on 1998-07-03
4
406 Views
Last Modified: 2012-08-13
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
Comment
Question by:d94stein
  • 2
4 Comments
 

Author Comment

by:d94stein
ID: 1167114
Adjusted points to 100
0
 

Expert Comment

by:pdroogma
ID: 1167115
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 Comment

by:d94stein
ID: 1167116
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
 

Accepted Solution

by:
Adelmo earned 100 total points
ID: 1167117
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

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now