Solved

C++ source that display connected graphs

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
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 learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

791 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