20

Click here to load reader

Approximation algorithms for TTP(2)

  • Upload
    stephan

  • View
    232

  • Download
    8

Embed Size (px)

Citation preview

Page 1: Approximation algorithms for TTP(2)

Math Meth Oper Res (2012) 76:1–20DOI 10.1007/s00186-012-0387-4

ORIGINAL ARTICLE

Approximation algorithms for TTP(2)

Clemens Thielen · Stephan Westphal

Received: 8 March 2011 / Published online: 29 April 2012© Springer-Verlag 2012

Abstract We consider the traveling tournament problem, which is a well-knownbenchmark problem in tournament timetabling. It consists of designing a schedule fora sports league of n teams such that the total traveling costs of the teams are minimized.The most important variant of the traveling tournament problem imposes restrictionson the number of consecutive home games or away games a team may have. We con-sider the case where at most two consecutive home games or away games are allowed.We show that the well-known independent lower bound for this case cannot be reachedand present two approximation algorithms for the problem. The first algorithm hasan approximation ratio of 3/2 + 6

n−4 in the case that n/2 is odd, and of 3/2 + 5n−1

in the case that n/2 is even. Furthermore, we show that this algorithm is applicableto real world problems as it yields close to optimal tournaments for many standardbenchmark instances. The second algorithm we propose is only suitable for the casethat n/2 is even and n ≥ 12, and achieves an approximation ratio of 1 + 16/n in thiscase, which makes it the first 1 + O(1/n)-approximation for the problem.

Parts of this work appeared as an extended abstract in: Proceedings of the 21st International Symposiumon Algorithms and Computation (ISAAC 2010), Part II, Otfried Cheong, Kyung-Yong Chwa, and KunsooPark (eds.), LNCS vol. 6507 (2010), pp. 303–314, Springer.

C. Thielen (B)Department of Mathematics, University of Kaiserslautern, Paul-Ehrlich-Str. 14,67663 Kaiserslautern, Germanye-mail: [email protected]

S. WestphalUniversity of Goettingen, Institute for Numerical and Applied Mathematics,Lotzestr. 16-18, 37083 Goettingen, Germanye-mail: [email protected]

123

Page 2: Approximation algorithms for TTP(2)

2 C. Thielen, S. Westphal

Keywords Sports scheduling · Traveling tournament problem · Timetabling ·Approximation algorithms

1 Introduction

Professional sports leagues exist all over the world. Popular leagues are often of hugeeconomic importance due to the enormous revenues generated by selling tickets andbroadcasting rights for the games. Hence, the planning of these leagues is of majorimportance. An important aspect is the generation of a timetable for the tournamentsthat specifies the order in which the teams play each other during the season and thevenue of each game. A well-studied variant of this problem is the traveling tourna-ment problem (TTP), which was formally introduced by Easton et al. (2001). Giventhe number of teams and the pairwise distances between their home venues, TTP asksfor a timetable of a double round robin tournament that minimizes the sum of thedistances traveled by the teams during the season. This problem is quite important inpractice, for example in the US, where the distances between two teams’ home venuesare often quite large, so minimizing travel distance becomes a major issue.

The variant of TTP most relevant in practice imposes restrictions on the numberof consecutive home games or away games a team may have. The schedules of manymajor sports leagues, e.g., the Major League Baseball (MLB) in the US, contain suchrestrictions. The case that was studied most so far is that the number of consecutivehome or away games is upper bounded by three. The case TTP(2), where only twoconsecutive home or away games are allowed, was studied in a classical paper byCampbell and Chen (1976), who scheduled a basketball conference of ten teams witha solution method based on matching techniques. Their method, however, only yieldsa relaxed tournament, which needs two time slots more than necessary. Moreover, noupper bound on the number of consecutive home games was considered and the sched-ules constructed by their method violate the upper bound of at most two consecutiveaway games for some teams.

We now formally define the traveling tournament problem (TTP) and introduceour notation. We are given a set of n teams, where n ≥ 4 is even. An (n × n)-dis-tance matrix D = (di j ) specifies the distances between the home venues of the teams,i.e., di j ≥ 0 is the distance between the home venues of teams i and j . The distancesare assumed to be symmetric (i.e., di j = d ji for all i, j) and satisfy dii = 0 for all i aswell as the triangle inequality (i.e., di j +d jk ≥ dik for all i, j, k). A game is an orderedpair of teams, where the first team is the home team and the second the away team.A sequence of consecutive away games of a team is called a road trip, and sequence ofconsecutive home games is called a home stand. A road trip or home stand consistingof more than one game is called a break. A double round robin tournament is a collec-tion of games in which every team plays every other team once at home and once away(i.e., at the other team’s home venue). Hence, exactly 2n − 2 time slots are necessaryfor a double round robin tournament. Before the tournament, each team is assumed tostay at its home venue and it has to return there after the tournament in case that its lastgame is an away game. Between two consecutive away games, a team travels directlyfrom the venue of the first opponent to the venue of the second opponent. With this

123

Page 3: Approximation algorithms for TTP(2)

Approximation algorithms for TTP(2) 3

terminology, the traveling tournament problem for a positive integer k ≥ 2 is definedas follows:

Definition 1 (The Traveling Tournament Problem (T T P(k)) Easton et al. 2001)INSTANCE: The set of n teams and the distance matrix D = (di j ).TASK: Compute a feasible double round robin tournament of the teams sat-

isfying the following conditions:

(a) The length of any home stand is at most k.(b) The length of any road trip is at most k.(c) Game j at i is not followed immediately by game i at j .(d) The sum of the distances traveled by the teams is minimized.

1.1 Previous work

Since the proposal of TTP by Easton et al. (2001), many approximation algorithmsand heuristics have been designed for the problem (cf., for example, Easton et al. 2003;Anagnostopoulos et al. 2006; Miyashiro et al. 2008; Yamaguchi et al. 2011; Westphaland Noparlik 2010). The first algorithm with a constant approximation ratio was the(2 + (9/4)/(n − 1))-approximation algorithm for TTP(3) proposed by Miyashiroet al. (2012). Recently, Westphal and Noparlik (2012) presented the first constantfactor approximation for k > 3, which achieves an approximation ratio of at most5 + 3/n + 3/(2k). The only approximation results on TTP(2) we are aware of arethe ones due to Campbell and Chen (1976) already mentioned above. The complexityof TTP(k) was recently settled in Thielen and Westphal (2011) by showing that theproblem is strongly NP-hard to solve for any fixed k ≥ 3. A modified version ofTTP without restrictions on the number of consecutive home games or away gameswas shown to be strongly NP-hard in Bhattacharyya (2009). Surveys on round robinscheduling and TTP can be found in Kendall et al. (2010) and Rasmussen and Trick(2008).

