Question

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.

Was it helpful?

Solution

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.

OTHER TIPS

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

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.

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top