Keep It Simple, Stupid | |
PerlMonks |
Re: Efficient Assignment of Many People To Many Locations?by johndageek (Hermit) |
on Feb 28, 2005 at 21:49 UTC ( [id://435202]=note: print w/replies, xml ) | Need Help?? |
Just a left handed approach.
I would select a point in a third dimension over the center of my sales rep grid, calculate the distance to each sales rep and store the results in an array as a cross reference.
e.g.
dist from 3rd dim | map coordinates sort this array by distance. Now any destination you choose on the grid can be have it's distance calculated from the 3rd dimension point. A binary search of the sorted cross reference for distances equal to, or just above and below your destination distance should give you your top choices. This assumes of course you have enough data to make the set up worth the effort and that the sales reps are based from the same place repeatedly. HTH! Enjoy!
In Section
Seekers of Perl Wisdom
|
|