Heuristics for the Traveling Tournament Problem Scheduling the
Heuristics for the Traveling Tournament Problem: Scheduling the Brazilian Soccer Championship Celso C. RIBEIRO Sebastián URRUTIA December 2003 Traveling tournament problem
Summary • • Motivation Formulation Constructive heuristic Neighborhoods Iterated local search Extended ILS: GRASP + ILS heuristic Computational results Concluding remarks December 2003 2 Traveling tournament problem
Motivation • Professional sports leagues are a major economic activity around the world. • Teams and leagues do not want to waste their investments in players and structure as a consequence of poor schedules of games. – Ronaldo (Real Madrid) scored a goal with 14 seconds on December 2 nd with the assistance US$ 222 Roberto Carlos, Raul, and Beckham: of Zidane, December 2003 3 Traveling tournament problem millions!
Motivation • Game scheduling is a difficult task, involving different types of constraints, logistic issues, multiple objectives to optimize, and several decision makers (officials, managers, TV, etc…). • The total distance traveled becomes an important variable to be minimized, to reduce traveling costs and to give more time to the players for resting and training. December 2003 unfair draws! 4 Traveling tournament problem • Avoid
Motivation • Short stories about unfair draws: – Latin-American qualification phase for 2006 World Cup • Teams did not want to play two consecutive games in the highlands (Bolivia and Equator), but were not able to find a consensus: schedule of 2002 World Cup was repeated. – Argentinian national soccer championship • Boca Juniors played at home all but one games with major teams at Maradona’s come back. December 2003 5 Traveling tournament problem
Motivation • Short stories about unfair draws: – IRB admitted unfair draw of 2003 Rugby World Cup • The International Rugby Board has admitted the World Cup draw was unfairly stacked against poorer countries so tournament organizers could maximize their profits: richer nations (e. g. Australia, Wales, New Zealand, South Africa, England, France) were given more time to play their games because of commercial arrangements with broadcasters. "Yes (it's unfair), but that's the way it is, " Millar said. • While all the bigger teams had at least 20 days to play their four pool games, the smaller sides' matches were crammed into December 2003 problem a much tighter 6 schedule (e. g. Traveling Italy, tournament Argentina,
Summary • • Motivation Formulation Constructive heuristic Neighborhoods Iterated local search Extended ILS: GRASP + ILS heuristic Computational results Concluding remarks December 2003 7 Traveling tournament problem
Formulation • Conditions: – – n (even) teams take part in a tournament. Each team has its own stadium at its home city. Distances between the stadiums are known. A team playing two consecutive away games goes directly from one city to the other, without returning to its home city. December 2003 8 Traveling tournament problem
Formulation • Conditions (cont. ): – Tournament is a strict double round-robin tournament: • There are 2(n-1) rounds, each one with n/2 games. • Each team plays against every other team twice, one at home and the other away. – No team can play more than three games in a home stand or in a road trip (away games). December 2003 9 Traveling tournament problem
Formulation • Conditions (cont. ): – Tournament is mirrored: • 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. • Goal: minimize the total distance traveled by all teams. December 2003 10 Traveling tournament problem
Formulation • Variants: – – – single round-robin no-repeaters no synchronized rounds multiple games (more than two, variable) teams with complementary patterns in the same city – pre-scheduled games and TV constraints – stadium availability – minimize airfare and hotel costs, etc. December 2003 11 Traveling tournament problem
Formulation • Some references: • Easton, Nemhauser, & Trick, “The traveling tournament problem: Description and benchmarks” (2001) • Trick, “Challenge traveling tournament instances”, web page • Nemhauser & Trick, “Scheduling a major college basketball conference” (1998) • Thompson, “Kicking timetabling problems into touch”, (1999) • Anagnostopoulos, Michel, Van Hentenryck, & Vergados, “A simulated annealing approach to the problem” (2003) December 2003 traveling tournament 12 Traveling tournament problem
Formulation • 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 edgedisjoint factors G 1=(V, E 1), . . . , Gp=(V, Ep), with E 1. . . Ep=E. • All factors in a 1 -factorization of G are 1 factors. December 2003 13 Traveling tournament problem
Formulation 1 5 2 4 3 Example: 1 -factorization of K 6 December 2003 6 14 Traveling tournament problem
Formulation 1 1 5 2 4 3 Example: 1 -factorization of K 6 December 2003 6 15 Traveling tournament problem
Formulation 2 1 5 2 4 3 Example: 1 -factorization of K 6 December 2003 6 16 Traveling tournament problem
Formulation 3 1 5 2 4 3 Example: 1 -factorization of K 6 December 2003 6 17 Traveling tournament problem
Formulation 4 1 5 2 4 3 Example: 1 -factorization of K 6 December 2003 6 18 Traveling tournament problem
Formulation 5 1 5 2 4 3 Example: 1 -factorization of K 6 December 2003 6 19 Traveling tournament problem
Formulation • Mirrored tournament: games in the second phase are determined by those in the first. – – Each edge of Kn represents a game. Each 1 -factor of Kn represents a round. Each ordered 1 -factorization of Kn is a schedule. Without considering the stadiums, there are (n -1)! times (number of nonisomorphic factors) different “mirrored tournaments”. Dinitz, Garnick, & Mc. Kay, “There are 526, 915, 620 nonisomorphic one-factorizations of K 12” (1995)20 December 2003 Traveling tournament problem
Summary • • Motivation Formulation Constructive heuristic Neighborhoods Iterated local search Extended ILS: GRASP + ILS heuristic Computational results Concluding remarks December 2003 21 Traveling tournament problem
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). – Other algorithms first define the home/away pattern and then assign teams to games. 15’ December 2003 22 Traveling tournament problem
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. December 2003 23 Traveling tournament problem
Constructive heuristic 6 Example: “polygon method” for n=6 1 5 2 1 st round 3 4 December 2003 24 Traveling tournament problem
Constructive heuristic 6 Example: “polygon method” for n=6 5 4 1 2 nd round 2 3 December 2003 25 Traveling tournament problem
Constructive heuristic 6 Example: “polygon method” for n=6 4 3 5 3 rd round 1 2 December 2003 26 Traveling tournament problem
Constructive heuristic 6 Example: “polygon method” for n=6 3 2 4 4 th round 5 1 December 2003 27 Traveling tournament problem
Constructive heuristic 6 Example: “polygon method” for n=6 2 1 3 5 th round 4 5 December 2003 28 Traveling tournament problem
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 December 2003 29 Traveling tournament problem
Constructive heuristic • Step 2: assign real teams to abstract teams – – “Polygon method” was used to build a schedule with abstract teams. Build a matrix with the number of consecutive games for each pair of abstract teams: • December 2003 For each pair of teams X and Y, an entry in this table contains the total number of times in which the other teams play consecutively with X and Y in any order. 30 Traveling tournament problem
Constructive heuristic December 2003 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 0 31 Traveling tournament problem
Constructive heuristic • Step 2: assign real teams to abstract teams – – – “Polygon method” was used to build a schedule with abstract teams. Build a matrix with the number of consecutive games for each pair of abstract teams. Greedily (QAP) 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. December 2003 32 Traveling tournament problem
Constructive heuristic n = 16: note the large number of times in which two teams are faced consecutively, which is explored by step 2 of the constructive heuristic. December 2003 33 Traveling tournament problem
Constructive heuristic • Teams (n=6): – FLAMENGO and FLUMINENSE: two teams in the same city (Rio de Janeiro) – SANTOS and PALMEIRAS: two teams in two very close cities (Santos and São Paulo) 400 kms south of Rio de Janeiro – GREMIO: team with home city approximately 1100 kms south of Rio de Janeiro – PAYSANDU: team with home city approximately 2500 kms north of Rio de Janeiro December 2003 34 Traveling tournament problem
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 December 2003 35 Traveling tournament problem
Constructive heuristic • Step 3: select stadium for each game in the first phase of the tournament – – Schedule games in multiple-game trips with no more than three away games each: face teams with close stadiums in the same road trip. Two-part strategy: • • December 2003 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. 36 Traveling tournament problem
Constructive heuristic Real teams (n=6) Round FLU SAN FLA GRE 1/6 PAY @PAL GRE @FLA SAN @FLU 2/7 GRE @FLA SAN @FLU 3/8 @SA N 4/9 PAL 5/10 December 2003 @FLA FLU @PAL PAY @PAL FLA @GRE @PAY SAN @FLU PAY 37 FLU @PAL PAY GRE Traveling tournament problem FLA @SA N
Summary • • Motivation Formulation Constructive heuristic Neighborhoods Iterated local search Extended ILS: GRASP + ILS heuristic Computational results Concluding remarks December 2003 38 Traveling tournament problem
Neighborhoods • Neighborhood “home-away swap” (HAS): select a game and exchange the stadium where it takes place. Real teams (n=6) December 2003 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 @PAL GRE @SAN 39 PAY FLU Traveling tournament problem
Neighborhoods • Neighborhood “home-away swap” (HAS): select a game and exchange the stadium where it takes place. Real teams (n=6) December 2003 Round FLU SAN FLA GRE 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 @PAL GRE @SAN 40 PAY FLU PAL PAY Traveling tournament problem
Neighborhoods • Neighborhood “team swap” (TS): select two teams and swap their games, also swap the home-away assignment of their own game. Real teams (n=6) December 2003 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 @PAL GRE @SAN 41 PAY FLU Traveling tournament problem
Neighborhoods • Neighborhood “team swap” (TS): select two teams and swap their games; also swap the home-away assignment of their own game. Real teams (n=6) December 2003 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 @PAL GRE @SAN 42 PAY FLU Traveling tournament problem
Neighborhoods • Neighborhood “team swap” (TS): select two teams and swap their games, also swap the home-away assignment of their own game. Real teams (n=6) December 2003 Round FLU SAN FLA GRE PAL PAY 1/6 PAY @PAL SAN @FLA GRE @FLU 2/7 GRE @FLA PAY @FLU SAN @PAL 3/8 @SAN FLU PAL PAY @FLA @GRE 4/9 PAL SAN @PAY FLA 5/10 @FLA @PAL FLU @SAN 43 @GRE @FLU PAY GRE Traveling tournament problem
Neighborhoods • Neighborhood “partial round swap” (PRS): select two games Ax. B and Cx. D from round X and two games Ax. C and Bx. D from round Y, and swap their rounds (only for n 8, not always possible). 30’ December 2003 44 Traveling tournament problem
Neighborhoods • Neighborhood “partial round swap” (PRS): select two games Ax. B and Cx. D from round X and two games Ax. C and Bx. D from round Y, and swap their rounds (only for n 8, not always possible). December 2003 45 Traveling tournament problem
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. December 2003 46 Traveling tournament problem
Neighborhoods 2 1 5 2 4 3 6 Enforce game 1 vs. 3 at round (factor) 2. December 2003 47 Traveling tournament problem
Neighborhoods 2 1 5 2 4 3 6 Teams 1 and 3 are now playing twice in this round. December 2003 48 Traveling tournament problem
Neighborhoods 2 1 5 2 4 3 6 Eliminate the other games played by teams 1 and 3 in this round. December 2003 49 Traveling tournament problem
Neighborhoods 2 1 5 2 4 3 6 Enforce the former oponents of teams 1 and 3 to play each other in this round: new game 2 vs. 4 in this round. December 2003 50 Traveling tournament problem
Neighborhoods 4 1 5 2 4 3 6 Consider the factor where game 2 vs. 4 was scheduled. December 2003 51 Traveling tournament problem
Neighborhoods 4 1 5 2 4 3 6 Enforce game 1 vs. 4 (eliminated from round 2) to be played in this rou December 2003 52 Traveling tournament problem
Neighborhoods 4 1 5 2 4 3 6 Eliminate games 2 vs. 4 (enforced in round 2) and 1 vs. 5 (since team 1 cannot play twice). December 2003 53 Traveling tournament problem
Neighborhoods 4 1 5 2 4 3 6 Enforce game 2 vs. 5 to be played in this round. December 2003 54 Traveling tournament problem
Neighborhoods 1 1 5 2 4 3 6 Consider the factor where game 2 vs. 5 was scheduled. December 2003 55 Traveling tournament problem
Neighborhoods 1 1 5 2 4 3 6 Enforce game 1 vs. 5 (eliminated from round 4) to be played in this round. December 2003 56 Traveling tournament problem
Neighborhoods 1 1 5 2 4 3 6 Eliminate games 2 vs. 5 (enforced in round 4) and 1 vs. 6 (since team 1 cannot play twice). December 2003 57 Traveling tournament problem
Neighborhoods 1 1 5 2 4 3 6 Enforce game 2 vs. 6 to be played in this round. December 2003 58 Traveling tournament problem
Neighborhoods 5 1 5 2 4 3 6 Consider the factor where game 2 vs. 6 was scheduled. 40’ December 2003 59 Traveling tournament problem
Neighborhoods 5 1 5 2 4 3 6 Enforce game 1 vs. 6 (eliminated from round 1) to be played in this round. December 2003 60 Traveling tournament problem
Neighborhoods 5 1 5 2 4 3 6 Eliminate games 2 vs. 6 (enforced in round 1) and 1 vs. 3 (since team 1 cannot play twice and this game was enforced in round 2 at the beginning of the ejection chain). December 2003 61 Traveling tournament problem
Neighborhoods 5 1 5 2 4 3 6 Finally, enforce game 2 vs. 3 (eliminated from round 2 at the beginning of the ejection chain ) to be played in this round. December 2003 62 Traveling tournament problem
Neighborhoods • The ejection chain terminates when the game enforced in the beginning is removed from the round where it was played in the original schedule: – The ejection chain move is able to find solutions that are not reachable through other neighborhoods. – PRS moves may appear after an ejection chain move is made. December 2003 63 Traveling tournament problem
Neighborhoods • PRS = GR for n=4; PRS GR for n 6. • Only 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 some values of n. December 2003 64 Traveling tournament problem
Neighborhoods • The length of the ejection chain is variable. • If ejections chains are not used, one may be stucked at schedules with the structure of the solutions built by the “polygon method”. – n {6, 8, 12, 14, 16, 20, 24}: no PRS moves exist if “polygon method” is used, but. . . –. . . PRS moves may appear after an ejection chain move is made. 65 December 2003 Traveling tournament problem
Summary • • Motivation Formulation Constructive heuristic Neighborhoods Iterated local search Extended ILS: GRASP + ILS heuristic Computational results Concluding remarks December 2003 66 Traveling tournament problem
Iterated local search Martin, Otto, & Felten (1991); Martin & Otto (1996) S Generate. Initial. Solution() S, S* Local. Search(S) repeat S’ Perturbation(S, history) S’ Local. Search(S’) S Aceptance. Criterion(S, S’, history) S* Update. Best. Solution(S, S*) until Stopping. Criterion December 2003 67 Traveling tournament problem
Extended GRASP + ILS heuristic while. not. Stopping. Criterion S Generate. Randomized. Initial. Solution() S, S Local. Search(S) /* S best solution in cycle */ repeat /* S* best overall solution */ S’ Perturbation(S, history) S’ Local. Search(S’) S Aceptance. Criterion(S, S’, history) S* Update. Overall. Best. Solution(S, S*) S Update. Cycle. Best. Solution(S, S) until Reinitialization. Criterion December 2003 68 Traveling tournament problem end
Extended GRASP + ILS heuristic • Initial solutions (for each cycle): – Use the constructive heuristic. – Randomize the second step: team assignment using the matrix of consecutive games. – Third step (stadium assignment) was already randomized. – New cycle is started if Reinitialization. Criterion is met. December 2003 69 Traveling tournament problem
Extended GRASP + ILS heuristic • Local search: – First improving strategy. – Multiple neighborhoods are used in this order: • TS HAS PRS HAS • GR is very costly and is not used during the local search. • Repeat until a local optimum with respect to all neighborhoods is found. – Neighbor solutions are investigated at random for each type of neighborhood. December 2003 70 Traveling tournament problem
Extended GRASP + ILS heuristic • Perturbation: – Obtain S’ by applying one ejection chain randomly selected GR move to the current solution S. – The new solution may be infeasible: perform the third step of the constructive heuristic (stadium assignment). December 2003 71 Traveling tournament problem
Extended GRASP + ILS heuristic while. not. Stopping. Criterion S Generate. Randomized. Initial. Solution() S, S Local. Search(S) /* S best solution in cycle */ repeat /* S* best overall solution */ S’ Perturbation(S, history) S’ Local. Search(S’) S Aceptance. Criterion(S, S’, history) S* Update. Overall. Best. Solution(S, S*) S Update. Cycle. Best. Solution(S, S) until Reinitialization. Criterion December 2003 72 Traveling tournament problem end
Extended GRASP + ILS heuristic • Acceptance criterion: – Set threshold acceptance criterion at =0. 1 – Accept new solution if its cost is lower than (100+ )% of the current solution. – If the current solution does not change after a certain number of iterations, double the value of (i. e. , acceptance criterion is relaxed if current solution does not change). – Reset =0. 1 when the current solution changes. 50’ December 2003 73 Traveling tournament problem
Extended GRASP + ILS heuristic • Reinitialization criterion: – If n/3 deteriorating moves are accepted since the last time the best solution in the cycle S was updated, then start a new cycle computing a new initial solution. • Re-initialization occurs if too many iterations are performed without improving the best solution in a cycle. • Computations in a cycle are not interrupted if the algorithm is improving the current solution S. December 2003 74 Traveling tournament problem
Summary • • Motivation Formulation Constructive heuristic Neighborhoods Iterated local search Extended ILS: GRASP + ILS heuristic Computational results Concluding remarks December 2003 75 Traveling tournament problem
Computational results • Benchmark circular instances with n = 8, 10, 12, 14, 16, 18, and 20 teams. • Harder benchmark MLB instances with n = 8, 10, 12, 14, and 16 teams. – All available from Michael Trick’s web page. • 2003 edition of the Brazilian national soccer championship with 24 teams. December 2003 76 Traveling tournament problem
Computational results • Largest problems solved to optimality using an integer programming formulation: n = 6 teams – Gaps: 0. 6% for n=8; 3. 6% for n=10 (MLB) • Lower bounds: approximate solutions listed at Michael Trick’s home page for the corresponding unmirrored instances. • Solutions found for CIRC and MLB instances are even better than those available for the corresponding unmirrored instances in 2002 December 20033. 5 hours for 77 tournament. IV problem (e. g. NL 16 in Traveling Pentium 2. 0
Computational results • Total distance traveled for the 2003 edition of the Brazilian soccer championship with 24 teams (instance br 24) in 12 hours (Pentium IV 2. 0 MHz): Our solution: 549, 020 kms (50% reduction) (official draw): 1, 048, 134 • Realized Approximate corresponding savingskms in airfares: US$ 1, 700, 000 December 2003 78 Traveling tournament problem
Computational results December 2003 79 Traveling tournament problem
Computational results • Methodology used to evaluate and compare different algorithms for the same problem: – Probability distribution of time-to-target-solution -value: experimental plots Aiex, Resende, & Ribeiro: “Probability distribution of solution time in GRASP: An experimental investigation”, (2002) Resende & Ribeiro: “GRASP and path-relinking: Recent advances and applications”, (2003) December 2003 80 Traveling tournament problem
Computational results • Select an instance and a target value: – Perform 200 runs using different seeds. – Stopping when a solution value at least as good as the target is found. – For each run, measure the time-to-target-value. – Plot the probabilities of finding a solution at least as good as the target value within some computation time. 55’ December 2003 81 Traveling tournament problem
Computational results Instance: br 24 Target: 586, 000 kms December 2003 82 Traveling tournament problem
Computational results Instance: br 24 Time: 10 minutes December 2003 83 Traveling tournament problem
Computational results Instance: br 24 Time: 12 hours December 2003 84 Traveling tournament problem
Summary • • Motivation Formulation Constructive heuristic Neighborhoods Iterated local search Extended ILS: GRASP + ILS heuristic Computational results Concluding remarks December 2003 85 Traveling tournament problem
Concluding remarks • Extended GRASP + ILS heuristic found very good solutions to benchmark instances: – Solutions found for CIRC and MLB instances are even better than those available for the corresponding unmirrored instances in 2002. • Effectiveness of ejection chain neighborhood. • Significant savings in airfares costs and traveled distance December 2003 86 in real instance. Traveling tournament problem
Concluding remarks • Combination of constraint programming with heuristics to handle difficult constraints. • Incorporation of additional real-life constraints in progress: TV constraints, prescheduled games, complementary teams, airfares + hotel costs, . . . • Talks with Brazilian federations of soccer (CBF) and basketball (CBB) to schedule the 2004 editions of national tournaments. December 2003 87 Traveling tournament problem
Slides and publications • Slides of this talk can be downloaded from: http: //www. inf. puc-rio. br/~celso/talks • This paper (soon) and other papers about GRASP, path-relinking, and their applications available at: http: //www. inf. puc-rio. br/~celso/publicacoes • Materials about applications of OR techniques to problems in sports management and scheduling may be found at: http: //www. esportemax. org Please let us know about new links and materials! 60’ December 2003 88 Traveling tournament problem
- Slides: 88