Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Graph visualization (boost graph)

I have C++ program using boost graph library. I wonder if there is any way to visualize the graph (nodes and optionally edges) following a certain position values contained in nodes. Please look the examples of the image bellow to understand what I want to visualise: http://img11.hostingpics.net/pics/647608graphViz.png

Thanks.

like image 515
shn Avatar asked Oct 28 '11 15:10

shn


1 Answers

You're in luck.

Boost graph can serialize to and deserialize from the dot language (which is the language used by GraphViz). There are several examples in the (free) Boost Graph Library book and on the site.

See e.g.: http://www.boost.org/doc/libs/release/libs/graph/doc/write-graphviz.html

If you take the output of the sample on the previous webpage and run

dot -Tpng dot > test.png

You'll get something like the following picture:

enter image description here

Here is a direct link to an example using dynamic properties

like image 124
sehe Avatar answered Nov 08 '22 06:11

sehe