
30-03-2015, 12:39
|
 |
 |
Data wins arguments.
AKA: Phil Lopreiato
 FRC #1124 (The ÜberBots), FRC #2900 (The Mighty Penguins)
Team Role: College Student
|
|
Join Date: Apr 2010
Rookie Year: 2010
Location: NYC/Washington, DC
Posts: 1,114
|
|
|
Re: Match Scheduling
Quote:
Originally Posted by MikeE
The same scheduling algorithm is used in Districts and Regionals.
I don't think your description of the algorithm is correct. The cost function at the core of the optimization procedure prioritizes minimizing repeated alliance partners over repeated opponents. Time between matches is not part of the cost function at all, but the algorithm only considers solutions that satisfy a minimum match separation.
After generating the schedule the FMS provides overall statistics, which in my experience at District sized events does typically show the maximum number of distinct partners for most teams.
|
Here's a description of how MatchMaker works from the IdleLoop website:
Quote:
The algorithm begins by seeding the match schedule with the simplest possible schedule: the teams are dumped in the schedule sequentially in the exact same order for every round. Thereafter, teams are only rearranged within rounds. This guarantees the round uniformity requirement: no schedule that breaks the round uniformity requirement is ever even generated.
When running the algorithm, the minimum match separation is specified. The algorithm ensures that no team is forced to play two matches with less than the minimum match separation. This is also handled up front by the way teams are permuted within rounds: no permutation that would violate the minimum match separation is allowed. No schedules violating the requirement are ever considered as candidates. No other consideration is given to match separation, so one team might have the average separation between each pair of appearances and another might have half at the minimum and the other half widely separated.
The most interesting part of the puzzle is pairing uniformity. This is handled by the simulated annealing. There is a "current" schedule, which is initially the simple schedule described above. In each iteration of the algorithm, the current schedule is slightly modified by permuting some teams around as described above.
Each schedule generated, which is guaranteed to satisfy the first two criteria, is assigned a score based on the amount of partner and opponent duplication. For each team, we count the number of times that team (in a non-surrogate match) sees each other team as a partner, as an opponent, or in either role. Penalty points are added for each duplication, doubled by each additional time a given team is seen in any category. The weighting for duplication in partners is slightly heavier than for opponents, since there are only two partners, but three opponents, per round.
If the newly generated schedule has a better score than the "current" schedule from which it was derived, it becomes the current schedule. If this were the only way in which the current schedule changed, it would be possible to get into a "local valley" where we get stuck with a poor solution which is structured so that it's just a little better than any "nearby" schedule which can be obtained by the permutation procedure. To solve this problem, simulated annealing allows for a small chance of replacing the current schedule with a worse schedule, with the probably decreasing exponentially with how much worse the new schedule is. This will cause the algorithm to jump out of a local valley where no forward progress is being made over many iterations.
In addition to the "current" schedule, there's also a "best" schedule which is updated any time we find a new schedule better than the previous best. This is to make sure that we used the best schedule encountered even if the algorithm happens to randomly climb uphill from the best solution while trying to find a deeper valley.
The final step is to analyze the red/blue balancing and to swap sides on the matches in the final "best" schedule to even out the balancing as much as possible. Notice that this swapping doesn't alter any of the other criteria, since no team moves to a different match or changes partners.
|
In my experience, the algorithm has done a pretty good job of making sure all teams have the same numbers of partners and the same number of opponents (which is the metric FMS reports), even at smaller district events.
|