Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a good free implementation of Sugiyama Layout for Java?

I am using JUNG library for network-graphs. I also found an implementation of the sugiyama layout: http://sourceforge.net/tracker/?func=detail&aid=2944336&group_id=73840&atid=539121 But unfortunatly its edge-crossing method seems not to work and I can't solve it. The vertical alignment of the nodes is all but correct.

(Unless theres no error free version of this JUNG algorithm) Does anyone know of of another implementation? As long as it's free and possible to wrap the it, any Java code (so not necessarily JUNG) would be sufficient. If theres a very good Library in another language that would take a graph and return a graphml file with fixed positions for nodes it would help also :)

like image 245
Matthias Avatar asked Apr 09 '13 09:04

Matthias


2 Answers

This layout works fine for me:

http://code.google.com/p/daglayout/

I had to make a modification to the code that I couldn't check in : line 275 should be "continue" instead of "return". Other than that, the algorithm seems to work if you give it enough space for your particular graph. I have a heuristic I use based on total nodes and total tree depth.

like image 157
mephicide Avatar answered Sep 29 '22 07:09

mephicide


There is one in this project:

It contains the classic Sugiyama (with all of the generated vertices), the Eiglsperger optimization (pvertex and qvertex), a splay tree, brandes kopf horizontal alignment, 4 kinds of layering: (top down, longest path, coffman-graham, network simplex) The code is in the jungrapht-layout module and jar, which has no java.awt dependencies, so it would be easier to use with non-awt rendering (like JavaFX).

scroll down for a picture. The code is here

like image 38
Tom Avatar answered Sep 29 '22 08:09

Tom