Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: Efficient Assignment of Many People To Many Locations?by Roy Johnson (Monsignor) |
on Feb 25, 2005 at 13:39 UTC ( [id://434458]=note: print w/replies, xml ) | Need Help?? |
Partitioning: divide the reps in half based on (say) east-west location; divide the cities similarly. Continue subdividing the rep and city cells, keeping the same number of reps and cities in corresponding cells, until you have one rep corresponding to one city. Each division should cut across the longer dimension of the cell (or the dimension which has the greatest range of either cities or reps, but corresponding cells should be divided in the same direction).
This is based on Heckbert's "median cut" color quantization method. Caution: Contents may have been coded under pressure.
In Section
Seekers of Perl Wisdom
|
|