1.2 Our contribution

We show that the independent lower bound for TTP(2) obtained by matching tech-niques in Campbell and Chen (1976) can in fact not be reached in general withoutviolating some constraints of TTP. Instead, we use this bound to construct approxi-mation algorithms for the problem.

Our first approximation algorithm always outputs a tournament with overall dis-tance traveled at most 3/2 + 5

n−1 times optimal in the case that n/2 is even and at

most 3/2 + 6n−4 times optimal in the case that n/2 is odd. Furthermore, we show

that this algorithm is applicable to real world problems as it yields close to optimaltournaments for many standard benchmark instances in a very short amount of time.

Our second approximation algorithm works only in the case that n/2 is even andn ≥ 12, where it achieves an approximation ratio of 1+16/n, which makes it the first1 + O(1/n)-approximation for the problem.

123

Page 4: Approximation algorithms for TTP(2)

4 C. Thielen, S. Westphal

2 The independent lower bound

In this section, we present the independent lower bound for TTP(2) obtained byCampbell and Chen (1976) and show that this lower bound cannot be reached ingeneral.

The basic idea of the independent lower bound is that the optimal trips for a giventeam i can be obtained by computing a minimum weight perfect matching in the com-plete undirected graph G on the set of teams with the weight of the edge from team jto team k given as the distance d jk between the home venues of j and k. Figure 1illustrates the construction. Since team i has to visit each of the other teams and mayvisit at most two teams in one trip, it has to use each of the dotted edges [i, j], j �= i , atleast once. Thus, we may ignore these edges when looking for an optimal set of trips.Moreover, the number of trips of length 2 must be maximized in order to minimize thetravel distance. Hence, an optimal set of trips corresponds to a partition of the teamsinto pairs such that the sum of the distances between the paired teams is minimized.Each pair in the pairing is then visited by team i in a single trip, and the team that ispaired with i itself is visited in a trip of length 1. Such a pairing is exactly a minimumweight perfect matching in G. In particular, the optimal pairing is independent of theteam i for which the travel distance is minimized.

Using this lower bound on the distance traveled by a single team for each of theteams independently yields the following lower bound on the overall distance traveledin any feasible tournament: Writing � := ∑

i �= j di j , the overall distance traveled inany feasible tournament is at least

n∑

i=1

(

d(M) +∑

j �=i

di j

)

= � + n · d(M), (1)

where d(M) is the weight of a minimum weight perfect matching in G.The reason that this lower bound cannot be reached in general is that the optimal

trips for the teams given by the perfect matching cannot be synchronized to yield afeasible tournament. To see why, suppose that the minimum weight perfect matchingin G is unique. Then, by uniqueness of the minimum weight perfect matching, theonly possible a way to reach the independent lower bound is to use the optimal set of

Fig. 1 Optimal trips for team iobtained from a minimumweight matching

123

Page 5: Approximation algorithms for TTP(2)

Approximation algorithms for TTP(2) 5

Fig. 2 No team t3 �= t2 can visit t1 in slot l − 1

trips shown above for each team. To see why these optimal trips do not yield a feasibletournament, consider two teams t1, t2 that are paired in the matching and look at thetime slot l in the tournament in which team t1 visits team t2. Since t1 uses the tripsgiven by the matching, the trip in which it visits t2 has length 1, so t1 has home gamesin the slots l − 1, l + 1 adjacent to l. Using this, Fig. 2 shows why we already obtaina contradiction to Constraint (c) of TTP: If some team t3 �= t2 visits t1 in slot l − 1,team t3 must have visited t2 in the previous slot l − 2 as it travels according to theperfect matching and [t1, t2] is a matching edge. But this implies that t2 has a trip oflength 1 in slot l − 1, which can only be the case if it visits t1 in this slot. t1 was,however, already assumed to play against t3 in slot l − 1. Hence, the only possibilitywould be that t2 visits t1 in slot l − 1, which contradicts Constraint (c) of TTP as t1visits t2 in the adjacent slot l.

Even without Constraint (c) we would obtain a contradiction since, by symmetry,the same argumentation yields that only t2 can visit t1 in slot l + 1, so t2 would haveto visit t1 twice.

3 An efficient approximation algorithm

A well-known, simple way to construct a 2-approximation for TTP(2) is to take anarbitrary schedule with the minimum possible number of breaks. In such a schedule,n − 2 of the n teams have one trip containing two games, while all other trips containexactly one game. Because of the triangle inequality, the distance traveled on eachtrip consisting of two games is not longer than the distance traveled when visiting theopponents of these games separately. Thus, the total length of the trips correspondingto this schedule is not greater than 2�. Since the cost of any feasible tournament isat least � as shown in the previous section, this schedule yields a 2-approximation.A similar argument was used in Miyashiro et al. (2012) to obtain a 3-approximationfor TTP(3).

In the rest of this section, we present an algorithm that constructs a tournament Tof total cost at most 3/2 + 6

n−4 times optimal in the case that n/2 is odd, and of cost

at most 3/2 + 5n−1 in the case that n/2 is even. This yields an approximation ratio less

than 2 for n ≥ 16.

3.1 Construction of the tournament T

We assume that the n teams are numbered such that the edges (1, 2), (3, 4), . . . ,

(n − 1, n) form a minimum weight perfect matching M in the graph G. For each

123

Page 6: Approximation algorithms for TTP(2)

6 C. Thielen, S. Westphal

i = 1, . . . , n, we denote the sum of the distances of team i to all other teams by s(i),i.e.,

s(i) :=∑

j �=i

di j .

As∑n

i=1 s(i) = �, we can choose the numbering in such a way that s(n − 1) + s(n)

