I have a list (graph?) of nodes, and each node is connected to other nodes in the list one or more times. I want to take these nodes and lay them out in a nice 2d diagram with lines connecting them together in an optimal way. What's the best algorithm for doing this so that they're spaced evenly apart and the lines connecting them are as untangled as possible?
+1
A:
I think you'll find that it depends on the data your trying to represent as a graph. There isn't one that fits all.
See: http://networkx.lanl.gov/reference/drawing.html - for some example layouts.
Binary Nerd
2010-01-27 05:35:06
A:
Someone implemented a force-directed graph in JavaScript and gave me permission to do what I want with it: http://www.reddit.com/r/programming/comments/bqr7v/force_directed_graph_layout_in_javascript/c0o4ka5?context=3
JoeCoder
2010-09-24 19:19:42