views:

309

answers:

2
+3  A: 

You could use a spring model between the nodes. Each node exerts a repelling force against every other node. Allow all the nodes to push against each other a certain number of times and you'll come up with a reasonable solution. You'll want to have a couple limits to make sure nodes don't go flying off into space and that you don't oscillate between a couple similar states.

Implementing it in Javascript/PHP is left as an exercise for the reader.

An alternative is to use a graph layout program such as GraphViz.

scompt.com
On a very high level, I understand what you're talking about with the "spring model" idea. However, programmatically, I would be completely lost. Do you happen to know of any open source applications that use this procedure?
Joel Verhagen
Try searching for 'graph layout'.
scompt.com
A: 

I look forward to seeing the results of your project. I agree with scompt about using graphviz.