≤ 2 · �/n. Furthermore, we may order the two teams on each matching edge suchthat s(i) ≥ s(i +1) for every odd i ≤ n/2, and s(i) ≤ s(i +1) for every odd i > n/2.Hence, we obtain

n/2∑

i=1, i odd

s(i + 1) +n−2∑

i=n/2+1, i odd

s(i) ≤ �

2− (s(n − 1) + s(n))/2. (2)

In order to schedule the matches between the teams, we apply the canonical tour-nament introduced by de Werra (1981). This way, we make sure that each team playsagainst every other team exactly once. This initial canonical schedule can be obtainedby assigning the teams to the vertices of a special graph as displayed in Fig. 3 forn = 20.

The matches of the first time slot correspond to the pairs of vertices being adjacentto each other and a game always takes place at the venue of the team assigned to thehead of the corresponding arc. The second day’s matches can be obtained by changingthe assignment of the teams to the black vertices in counterclockwise direction asshown in Fig. 4. The schedules for the other time slots are derived analogously. Theonly difference is that the orientation of the arc incident to team 20 changes everysecond time, thus making sure that the road trips and home stands of team 20 do notget longer than 2.

Clearly, the first half of the tournament obtained this way has no road trip or homestand longer than two. The second half is derived from the first half by repeatingthe matches of the first half with changed home field advantage. As the first halfdoes not contain any road trip or home stand longer than two matches, the sec-ond half will not contain any road trips or home stands being too long either. Weonly need to make sure that the connection of the two halves does not yield any

Fig. 3 Games at the first time slot for n = 20

Fig. 4 Games at the second time slot for n = 20

123

Page 7: Approximation algorithms for TTP(2)

Approximation algorithms for TTP(2) 7

such event. If we started the second half with the same match as the first one, wemight obtain road trips of length four. Team 13 would encounter such a situation inthe tournament stated in Fig. 3 as it would end the first half of the season with aroad trip containing teams 6 and 7 and start the second half with two away gamesagainst 8 and 9, thus obtaining a road trip of length four. Therefore, we start the sec-ond half with the last two games of the first half. This way, we make sure that notwo games against the same opponent are played consecutively (Definition 1, Condi-tion (c)) and additionally take care that no road trips or home stands at the connectionof the two halves become too long. We can see that the latter holds by consider-ing the four possible cases for the games at the connection point. In case the firsthalf of some team t ends with two away games against teams t1 and t2, the sec-ond half starts with one home game against t1 which is followed by another homegame against t2. We denote such a sequence by AAHH, where A stands for an awaygame and H for a home game. The other possible sequences read HHAA, AHHA,and HAAH, and none of these sequences yield a road trip or home stand longerthan 2.

3.2 Costs of the tournament T for n/2 even

In this section, we prove an upper bound for the total length of the tours defined bythe tournament T constructed above in the case that the number n of teams is divisibleby 4, i.e., n/2 is even. In the next section, we will derive a slightly larger bound forthe case that n/2 is odd.

We assume that every team t having an away game against team n drives homebefore driving to team n’s venue and drives home again after having played thatmatch. By construction, t has a home game before or after that game anyway, so wejust added one more visit home. By the triangle inequality, this can only increase thetotal cost of the tournament. Furthermore, we apply the triangle inequality a secondtime by assuming that every team drives home after the last game of the first half ofthe season if it is not already at home. We now estimate the distances related to theconstructed tournament T separately.

Ch—The costs related to home games of team n: Every other team plays one awaygame against team n. As we can assume by application of the triangle inequality thatall teams come from their home venues to play against team n and return to their homevenues after this game, we know that the cost incurred thereby is at most

Ch ≤n−1∑

i=1

(d(i, n) + d(n, i)) = 2s(n).

Ca—The costs related to away games of team n: Analogously to the estimation ofthe home games of team n, we can upper bound the costs incurred by the away gamesof team n by first assuming that team n always returns home after each away game.This way, we derive the same upper bound of 2s(n) for the costs Ca incurred by theaway games.

123

Page 8: Approximation algorithms for TTP(2)

8 C. Thielen, S. Westphal

Cs—The costs related to the first days of the season halves and the costs of returninghome after the last days of the season halves: At the first day of the season, n/2 teamshave to travel to their opponents. We do not consider the games that the teams n − 1and n are involved in, as we have already taken care of these costs above. Hence, thereare n/2 − 2 distances traveled left, which correspond to all but one of the verticalarcs in Fig. 3. After the games of day n − 1, the first half of the season is over andwe assume that all teams drive home. The second half of the season starts with thematches that have already taken place at day n − 2 and it ends with the second leg ofthe game of day n − 3.

Observe that the orientation of the arcs does not have an effect on the total dis-tance traveled. It only affects the question who is driving, which is not of interest here.In the example mentioned above, for team 13, the matches to consider are those againstthe teams 8, 7, 6, and 5. If team 13 did not start the season this way but with a matchagainst team 9 say, we would need to consider the distances to the teams 9, 8, 7, and6. Overall, there are n − 1 different choices for the first and last trips of the two halvesof the season and each edge of ({1, . . . , n − 1} × {1, . . . , n − 1}) is part of at mostfour of these choices. Hence, summing up the distances of the n −1 different possiblechoices, we obtain a total of at most

n−1∑

i=1

n−1∑

j=i+1

4di j = 2� − 4s(n) ≤ 2�.

Consequently, there has to be a choice for which Cs ≤ 2�/(n − 1).

Co—The other costs: The opponent schedule for the first half of the tournament inthe example is shown in Table 1. Here, the i th row displays the opponents of team i inthe order they are faced in the course of the first half of the season. We now consider thecost of each row separately. By adding an additional drive from the last opponent tothe first opponent of team i in the first half of the season, we obtain a cyclic orderof the opponents and the cost only increases. Observe that we already considered thedistances incurred by playing against team n. The costs of the remaining trips in thecyclic order are exactly the same as the costs for playing against the opponents inorder i + 1, i + 2, . . . , n − 1, 1, 2, . . . , i − 1, like for team 10 in the example fromTable 1. The same can be done for the second half of the season, where we obtain thesame order of games as for the first one. As the road trips of the second half are exactlythe home stands of the first half and vice verse, it suffices to consider, for each team i ,a sequence of away games against the teams i + 1, i + 2, . . . , n − 1, 1, 2, . . . , i − 1with only the first and the last trip having length one and all other trips having lengthtwo.

