Solved

C++ source that display connected graphs

Posted on 1998-07-03
4
407 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

832 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