views:

641

answers:

2

I am looking for a simple graph layout library for C++. I want to embed the library into our visualizer based on wxWidgets. In summary, I am looking for something like graphviz, except dynamic - that is when an event occurs, only the change in graph needs to be loaded, not the complete display. There is dynagraph, but it seems a dead project. I have previously been suggested to use VTK - but it is a heavyweight.

I am looking for open source, non-copyleft kind of library available for commercial use (GPL is out, LGPL should be ok). I am open to suggestions that google won't give.

+2  A: 

The layout that Graphviz generates is based on the global structure - any single addition can dramatically change the output (unless you're using fixed coordinates, in which case you probably wouldn't be asking this question). Basically, if you want automatic placement of elements, you need to accept one of these solutions:

  • When a new element is placed, a physics simulation is run in realtime, causing nodes to bounce around wildly until they settle into their new locations. This will be slow, but it will show "pleasing" changes.
  • When a new element is placed, the entire graph is re-drawn (physics/whatever is hidden, but the entire thing gets modified). This will be faster due to not having to redraw, but the relative locations of nodes can be completely different.
  • When a new element is placed, the existing elements are not modified. After enough dynamic updates, your graph is going to look like crap, because automatic placement is a global optimization problem.

Sorry I can't help with your question, but maybe this helps to explain why what you're looking for may simply not exist (or be any good).

Tom
A: 

To overcome some of the isues when using graphviz (descibed by Tom). We set the visualizer world coords to coincide with graphviz world coords.

then. assuming each visual element has a unique identifier, build a graph using these elements. output the graph as text. realign everything based on output parsing. ?

--

Michael

Michael