Thus, for every team i with i being even, we see that the trips visiting teams1, 2, . . . , i − 2 include edges that are part of M . Hence, by the triangle inequality, thedistance c(i) traveled by i is not greater than

123

Page 9: Approximation algorithms for TTP(2)

Approximation algorithms for TTP(2) 9

1 20 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 192 19 1 20 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 183 18 19 1 2 20 4 5 6 7 8 9 10 11 12 13 14 15 16 174 17 18 19 1 2 3 20 5 6 7 8 9 10 11 12 13 14 15 165 16 17 18 19 1 2 3 4 20 6 7 8 9 10 11 12 13 14 156 15 16 17 18 19 1 2 3 4 5 20 7 8 9 10 11 12 13 147 14 15 16 17 18 19 1 2 3 4 5 6 20 8 9 10 11 12 138 13 14 15 16 17 18 19 1 2 3 4 5 6 7 20 9 10 11 129 12 13 14 15 16 17 18 19 1 2 3 4 5 6 7 8 20 10 1110 11 12 13 14 15 16 17 18 19 1 2 3 4 5 6 7 8 9 2011 10 20 12 13 14 15 16 17 18 19 1 2 3 4 5 6 7 8 912 9 10 11 20 13 14 15 16 17 18 19 1 2 3 4 5 6 7 813 8 9 10 11 12 20 14 15 16 17 18 19 1 2 3 4 5 6 714 7 8 9 10 11 12 13 20 15 16 17 18 19 1 2 3 4 5 615 6 7 8 9 10 11 12 13 14 20 16 17 18 19 1 2 3 4 516 5 6 7 8 9 10 11 12 13 14 15 20 17 18 19 1 2 3 417 4 5 6 7 8 9 10 11 12 13 14 15 16 20 18 19 1 2 318 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 20 19 1 219 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 20 120 1 11 2 12 3 13 4 14 5 15 6 16 7 17 8 18 9 19 10

Table 1 Opponent schedule for the teams in the example. Games contained in trips following edges of Min the cyclic order are colored grey.

i−2∑

j=1

di j +i−3∑

j=1, j odd

d j, j+1 + 2di,i−1 + 2di,i+1 + 2di,n−1 +n−2∑

j=i+2

2di j

=i−2∑

j=1

di j +i−3∑

j=1, j odd

d j, j+1+n−1∑

j=i−1

2di j =i−3∑

j=1, j odd

d j, j+1 + s(i)−din +n−1∑

j=i−1

di j .

Analogously, for every team i with i being odd, we see that the trips visiting teamsi + 2, . . . , n − 2 include edges that are part of M . Hence, the distance c(i) traveledby i is at most

n−2∑

j=i+2

di j +n−3∑

j=i+2, j odd

d j, j+1 + 2di,i−1 + 2di,i+1 + 2di,n−1 +i−2∑

j=1

2di j

=n−3∑

j=i+2, j odd

d j, j+1 + di,n−1 + s(i) − din +i+1∑

j=1

di j .

Hence, the sum c(i) + c(i + 1) for any odd i < n − 2 amounts to

n−3∑

j=i+2, j odd

d j, j+1 + di,n−1 + s(i) − din +i+1∑

j=1

di j

+i−2∑

j=1, j odd

d j, j+1 + s(i + 1) − di+1,n +n−1∑

j=i

di+1, j ≤ d(M) + di,n−1 + s(i)−din

+ s(i + 1) − di+1,n +i+1∑

j=1

di j +n−1∑

j=i

di+1, j − di,i+1

︸ ︷︷ ︸=: f (i)

.

123

Page 10: Approximation algorithms for TTP(2)

10 C. Thielen, S. Westphal

As s(i) ≥ s(i + 1) for all odd i ≤ n/2, we estimate f (i) in this case as

f (i) =i+1∑

j=1

di j +n−1∑

j=i

di+1, j − di,i+1 =i−1∑

j=1

di j +n−1∑

j=i

di+1, j

≤i−1∑

j=1

(di,i+1 + di+1, j ) +n−1∑

j=i

di+1, j =i−1∑

j=1

di,i+1 +i−1∑

j=1

di+1, j +n−1∑

j=i

di+1, j

= (i − 1)·di,i+1 + s(i + 1) − di+1,ni≤n/2≤ (n/2 − 1)·di,i+1 + s(i + 1) − di+1,n .

Analogously, for all odd i > n/2, we have that s(i) ≤ s(i + 1), so we estimate

f (i) =i+1∑

j=1

di j +n−1∑

j=i

di+1, j − di,i+1 =i+1∑

j=1

di j +n−1∑

j=i+2

di+1, j

≤i+1∑

j=1

di j +n−1∑

j=i+2

(di+1,i + di j ) =n−1∑

j=1

di j +n−1∑

j=i+2

di+1,i

=n−1∑

j=1

di j + (n − i − 2) · di+1,ii>n/2≤ s(i) − din + (n/2 − 1) · di+1,i .

Overall, we can conclude that∑n−2

i=1 c(i) amounts to

n−2∑

i=1, i odd

(c(i) + c(i + 1))

≤n−2∑

i=1, i odd

(

d(M) + di,n−1 + s(i) − din + s(i + 1) − di+1,n + f (i)

)

≤n−2∑

i=1, i odd

(

d(M) + di,n−1 + s(i) − din + s(i + 1) − di+1,n

)

+n/2∑

i=1, i odd

(

(n/2 − 1) · di,i+1 + s(i + 1) − di+1,n

)

+n−2∑

i=n/2+1, i odd

(

s(i) − din + (n/2 − 1) · di+1,i

)

Eq.(2)≤n−2∑

i=1, i odd

(

d(M) + di,n−1

)

+ � − s(n − 1) − s(n) − s(n)

123

Page 11: Approximation algorithms for TTP(2)

Approximation algorithms for TTP(2) 11

+ (n/2 − 1) · d(M) + �/2 − (s(n − 1) + s(n))/2

≤ (n/2 − 1) · d(M) + 3/2 · � − 2s(n) + (n/2 − 1) · d(M) − (s(n − 1) + s(n))/2

