6

I have a complex non-binary graph model.
Each tree node can have multiple children&parents (a node can also have a connection to it's "brother").

A node is represented as square on screen with lines to the connected nodes.
For that I want to use Draw2D and GEF libraries.

The problem I am facing is the graph layout.

I need a nice algorithm that can reposition the square nodes and the connections with minimum intersections and also make it symmetric as possible.

Martijn Verburg
22k1 gold badge51 silver badges81 bronze badges
asked Mar 16, 2012 at 13:30
6
  • 6
    If a node has multiple parents, it is not a tree. Commented Mar 16, 2012 at 13:38
  • 4
    Have you looked into GraphViz? graphviz.org Commented Mar 16, 2012 at 13:39
  • @ftr yes, it's graph. Commented Mar 16, 2012 at 13:47
  • 2
    JUNG is a graph visualization framework for Java, but I don't know how well it fits into your technology stack. jung.sourceforge.net Commented Mar 16, 2012 at 13:52
  • If there are parents, children and siblings, must the siblings be aligned along an axis? Are there any restrictions at all visually? Aside from minimum intersections? Is distance between connections a factor? Commented Apr 18, 2012 at 2:42

1 Answer 1

4

Your parent-child relation probably creates a partial order. Google "partial order graph layout" and top hits mention things like "Coffman–Graham algorithm" and "Hasse diagrams." Maybe some research in those directions would be productive.

answered Mar 19, 2012 at 1:35

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.