Augoust 2004 1/47 Heuristics for the Mirrored Traveling Tournament Problem Celso C. RIBEIRO Sebastián URRUTIA
Augoust 2004 1/47
Heuristics for the Mirrored Traveling
Tournament Problem
Celso C. RIBEIROSebastián URRUTIA
Augoust 2004 2/47
Summary
• The Mirrored Traveling Tournament Problem
• Constructive heuristic• Extended GRASP + ILS heuristic• Computational results
Augoust 2004 3/47
Motivation• The total distance traveled by teams in
round robin tournaments is an important variable to be minimized, in order to reduce traveling costs and to give more time to the players for resting and training.
Augoust 2004 4/47
• The Traveling Tournament Problem (TTP) consists in generating an schedule for a tournament between n teams subject to:– The tournament is a time constrained double
round-robin tournament:• There are exactly 2(n-1) rounds.• Each team plays against every other team twice, one at
home and the other away.
– No team can play more than three consecutive home or more than three consecutive away games.
– No repeaters are allowed (A at B followed by B at A).
– The goal is to minimize the total distance traveled by all teams during the tournament.
The Traveling Tournament Problem
Augoust 2004 5/47
• The Mirrored Traveling Tournament Problem (MTTP) has an additional constraint:– The tournament is mirrored, i.e.:
• All teams face each other once in the first phase with n-1 rounds.
• In the second phase, with the last n-1 rounds, the teams play each other again in the same order, following an inverted home/away pattern.
– Common structure in Latin-American tournaments.
– The set of feasible solutions for the MTTP is a subset of the set of feasible solutions for the TTP.
The Mirrored Traveling Tournament Problem
Augoust 2004 6/47
The Mirrored Traveling Tournament Problem
• Some references:– Easton, Nemhauser, & Trick, “The
traveling tournament problem: Description and benchmarks” (2001)
– Trick, “Challenge traveling tournament instances”, web page: http://mat.gsia.cmu.edu/TOURN/
– Anagnostopoulos, Michel, Van Hentenryck, & Vergados, “A simulated annealing approach to the traveling tournament problem” (2003)
Augoust 2004 7/47
1-Factorizations• Given a graph G=(V, E), a factor of G
is a graph G’=(V,E’) with E’E.• G’ is a 1-factor if all its nodes have
degree equal to one.• A factorization of G=(V,E) is a set of
edge-disjoint factors G1=(V,E1), ..., Gp=(V,Ep), such that E1...Ep=E.
• All factors in a 1-factorization of G are 1-factors.
Augoust 2004 14/47
• Mirrored tournament: games in the second phase are determined by those in the first.– If each edge of Kn represents a
game,
– each 1-factor of Kn represents a round and
– each ordered 1-factorization of Kn represents a feasible schedule for n teams.
1-Factorizations
Augoust 2004 15/47
Constructive heuristic
• Three steps:1. Schedule games using abstract
teams (structure of the draw).2. Assign real teams to abstract
teams.3. Select stadium for each game
(home/away pattern) in the first phase (mirrored tournament).
Augoust 2004 16/47
Constructive heuristic
• Step 1: schedule games using abstract teams
– This phase creates the structure of the tournament.
– “Polygon method” is used.– Tournament structure is fixed and
will not change in the other steps of the constructive heuristic.
Augoust 2004 17/47
Constructive heuristic
Abstract teams (n=6)
Round
A B C D E F
1/6 F E D C B A
2/7 D C B A F E
3/8 B A E F C D
4/9 E D F B A C
5/10 C F A E D B
Augoust 2004 18/47
Constructive heuristic
• Step 2: assign real teams to abstract teams
– Build a matrix with the number of consecutive games for each pair of abstract teams:• For each pair of teams X and Y, an entry
in this matrix contains the total number of times in which the other teams play consecutively with X and Y in any order.
Augoust 2004 19/47
Constructive heuristic
A B C D E F
A 0 1 6 5 2 4
B 1 0 2 5 6 4
C 6 2 0 2 5 3
D 5 5 2 0 2 4
E 2 6 5 2 0 3
F 4 4 3 4 3 0
Augoust 2004 20/47
Constructive heuristic
• Step 2: assign real teams to abstract teams
– Greedily assign pairs of real teams with close home cities to pairs of abstract teams with large entries in the matrix with the number of consecutive games.
Augoust 2004 21/47
Constructive heuristic Real teams (n=6)
Round
FLU SAN
FLA GRE
PAL PAY
1/6 PAY PAL GRE
FLA SAN
FLU
2/7 GRE
FLA SAN
FLU PAY PAL
3/8 SAN
FLU PAL PAY FLA GRE
4/9 PAL GRE
PAY SAN
FLU FLA
5/10 FLA PAY FLU PAL GRE
SAN
Augoust 2004 22/47
Constructive heuristic• Step 3: select stadium for each
game in the first phase of the tournament:
– Two-part strategy:• Build a feasible assignment of stadiums,
starting from a random assignment in the first round.
• Improve the assignment of stadiums, performing a simple local search algorithm based on home-away swaps.
Augoust 2004 23/47
Constructive heuristic Real teams (n=6)
Round FLU SAN FLA GRE PAL PAY
1/6 PAY@PA
LGRE
@FLA
SAN@FL
U
2/7 GRE@FL
ASAN
@FLU
PAY@PA
L
3/8@SA
NFLU
@PAL
PAY FLA@GR
E
4/9 PAL@GR
E@PA
YSAN
@FLU
FLA
5/10@FL
APAY FLU
@PAL
GRE@SA
N
Augoust 2004 24/47
Neighborhoods
• Neighborhood “home-away swap” (HAS): select a game and exchange the stadium where it takes place.
• Neighborhood “team swap” (TS): select two teams and swap their games; also swap the home-away assignment of their own game.
Augoust 2004 25/47
Neighborhoods
• Neighborhood “partial round swap” (PRS): select two games AxB and CxD from round X and two games AxC and BxD from round Y, and swap their rounds (only for n8, not always possible).
Rounds ATM SAP CON FLA FLU INT CRU GRE1/82/9 FLA @INT @ATM SAP3/104/11 @SAP ATM @INT FLA5/126/137/14
Augoust 2004 26/47
Neighborhoods
• Neighborhood “partial round swap” (PRS): select two games AxB and CxD from round X and two games AxC and BxD from round Y, and swap their rounds (only for n8, not always possible).
Rounds ATM SAP CON FLA FLU INT CRU GRE1/82/9 @SAP ATM @INT FLA3/104/11 FLA @INT @ATM SAP5/126/137/14
Augoust 2004 27/47
Neighborhoods
• Neigborhood “game rotation” (GR) (ejection chain):– Enforce a game to be played at some
round: add a new edge to a 1-factor of the 1-factorization associated with the current schedule.
– Use an ejection chain to recover a 1-factorization.
Augoust 2004 30/47
4 3
2
1
5
6
2
Neighborhoods
Eliminate the other games played by teams 1 and 3 in this round.
Augoust 2004 31/47
4 3
2
1
5
6
2
Neighborhoods
Enforce the former oponents of teams 1 and 3 to play each other in this round: new game 2 vs. 4 in this round.
Augoust 2004 32/47
4 3
2
1
5
6
4
Neighborhoods
Consider the factor where game 2 vs. 4 was scheduled.
Augoust 2004 33/47
Neighborhoods
4 3
2
1
5
6
4
Enforce game 1 vs. 4 (eliminated from round 2) to be played in this round.
Augoust 2004 34/47
Neighborhoods• Continue with the applications of these steps, until
the game enforced in the beginning is removed from the round where it was played in the original schedule.– Only movements in neighborhoods PRS and GR are able
to change the structure of the schedule of the initial solution built by the “polygon method”.
– However, PRS cannot always be used, due to the structure of the solutions built by “polygon method” for several values of n.
• n = 6, 8, 12, 14, 16, 20, 24
– PRS moves may appear after an ejection chain move is made.
– The ejection chain move is able to find solutions that are not reachable through other neighborhoods.
Augoust 2004 35/47
GRASP + ILS heuristic• The constructive heuristic and the
neighborhoods were used to develop a hybrid improvement heuristic for the MTTP:– This heuristic is based on the GRASP and ILS
metaheuristics.– Initial solutions: randomized version of the
constructive heuristic.– Local search: use TS, HAS, PRS and HAS cyclically
in this order until a local optimum for all neighborhoods is found. (do not search in GR!!!)
– Perturbation: random movement in GR neighborhood.
– Algorithm fully described in the paper.
Augoust 2004 36/47
GRASP + ILS heuristicwhile .not.StoppingCriterion
S GenerateRandomizedInitialSolution() S LocalSearch(S)repeat
S’ Perturbation(S,history)S’ LocalSearch(S’)S AceptanceCriterion(S,S’,history)S* UpdateBestSolution(S,S*)
until ReinitializationCriterionend
Augoust 2004 37/47
Computational results
• Benchmark circular instances with n = 12, 14, 16, 18, and 20 teams.
• Harder benchmark MLB instances with n = 12, 14, and 16 teams. – All available from
http://mat.gsia.cmu.edu/TOURN/
• 2003 edition of the Brazilian national soccer championship with 24 teams.
Augoust 2004 38/47
Computational results
• All numerical results on a Pentium IV 2.0 MHz machine.
• Comparisons with best known approximate solutions for the corresponding less constrained not necessarily mirrored instances.
Augoust 2004 39/47
Computational results
• Constructive heuristic:– Very fast
• Instance MLB16: 1000 runs in approximately 1 second
– Average gap is 17.1%– Better solutions than those found after
several days of computations by some metaheuristic aproachs to the not necessarily mirrrored version of the problem
Augoust 2004 40/47
• GRASP + ILS heuristic: time limit is 10 minutes only
• Largest gap with respect to the best known solution for the less constrained not necessarily mirrored problem was 9,5%.
(before this work, times were measured in days!)
Computational results
Augoust 2004 41/47
Computational results
Instance
Best unmirrored
Best mirrored
gap (%)
Time to best (s)
circ12 420 456 8.6 8.5
circ14 682 714 4.7 1.1
circ16 976 1004 2.9 115.3
circ18 1420 1364 -3.9 284.2
circ20 1908 1882 -1.4 578.3
nl12 112298 120655 7.4 24.0
nl14 190056 208086 9.5 69.9
nl16 267194 285614 6.9 514.2
Augoust 2004 42/47
Computational results
Instance
Best unmirrored
Best mirrored
gap (%)
Time to best (s)
circ12 420 456 8.6 8.5
circ14 682 714 4.7 1.1
circ16 976 1004 2.9 115.3
circ18 1420 1364 -3.9 284.2
circ20 1908 1882 -1.4 578.3
nl12 112298 120655 7.4 24.0
nl14 190056 208086 9.5 69.9
nl16 267194 285614 6.9 514.2
Augoust 2004 43/47
Computational results
Instance
Best unmirrored
Best mirrored
gap (%)
Time to best (s)
circ12 420 456 8.6 8.5
circ14 682 714 4.7 1.1
circ16 976 1004 2.9 115.3
circ18 1364 1364 0.0 284.2
circ20 1882 1882 0.0 578.3
nl12 112298 120655 7.4 24.0
nl14 190056 208086 9.5 69.9
nl16 267194 285614 6.9 514.2
Augoust 2004 44/47
• New heuristic improved by 3.9% and 1.4% the best known solutions for the corresponding less constrained unmirrored instances circ18 and circ20.
• Computation times are smaller than computation time of other heuristics, e.g. for instance MLB14:– Anagnostopoulos et al. (2003):
approximately five days of computation time
– GRASP + ILS: 10 minutes
Computational results
Augoust 2004 45/47
Computational results• Total distance traveled for the 2003 edition
of the Brazilian soccer championship with 24 teams (instance br24) in 15 min. (Pentium IV 2.0 MHz):Our solution: 506,433 kms Realized (official draw): 1, 048,134 kms(52% reduction)
• Approximate corresponding potential savings in airfares:US$ 1,700,000
Augoust 2004 46/47
• Constructive heuristic is very fast and effective.
• GRASP + ILS heuristic found very good solutions to benchmark instances:– Very fast (10 minutes)– Solutions found for some instances are even
better than those available for the corresponding less constrained not necessarily mirrored instances.
– Optimal solution for MLB and circ instances with n = 4 and 6
– For a new class of easier instances the heuristic found the optimal solution for n = 4, 6, 8, 10,12 and 16.
• Urrutia & Ribeiro, “Minimizing travels by maximizing breaks in round robin tournament schedules” (2004)
Concluding Remarks