= (n − 2) · d(M) + 3/2 · � − 2 · s(n) − (s(n − 1) + s(n))/2.

Moreover, team n − 1 has to travel to all of its opponents separately incurring a costof at most 2 · s(n − 1). Finally, the total cost can be estimated as

Ch + Ca + Cs + Co

≤2s(n) + 2s(n) + 2�/(n − 1)

+ (n − 2) · d(M) + 3/2 · � − 2s(n) + 2s(n − 1) − (s(n − 1) + s(n))/2

=3/2 · (s(n − 1) + s(n)) + 2�/(n − 1) + (n − 2) · d(M) + 3/2 · �

≤3/2 · (2�/n) + 2�/(n − 1) + (n − 2) · d(M) + 3/2 · �

≤5�/(n − 1) + (n − 2) · d(M) + 3/2 · �.

As we have a lower bound of �+n ·d(M) for the total cost of any feasible tournament,this yields an overall approximation ratio of 3

2 + 5n−1 .

3.3 Costs of the tournament T for n/2 odd

Recall that, after having played against team n, team i has to play against the teamsi + 1, i + 2, . . . , n − 1, 1, 2, . . . , i − 1. In the case that n is not a multiple of 4, theestimation of the cost c(i) changes slightly as there might occur an additional drivehome between the (n/2 − 1)th game g1 and the n/2th game g2 of the sequence i + 1,

i +2, . . . , n −1, 1, 2, . . . , i −1, which might have been counted as a road trip before.We distinguish three cases:

Case 1: i +n/2 ≤ n−1. The game g1 is against team i +n/2−1, and g2 is the gameagainst team i + n/2. For even i , we have applied the triangle inequality in this caseanyway, so that c(i) does not change. Otherwise, it changes by di,i+n/2−1 + di,i+n/2− di+n/2−1,i+n/2.

Case 2: i + n/2 = n. The game g1 is against team n − 1, and g2 is the game againstteam 1. In this case, we have applied the triangle inequality anyway, so that c(i) doesnot change.

Case 3: i + n/2 > n. The game g1 is against team i − n/2, and g2 is the gameagainst team i −n/2+1. For odd i , we have applied the triangle inequality in this caseanyway, so that c(i) does not change. Otherwise, it changes by di,i−n/2 + di,i−n/2+1− di−n/2,i−n/2+1.

123

Page 12: Approximation algorithms for TTP(2)

12 C. Thielen, S. Westphal

The additional costs for all three cases sum up to

C̃ :=n/2−1∑

i=1, i odd

(di,i+n/2−1 + di,i+n/2 − di+n/2−1,i+n/2

)

+n−2∑

i=n/2+1, i even

(di,i−n/2 + di,i−n/2+1 − di−n/2,i−n/2+1

)

≤n/2−1∑

i=1, i odd

(di,i+n/2−1 + di,i+n/2

) +n−2∑

i=n/2+1, i even

(di,i−n/2 + di,i−n/2+1

)

≤n/2−1∑

i=1, i odd

(di,i+n/2−1 + di,i+n/2

) +n/2−2∑

i=1, i odd

(di+n/2,i + di+n/2,i+1

)

≤n/2−2∑

i=1, i odd

(di,i+n/2−1 + 2 · di,i+n/2 + di+1,i+n/2

).

We already assumed that the teams are numbered such that the edges (i, i + 1)

for i odd form a minimum weight perfect matching M in G and that s(n − 1) +s(n) ≤ 2 · �/n. We are, however, still free to choose the mapping of the edgesin M̃ := M \ {(s(n −1), s(n))} to the pairs (i, i +1). In the following, we will choosethis mapping in a way that minimizes the additional costs C̃ .

We consider the complete undirected graph G ′ on M̃ . Each vertex (u, v) of G ′corresponds to a pair of teams u and v that form an edge (u, v) ∈ M̃ and which weordered such that s(u) ≤ s(v). Using this ordering for every vertex of G ′, we definea weight function w on the edges of G ′ by

w((u, v), (w, z)) := duw + duz + dwu + dwv for all (u, v), (w, z) ∈ M̃ .

The sum of the weights of the edges of G ′ is then

((u,v),(w,z))∈E[G ′]w((u, v), (w, z)) = 1/2 ·

(u,v) �=(w,z)∈M̃

(duw + duz + dwu + dwv)

≤ 1/2 ·⎛

⎝∑

(u,v)∈M̃

s(u) +∑

(w,z)∈M̃

s(w)

⎠ =∑

(u,v)∈M̃

s(u) ≤ �/2,

where the last inequality holds since s(u) ≤ s(v) for all (u, v) ∈ M̃ .Since every complete graph is 1-factorable, there exists a decomposition of the

edges of G ′ into n/2 − 2 perfect matchings. Thus, the weight of the minimum weightperfect matching M ′ with respect to w in G ′ can be estimated as

w(M ′) ≤ �/2

n/2 − 2= �

n − 4.

123

Page 13: Approximation algorithms for TTP(2)

Approximation algorithms for TTP(2) 13

Given M ′ =: {((ui , vi ), (wi , zi )) : i = 1, 3, 5, . . . , n/2 − 2}, we assign the teams tothe numbers 1, 2, . . . , n −2 by giving team ui the number i , team vi the number i +1,team wi the number i + n/2, and team zi the number i + n/2 − 1.

Observe that this assignment violates none of the assumptions on the numbering ofthe teams made so far. Moreover, we can conclude after straightforward calculationsthat C̃ ≤ �

n−4 , which, for the case that n/2 is odd, leads to an overall approximation

ratio of 3/2 + 5n−1 + 1

n−4 ≤ 3/2 + 6n−4 .

4 A 1 + O(1/n)-approximation for n/2 even

In this section, we present an approximation algorithm that achieves an approxima-tion ratio of 1 + 16/n in the case that n/2 is even and n ≥ 12. This is the first1 + O(1/n)-approximation known so far.

The tournament we construct in the algorithm uses the optimal trips proposed bythe independent lower bound for most of the games. Whenever it uses some subopti-mal trips, we calculate the additional cost incurred and then show at the end that allof these additional costs are in O(1/n).

As before, we assume that the teams are numbered such that the edges (1, 2),

