No such thing as a small change | |
PerlMonks |
Re: Distribute locations evenly on a mapby mpeg4codec (Pilgrim) |
on Nov 30, 2009 at 23:31 UTC ( [id://810283]=note: print w/replies, xml ) | Need Help?? |
You're butting against the relatively complex problem efficiently laying out graphs. The simplest way to approach this is using Force-based algorithms.
Essentially, treat the locations as masses connected by damped springs. Then run what amounts to a physics simulation until the masses no longer move or some specified number of iterations is reached. For a pre-packaged Perl solution, I've used Graph::Layouter to good effect.
In Section
Seekers of Perl Wisdom
|
|