Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Efficient Assignment of Many People To Many Locations?

by dragonchild (Archbishop)
on Feb 25, 2005 at 13:55 UTC ( [id://434468]=note: print w/replies, xml ) Need Help??


in reply to Efficient Assignment of Many People To Many Locations?

I'm not quite sure what you're attempting to optimize. Do you have
  • N people in M locations and they need to, instead, be dispersed to X locations? This sounds like the problem with assigning flight crews - there's a lot of literature on the topic. It's somewhat similar to the travelling salesman problem, but with enough constraints to make it merely hard, not NP-complete.
  • N people and M (>2N) locations and you need to assign coverage of said locations to said people? This sounds like a local minimization problem - you identify N groups of locations that are easy to cover, then assign people at random.

In addition, are you attempting to minimize the average distance or the mean distance? What I mean is that if you minimize the average distance, you will have someone who has a much greater distance relative to the average. But, if you minimize the mean distance, everyone will have roughly equal distances, but it's going to be higher for most than it could have been.

I think you need to define your problem better. There's a number of different problems you could be trying to solve and each requires a different algorithm.

Being right, does not endow the right to be rude; politeness costs nothing.
Being unknowing, is not the same as being stupid.
Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

  • Comment on Re: Efficient Assignment of Many People To Many Locations?

Replies are listed 'Best First'.
Re^2: Efficient Assignment of Many People To Many Locations?
by SmugX (Beadle) on Feb 25, 2005 at 16:57 UTC
    Good questions, dragonchild. Thank you for being alert, and reminding me that I can never define my problems as well as I think I can ... :-)

    To (hopefully) answer:

    I have more (or the same number of) locations than people. We (hopefully) wouldn't book more sales calls than we have sales people for a given day. Therefore, I guess this might equate to your flight crew situation, where M>=X.

    I think I want to minimise the mean distance. (I guess the sales team won't be happy with one poor guy having to travel the length of the country, even if the overall distance travelled for the whole group is less.)

    Presumably this latter item will be defined in my scoring/fitness routine - whether the score is per individual or for the whole group. Incidentally, it did occur to me that my "score" might not simply be the distance travelled (lower being obviously better). Perhaps I could consider returning the distance travelled squared, so that greater distances get penalised even more? (e.g. two reps travelling 50 miles each is better than one travelling 25 miles and one travelling 75.) I get a nagging feeling that this "off-the-top-of-my-head" solution may be troublesome, however. Perhaps instead I might introduce a large penalty if the distance travelled for one individual exceeds a certain threshold? Any thoughts?

    To be honest, I was envisaging trying to get the core routine working, and then "playing" with the scoring routine later. (After, for example, I run it, and find one rep travelling the length of the country. :-D)

    I hope this explains things a little better.

    SmugX

      Now, I think I'm understanding your problem better. The actual problem isn't so much the assignment of sales calls as the scheduling of sales calls. Let me rephrase it, if you don't mind:
      • You have a set of resources, each with a starting location.
      • You have a set of locations those resources have to cover, with both an expected arrival time and a duration at that location.
      • You have a set of estimated travel costs between locations. (This is the hardest part.)

      The question is how to optimize the assignment of the arrival times at each location. For example, let's say you have two sales calls in the same building, each expected to take an hour. You can assign them both to the same salesrep and schedule one for 9am and the other for 10.30 am.

      Of course, I haven't seen a good definition for the cost of travel. For example, it takes longer to go from Albany to New York vs. Philadelphia to New York, even though Albany is closer. The reason is that there is excellent train service to/from Philly, but only highways to/from Albany. And, if you want to be useful, you need to take into account plane schedules (though you could assume that everyone takes the red-eye, but you won't be popular after a few months).

      You may also want to estimate the expected ROI for a sales call. For example, if you expect $1000 of business from a call, but the salesrep's time is worth $320 ($40/hr) and it costs $600 to get there, is that salescall worth it? But, I think we're getting too complicated.

      Essentially, this is really starting to approach the travelling salesman problem in complexity.

      Being right, does not endow the right to be rude; politeness costs nothing.
      Being unknowing, is not the same as being stupid.
      Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
      Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

        Ooh, no, I'm not being quite that complicated!

        For the purposes of my problem, we can forget about times. Let's assume that each sales rep only has one call per day. My problem is merely about the best geographical assignment.

        Cost of travel is tricky - althought nowhere near as tricky as in your situation. Most reps will hopefully not be travelling that far (if I can get this algorithm right!!!) and all will be travelling by car: hence, no plane scheduling problems, and no allowing for travelling by planes, trains or automobiles as appropriate.

        Hence, I've boiled the scoring mechanism down to simply one of distance. (I'd love a way of estimating time to travel, because of course 50 miles up a motorway is slightly different to 50 miles straight across a town centre. However, whilst I'd love any help on this (I'm in the UK, if you're going to suggest any route-finding services), this is definitely out-of-scope for my original problem.)

        Thanks again,
        SmugX.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-24 23:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found