(3, 4), . . . , (n −1, n) form a minimum weight perfect matching M in the graph G andwe denote the sum of the distances of team i to all other teams by s(i) = ∑

j �=i di j .As

∑ni=1 s(i) = �, we can choose the numbering in such a way that

n∑

i=n−3

s(i) ≤ 4 · �/n andn∑

i=n−5

s(i) ≤ 6 · �/n.

For the vertices 2, 4, 6, . . . , n − 6, we assume that they are visited in this order in asolution T̃ obtained by Christofides Algorithm (Christofides 1976) for the travelingsalesman problem (TSP) on these vertices. This will prove useful later since, as eachof these team has to visit every other team, each of these teams has to travel at leastthe distance d(T OPT) of an optimal TSP tour T OPT on the vertices 2, 4, 6, . . . , n − 6.In particular, this yields a lower bound of n ·d(T OPT) for the total cost of a tournament.

In order to schedule the matches between the teams, we apply a scheme inspired bythe canonical tournament introduced by de Werra (1981). The initial schedule can beobtained by assigning the pairs of teams (1, 2), (3, 4), . . . , (n − 1, n) to the verticesof a special graph as displayed in Fig. 5 for n = 28.

A solid arc pointing from the vertex associated with pair (i, j) to the vertex ofteam (k, l) represents the games i − k and j − l on the first day and the games j − kand i − l on the second day. Here, the first team mentioned is always the team play-ing at home. Then, the same games are repeated with changed home field advantage.This way, the teams i and j have played their games against the team k and l withoutviolating Constraint (c) and at no more cost than suggested by the independent lowerbound. The dotted arcs indicate the same games with the only difference that the homeaway patterns are slightly different and, thus, there might occur higher costs on thecorresponding road trips. The next four days’ matches can be obtained by changing

123

Page 14: Approximation algorithms for TTP(2)

14 C. Thielen, S. Westphal

Fig. 5 Games at the first time slot for n = 28 and the home away patterns of the teams

Fig. 6 Games at the second time slot for n = 28 and the home away patterns of the teams

the assignment of the teams to the black vertices in counter clockwise direction asshown in Fig. 6.

This procedure is repeated n/2 − 3 times such that each of the pairs (i, i + 1) hasbeen assigned to each of the black vertices exactly once for i = 1, 3, 5, . . . , n − 7.This way, we obtain schedules for the first (n/2 − 3) · 4 days with no violation ofConstraint (c) and no home stands or road trips longer than 2. Furthermore, almost allroad trips undertaken are as long as the road trips suggested by the independent lowerbound. The only suboptimal trips occur when a pair of teams is assigned to a vertexwhere the two away games are not played consecutively. This happens for each pairof teams when it is assigned to the leftmost black vertex. Then, both teams have toplay against teams n − 1 and n separately, which, summed up over all pairs of teamsassigned to black vertices, yields an additional cost of at most s(n − 1) + s(n). Theonly other teams that cannot play their away games in a row are the teams n − 3 andn − 2 causing extra costs of at most s(n − 3) + s(n − 2). In total, we have so faraccumulated an extra cost of at most

s(n − 3) + s(n − 2) + s(n − 1) + s(n) =n∑

i=n−3

s(i). (3)

In order to increase the compatibility of the schedule planned so far with the rest ofthe days, we change the home away assignment for the last four days already plannedby eliminating breaks occurring at the last two days. Whenever a team played HHAA,we change its pattern to HAAH, and in case it was assigned AAHH, we let it play

123

Page 15: Approximation algorithms for TTP(2)

Approximation algorithms for TTP(2) 15

AHHA. This way, we destroy the optimal tours which would have occurred on thesefour days and, therefore, incur extra costs. The amount of extra costs depends on thespecial assignment of this last round. As we have only required that the black pairsare assigned to the black vertices in a circular fashion corresponding to a heuristicallyobtained TSP solution, we can choose the first round arbitrarily, thereby determiningthe last round as well. Overall, there are n/2 − 3 possible choices. The total sum ofthe extra distances of the last round for all of these choices is not more than �. Thus,we can make a choice such that the extra cost of the last round is not more than

n/2 − 3= 2�

n − 6

n≥12≤ 4 · �

n. (4)

After the part of the tournament constructed above, there are still 10 days left to beplanned. So far, all of the teams associated with the grey vertices have played all thenecessary games against the teams corresponding to the black vertices, but they havenot played a single game against each other. For each pair (i, i + 1) associated witha black vertex, there are still all the games missing against the teams assigned to theneighbouring black vertices in the circular ordering and the two games between i andi + 1 (e.g., team 15 has not played against teams 13, 14, 16, 17, and 18 yet).

We plan the last 10 days for the teams associated with the grey vertices (the greyteams) and the teams associated with the black vertices (the black teams) indepen-dently.

First, we focus on the black teams 1, . . . , n − 6. Figures 7 and 8 show how weschedule their remaining games. Here, every arc corresponds to a game which takesplace at the venue of the team at the head of the arc. Apart from the games in thegrey box, the schedule follows a regular pattern that can be repeated as many timesas necessary. Therefore, this construction can be applied for any number k := n − 6of black teams (observe that k ≥ 6 since we assumed that n ≥ 12). Moreover, theschedule shown in Figs. 7 and 8 is designed in a way such that no road trip or homestand is longer than 2 and such that there is no break at the beginning of the schedule.Hence, it is compatible to the first set of games that has already been planned.

We now analyse the extra costs incurred in this schedule for the games inside of thegrey box and outside of the grey box separately. For the games involving only teams

Fig. 7 First half of the schedule for the remaining games between the black teams

123

Page 16: Approximation algorithms for TTP(2)

16 C. Thielen, S. Westphal

in the grey box, the teams 5, 6, 9, and 10 drive optimal tours, whereas the teams 7 and8 drive to all of their opponents separately. Team 7 incurs extra costs of exactly

d(7, 5) + d(7, 6) − d(5, 6) + d(7, 9) + d(7, 10) − d(9, 10).

To upper bound this cost, we use that, by the triangle inequality, we have

d(7, 5) ≤ d(5, 6) + d(6, 8) + d(7, 8)

d(7, 6) ≤ d(7, 8) + d(6, 8)

d(7, 9) ≤ d(7, 8) + d(8, 9)

