Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re: Distribute locations evenly on a map

by mpeg4codec (Pilgrim)
on Nov 30, 2009 at 23:31 UTC ( #810283=note: print w/ replies, xml ) Need Help??

in reply to Distribute locations evenly on a map

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.

Comment on Re: Distribute locations evenly on a map

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://810283]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2015-11-28 03:49 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (737 votes), past polls