Graph layout rectangle nodes

373 views
Skip to first unread message

King

unread,
Jan 18, 2010, 9:32:41 AM1/18/10
to networkx-discuss
I am looking a way to layout my nodes. The application screenshot is
here:
http://pantheon-studios.in/shaderbox/

As you can see, nodes are rectangles. They have a position and size
(width is same, height vary). I need to arrange
them neatly. The easiest way I can describe the solution is.

1. Create a list of all nodes in the graph.
2. Store their position and size.
3. Create a list of edges.
4. Pass above information to a function.
5. Get back new positions of the nodes.

So we something in networkx that can help me out here?

Prashant
Python 2.6.2
XP 32

Aric Hagberg

unread,
Jan 22, 2010, 6:19:35 PM1/22/10
to networkx...@googlegroups.com

I think when you say "arrange them neatly" you probably want an
algorithm that minimizes the edge crossings. Take a look
at the examples of the Graphviz layout algorithms (see
http://graphviz.org/Gallery.php
)
If some of those work you could generate layouts from Python with
PyGraphviz.

Aric

Reply all
Reply to author
Forward
0 new messages