Jump to content

kevphp

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

kevphp's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Suppose you have 20 cars (car_1, car_2...car_20). You also have 20 drivers (driver_1, driver_2...driver_20). Every driver has to be assigned to a car. Every driver gets to order the cars in his order of preference. driver_1's first choice may be car_3, then car_14, car_2, and then any available car. driver_2's first choice may be car_20, car_19, and then any available car. driver_3's first choice may be car_3, then car_1, car_5, car_20, and then any available car. A driver's first choice is worth 1 point, 2nd choice is 2 points, 3rd choice is 3 points. After all drivers have made their favorite selections, I now need to determine how to assign drivers to cars so that drivers get a car assigned based on their chosen order. The goal will be to minimize the number of points. With 20 cars and 20 drivers, if every driver got his first choice car, then the minimum would be 20 points, but this is not likely. I was considering creating a table with permutations of every driver and then assigning each driver his top choice which has not already been taken. This works fine for small scenarios (6 cars and 6 drivers), but for 20 cars and 20 drivers, there would be far too many table records to process. Does anyone have any suggestions on how to get started on a task like this, or can you point me to something similar.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.