views:

1531

answers:

4

Are you aware of an open source implementation of force-directed layout in C++ used for GUIs? Preferably BSD/MIT/Apache or other (non-GPL) license.

+6  A: 

The first Google result is VTK. Another takes me to vtkGraphLayoutView.

dirkgently
Why is this downvoted? It is Open Source, free and has a BSD license.
dirkgently
+1 because anonymous down votes make me sad.
Chris Cameron
Having used VTK, I think it's really good solution to your problem. Plus it's fully cross platform Linux/Mac/Windows. AND it has binding for Python/Java and tcl/tk in case you ever need them.
Brian Gianforcaro
+8  A: 

The excellent Boost.Graph library provides a wide range of algorithms, among which a few layout algorithms. I'd recommend using either Kamada-Kawai spring layout or Fruchterman-Reingold force-directed layout.

Boost licence is very permissive so don't worry about that.

Benoît
+2  A: 

OverView

https://www.kitware.com/InfovisWiki/index.php/Main_Page

There are some installation steps if you want this application, all of the info is on that wiki. It is an application built on VTK. The specific function OverView has is the ability to represent a graph of information (not necessarily geometric) in 2 dimensions.

As pointed out by dirkgently, VTK has a force directed graph layout. The benefit of using something like OverView is that you can easily make a custom plug-in for OverView, which you would make to read your data and display it using the force directed layout strategy.

If you don't want to depend on OverView it is very easy to extract your plug-in code and only reference OverView since all of the rendering is handled outside of your plug-in.

Chris Cameron
+4  A: 

Have you looked at neato from graphviz. This guide even goes into detail for using graphviz as a library. The guide includes using the fdp layout algorithm, which appears to be exactly what you want. All of graphviz falls under the Common Public License.

grieve