d(7, 10) ≤ d(7, 8) + d(8, 10)

d(8, 9) − d(9, 10) ≤ d(8, 10).

Hence, the extra cost incurred by team 7 is at most

d(7, 5) + d(7, 6) − d(5, 6) + d(7, 9) + d(7, 10) − d(9, 10)

≤d(5, 6) + d(6, 8) + d(7, 8) + d(7, 8) + d(6, 8) − d(5, 6)

+ d(7, 8) + d(8, 9) + d(7, 8) + d(8, 10) − d(9, 10)

≤2d(6, 8) + 4d(7, 8) + 2d(8, 10)

Similarly, using that d(8, 5) − d(5, 6) ≤ d(6, 8) and d(8, 9) − d(9, 10) ≤ d(8, 10),the extra costs incurred by team 8 can be estimated as

d(8, 5) + d(8, 6) − d(5, 6) + d(8, 9) + d(8, 10) − d(9, 10) ≤ 2d(8, 6) + 2d(8, 10).

Hence, the extra costs incurred by teams 7 and 8 add up to at most

2d(6, 8) + 4d(7, 8) + 2d(8, 10) + 2d(8, 6) + 2d(8, 10)

=4d(7, 8) + 4d(6, 8) + 4d(8, 10). (5)

In order to analyse the extra cost incurred for the games involving teams outside ofthe grey box, we call the teams assigned to the odd nodes 1, 3, 5, . . . in Figs. 7 and 8the upper teams and the teams assigned to the even nodes 2, 4, 6, . . . the lower teams.Recall that we assumed that the vertices 2, 4, 6, . . . , n − 6 are visited in this order ina solution T̃ obtained by Christofides Algorithm for the TSP on these vertices. LetT OPT denote an optimal TSP on the vertices 2, 4, 6, . . . , n − 6.

All the upper teams drive their road trips corresponding to games involving teamsoutside of the grey box as suggested by the independent lower bound. For the lowerteams, we incur extra costs of

d(4, 5) + d(4, 6) − d(5, 6) (4 visits 5 and 6 separately)

+d(10, 11) + d(10, 12) − d(11, 12) (10 visits 11 and 12 separately)

+d(14, 1) + d(14, 2) − d(1, 2) (14 visits 1 and 2 separately)

123

Page 17: Approximation algorithms for TTP(2)

Approximation algorithms for TTP(2) 17

Fig. 8 Second half of the schedule for the remaining games between the black teams

+d(2, 13) + d(2, 14) − d(13, 14) (2 visits 13 and 14 separately)

+d(6, 3) + d(6, 4) − d(3, 4) (6 visits 3 and 4 separately)

+d(12, 9) + d(12, 10) − d(9, 10) (12 visits 9 and 10 separately)

in the example with k = 14 black teams shown in Figs. 7 and 8. Using the trian-gle inequality as in the estimation for teams 7 and 8, these extra costs can be upperbounded by

2d(4, 6) + 2d(10, 12) + 2d(14, 2) + 2d(2, 14) + 2d(6, 4) + 2d(12, 10).

Because of the symmetry of the construction, the same suboptimal trips as forteams 4, 10, and 14 happen when the teams 18, 22, 26, . . . drive to the right, and thesame suboptimal trips as for teams 2, 6, and 12 happen when the teams 16, 20, 24, . . .

drive to the left. Thus, the extra costs for the lower teams are at most

2d(4, 6) + 2d(k, 2) +∑

i=10,14,18,...,k−4

2d(i, i + 2)

+2d(2, k) + 2d(6, 4) +∑

i=12,16,20,...,k−2

2d(i, i − 2)

≤4d(2, k) + 4 ·(k−2)/4∑

i=1

d(4i, 4i − 2).

Adding this to the extra costs incurred by teams 7 and 8 calculated in (5) and using thatChristofides Algorithm is a 3/2-approximation for the TSP (cf. Christofides 1976),we obtain an extra cost of at most

4d(7, 8) + 4d(6, 8) + 4d(8, 10) + 4d(2, k) + 4 ·k−2/4∑

i=1

d(4i, 4i − 2)

≤ 4 · d(T̃ ) + 4 · d(M) ≤ 6 · d(T OPT) + 4 · d(M) (6)

for the schedule shown in Figs. 7 and 8.

123

Page 18: Approximation algorithms for TTP(2)

18 C. Thielen, S. Westphal

In order to schedule the games between the six grey teams n − 5, . . . , n, we applythe same scheme. By assigning these teams to the vertices in the grey box in Figs. 7and 8, we obtain a schedule that fits to the games already planned without yield-ing any home stands or road trips longer than 2 or violating Constraint (c) of TTP.In this schedule for the games between the grey teams, the distance travelled by eachgrey team i is at most 2 · s(i) by the triangle inequality. Because we assumed that∑n

i=n−5 s(i) ≤ 6 · �/n, this implies that this part of the tournament costs at most

2n∑

i=n−5

s(i) ≤ 12 · �

n.

Note that this estimation already includes two drives from each grey team to eachblack team, so we can neglect the extra costs incurred for the games of the grey teamsagainst the black teams calculated in (3). As any feasible tournament incurs costs ofat least

∑ni=n−5 s(i) for the games of the grey teams against each other and against

the black teams, this implies that the extra cost we incur for all the games involvingthe grey teams is at most

n∑

i=n−5

s(i) ≤ 6 · �

n. (7)

Overall, we can conclude that we scheduled almost all of the road trips as suggestedby the independent lower bound. The only extra costs incurred were calculated in (4),(6), and (7) and sum up to

4 · �

n+ 6 · d(T OPT) + 4 · d(M) + 6 · �

n

≤ 10

n· (� + n · d(M))︸ ︷︷ ︸

≤OPT

+6 · d(T OPT)︸ ︷︷ ︸≤OPT/n

≤ 16

n· OPT,

where OPT denotes the minimum cost of any feasible tournament. Hence, wehave derived a (1 + 16/n)-approximation for TTP(2), which is the first 1 + O(1/n)-approximation known so far.

5 Computational results

In order to demonstrate the applicability of our first algorithm to real world instances,we applied it to the well-known benchmark instances provided on the website of Trick(2011). The second algorithm was not tested as it works only for instances where n/2is even and its approximation ratio is worse than the one of our first algorithm as longas n < 24.

