PDA

View Full Version : Scheduling Algorithm


DeanCheeze
06-21-2006, 04:33 AM
Dear Mam/Sir:

I need to create a formula for scheduling several sports games on several fields. The games themselves will involve two teams and each game will have varying durations, and each field can have different availability. For instance, say we have the following:

Games
1) Team A vs Team B (Duration = 40 minutes, can be played on field 1 or 2)
2) Team C vs Team D (Duration = 30 minutes, can be played on field 2 or 3)
3) Team E vs Team F (Duration = 35 minutes, can be played on field 1 or 3)

Fields:
1) Field 1 (Availability = 2 hours)
2) Field 2 (Availability = 3 hours)
3) Field 3 (Availability = 1 hour)

Based on the games and fields provided above, can you please assist me with creating a formula that will schedule the games on the correct field based on duration and availability?

I was thinking about doing something like this:
1) For each field, have a priority # = duration of games scheduled on field/availability of field
2) For each game, get the overall field availability = sum of field priorities/number of fields
3) Schedule the game with the highest overall field availability
4) Recalculate field priority # and overall field availability
5) Schedule the next game
6) Repeat steps 4 and 5 until all games are scheduled

Would this work?