The results of our computational experiments are displayed in Table 2. The firsttwo columns contain the names and the independent lower bounds for the instances,

123

Page 19: Approximation algorithms for TTP(2)

Approximation algorithms for TTP(2) 19

Table 2 Computational results of our first algorithm on the benchmark instances from Trick (2011)

Instance ILB Our solution Gap (%) Improved solution Gap (%)

Galaxy40 298484 343825 15.19 318033 6.55

Galaxy38 244848 291439 19.03 274672 12.18

Galaxy36 205280 233901 13.94 220537 7.43

Galaxy34 173312 202967 17.11 192317 10.97

Galaxy32 139922 162950 16.46 148395 6.06

Galaxy30 113818 133375 17.18 124011 8.96

Galaxy28 89242 102921 15.33 94389 5.77

Galaxy26 68826 82352 19.65 77082 12.00

Galaxy24 53282 60761 14.04 56476 5.99

Galaxy22 40528 48671 20.09 46451 14.61

Galaxy20 30508 35057 14.91 33211 8.86

Galaxy18 23774 30008 26.22 27967 17.64

Galaxy16 17562 21173 20.56 19432 10.65

Galaxy14 12950 16218 25.24 15642 20.79

Galaxy12 8374 9957 18.90 9570 14.28

Galaxy10 5280 6579 24.60 6579 24.60

NFL32 1162798 1396059 20.06 1268742 9.11

NFL30 951608 1157316 21.62 1081969 13.70

NFL28 771442 918682 19.09 832396 7.90

NFL26 669782 840588 25.50 779895 16.44

NFL24 573618 690700 20.41 641686 11.87

NFL22 504512 626723 24.22 600822 19.09

NFL20 423958 516488 21.83 485618 14.54

NFL18 361204 459532 27.22 439152 21.58

NFL16 294866 345464 17.16 332468 12.75

NL16 334940 395514 18.09 380179 13.51

NL14 238796 300259 25.74 296403 24.12

NL12 132720 153340 15.54 148382 11.80

NL10 70866 91652 29.33 90254 27.36

NL8 45686 53648 17.43 51475 12.67

Super14 823778 1161054 40.94 1087749 32.04

Super12 551580 688514 24.83 680054 23.29

Super10 392774 580168 47.71 579862 47.63

Brazil24 620574 741165 19.43 722281 16.39

respectively. Next, there are two columns which show the total distance driven accord-ing to our approximation and the relative optimality gap.

Observe that, in our algorithm, almost half of the road trips are not performed inthe way indicated by the independent lower bound. Because of the specific circularordering used in the algorithm, these road trips follow n/2 other edges. Hence, we

123

Page 20: Approximation algorithms for TTP(2)

20 C. Thielen, S. Westphal

tried to improve the given approximation heuristically by arranging the nodes in thecircular ordering in such a way that these edges are mostly part of a second minimumweight perfect matching. The results of this attempt are given in the last two columnsof the table. Overall, by applying this last idea, we could improve the observed averageoptimality gap from 21.61 to 15.39 %.

The computation of all the schedules together took only 35.4 seconds on a standarddesktop computer with a 1.6 GHz CPU and 2 gigabytes of memory.

Acknowledgments We would like to thank the anonymous referees for their valuable comments on ourwork. Furthermore, we would like to thank Shinji Imahori for helpful discussions about possible furtherextensions of our techniques.

References

Anagnostopoulos A, Michel L, Van Hentenryck P, Vergados Y (2006) A simulated annealing approach tothe travelling tournament problem. J Sched 9(2):177–193

Bhattacharyya R (2009) A note on complexity of traveling tournament problem. Optimization OnlineCampbell RT, Chen DS (1976) A minimum distance basketball scheduling problem. In: Machol RE,

Ladany SP, Morrison D (eds) Management science in sports, studies in the management sciences.North-Holland Publishing Company, North-Holland pp 15–25

Christofides N (1976) Worst-case analysis of a new heuristic for the travelling salesman problem. Technicalreport 388, Graduate School of Industrial Administration, Carnegie-Mellon University, Pittsburgh

de Werra D (1981) Scheduling in sports. In: Studies on graphs and discrete programming, Ann DiscretMath, vol 11, pp 381–395. North-Holland Publishing Company, North-Holland

Easton K, Nemhauser G, Trick M (2001) The traveling tournament problem description and benchmarks.In: Proceedings of the 7th international conference on principles and practice of constraint program-ming (CP), LNCS, vol 2239, pp 580–584

Easton K, Nemhauser G, Trick M (2003) Solving the travelling tournament problem: a combined integerprogramming and constraint programming approach. In: Proceedings of the 4th international confer-ence on the practice and theory of automated timetabling (PATAT), LNCS, vol 2740, pp 100–109

Kendall G, Knust S, Ribeiro C, Urrutia S (2010) Scheduling in sports: an annotated bibliography. ComputOper Res 37(1):1–19

Miyashiro R, Matsui T, Imahori S (2012) An approximation algorithm for the traveling tournament problem.Ann Oper Res (online). doi:10.1007/s10479-010-0742-x

Miyashiro R, Matsui T, Imahori S (2008) An approximation algorithm for the traveling tournament problem.In: Proceedings of the 7th international conference on the practice and theory of automated timetabling(PATAT)

Rasmussen R, Trick M (2008) Round robin scheduling—a survey. Eur J Oper Res 188:617–636Thielen C, Westphal S (2011) Complexity of the traveling tournament problem. Theor Comput Sci

412(4-5):345–351Trick M (2011) Challenge traveling tournament instances. http://mat.gsia.cmu.edu/TOURN/Westphal S, Noparlik K (2010) A 5.875-approximation for the traveling tournament problem. In: Proceed-

ings of the 8th international conference on the practice and theory of automated timetabling (PATAT)Westphal S, Noparlik K (2012) A 5.875-approximation for the traveling tournament problem. Ann Oper

Res (online). doi:10.1007/s10479-012-1061-1Yamaguchi D, Imahori S, Miyashiro R, Matsui T (2011) An improved approximation algorithm for the

traveling tournament problem. Algorithmica 61:1077–1091

123