The time-dependent traveling salesman problem

5
Physica A 314 (2002) 151 – 155 www.elsevier.com/locate/physa The time-dependent traveling salesman problem Johannes Schneider School of Engineering and Computer Science, The Hebrew University of Jerusalem, Givat Ram, Jerusalem 91904, Israel Abstract A problem often considered in Operations Research and Computational Physics is the traveling salesman problem, in which a traveling salesperson has to nd the shortest closed tour between a given set of cities touching each city exactly once. The distances between the single nodes are known to the traveling salesperson. An extension of this problem is the time-dependent traveling salesman problem, in which these distances vary in time. I will show how this more complex problem is treated with physical optimization algorithms like simulated annealing. I will present results for the problem of the 127 beergardens in the area of Augsburg, in which I dene a trac zone in which trac jams occur in the afternoon. c 2002 Elsevier Science B.V. All rights reserved. PACS: 02.70.Lq; 89.40.+k; 02.70.c; 02.50.Ga Keywords: Traveling salesman problem; Trac jam; Simulated annealing; Monte Carlo The traveling salesman problem (TSP) is given by a set of N nodes. The task of a traveling salesman consists of nding the shortest closed tour through these nodes, touching each node exactly once. The distance D(i; j) between nodes i and j is usually given in units of either length or time. As this problem is NP-complete, many heuristics have been developed in order to solve this problem approximately [1]. One of the most successful algorithms, which is also widely used for many other NP-complete problems, is simulated annealing (SA) [2]: the given optimization problem is considered being a physical system, its objective function is equated with a Hamilto- nian H. The physical system is successively cooled down, such that it loses energy to a large extent, until it freezes in a (local) optimum conguration. If the cooling process is performed slowly enough, one can trust in ending up in a conguration energetically Tel.: +972-2-65-85688; fax: +972-2-65-85439. E-mail address: [email protected] (J. Schneider). 0378-4371/02/$ - see front matter c 2002 Elsevier Science B.V. All rights reserved. PII: S0378-4371(02)01078-6

Transcript of The time-dependent traveling salesman problem

Page 1: The time-dependent traveling salesman problem

Physica A 314 (2002) 151–155www.elsevier.com/locate/physa

The time-dependent traveling salesman problemJohannes Schneider ∗

School of Engineering and Computer Science, The Hebrew University of Jerusalem, Givat Ram,Jerusalem 91904, Israel

Abstract

A problem often considered in Operations Research and Computational Physics is the travelingsalesman problem, in which a traveling salesperson has to +nd the shortest closed tour betweena given set of cities touching each city exactly once. The distances between the single nodes areknown to the traveling salesperson. An extension of this problem is the time-dependent travelingsalesman problem, in which these distances vary in time. I will show how this more complexproblem is treated with physical optimization algorithms like simulated annealing. I will presentresults for the problem of the 127 beergardens in the area of Augsburg, in which I de+ne atra1c zone in which tra1c jams occur in the afternoon.c© 2002 Elsevier Science B.V. All rights reserved.

PACS: 02.70.Lq; 89.40.+k; 02.70.−c; 02.50.Ga

Keywords: Traveling salesman problem; Tra1c jam; Simulated annealing; Monte Carlo

The traveling salesman problem (TSP) is given by a set of N nodes. The task ofa traveling salesman consists of +nding the shortest closed tour through these nodes,touching each node exactly once. The distance D(i; j) between nodes i and j is usuallygiven in units of either length or time. As this problem is NP-complete, many heuristicshave been developed in order to solve this problem approximately [1].One of the most successful algorithms, which is also widely used for many other

NP-complete problems, is simulated annealing (SA) [2]: the given optimization problemis considered being a physical system, its objective function is equated with a Hamilto-nian H. The physical system is successively cooled down, such that it loses energy toa large extent, until it freezes in a (local) optimum con+guration. If the cooling processis performed slowly enough, one can trust in ending up in a con+guration energetically

∗ Tel.: +972-2-65-85688; fax: +972-2-65-85439.E-mail address: [email protected] (J. Schneider).

0378-4371/02/$ - see front matter c© 2002 Elsevier Science B.V. All rights reserved.PII: S 0378 -4371(02)01078 -6

Page 2: The time-dependent traveling salesman problem

152 J. Schneider / Physica A 314 (2002) 151–155

7×105

6×105

5×105

4×105

3×105

2×105

1×105

1 10 100 1000 10000 100000

<H

>

T

0

50

100

150

200

1 10 100 1000 10000 100000

C

T

Fig. 1. Mean energy 〈H〉 and speci+c heat C of the BIER127 problem.

not far away from the ground state. SA usually starts with a random con+guration.A series of moves (�i → �i+1) is performed at each temperature step. Each move iseither accepted or rejected with the probability p(�i → �i+1) =min{1; exp(−HH=T )}[3] with HH=H(�i+1)−H(�i) being the energy diIerence between the two partici-pating con+gurations. In case of rejection, �i+1 is set to �i. By lowering the temperatureT , the probability for accepting a deterioration is reduced.If applying SA to a given optimization problem, a proper energy function and suitable

moves have to be found. A useful representation of a con+guration of a TSP is apermutation � of the numbers 1; 2; : : : ; N , such that the Hamiltonian H can be writtenas H(�)=

∑Ni=1 D(�(i); �(i+1)) (�(N+1) ≡ �(1)). The Lin-2-Opt [4], which reverses

the direction of a part of the tour, and Lin-3-Opt that exchanges two successive partsof the tour without altering their directions lead to rather good results.For several years, benchmark instances have been provided for comparing the quality

of optimization algorithms [5]. I will use one of these instances throughout this paper,the famous BIER127 problem, which consists of the locations of the 127 beergardens inthe area of Augsburg, a city in the Bavarian part of Germany. Fig. 1 shows the resultsfor the mean value 〈H〉 of the energy versus decreasing temperature T and its corre-sponding speci+c heat C, which exhibits a peak at a freezing temperature Tf ≈ 900.

The common TSP is rather idealized, e.g., due to the constant distance values. Anextension of the TSP is the time-dependent traveling salesman problem (TdTSP), inwhich the distances vary in time due to tra1c jam. Here, the scenario introduced inRef. [6] shall be considered: starting at a +xed point in time, here noon, tra1c jamsoccur on all edges whose both end points are inside a de+ned region in the city center.The time it takes to drive from one end point to the other one is multiplied in thiscase by a tra1c jam factor f¿ 1. The traveling salesman is supposed to start his tourat one speci+c node inside this tra1c jam area at 9 a.m. in the morning and returnto it at 3 p.m. in the afternoon in the case of f = 1 if he moves along the optimumtour of the original BIER127 problem. Of course, it is favorable for him +rst to visitall nodes inside the tra1c jam region if f�1. Fig. 2 shows optimum con+gurationsfor various f. The pictures indicate that the traveling salesman has to compromise

Page 3: The time-dependent traveling salesman problem

J. Schneider / Physica A 314 (2002) 151–155 153

f <= 1.05L0 = 118293.524

1.06 <= f <= 1.38L0 = 118913.374

1.39 <= f <= 2.01L0 = 120034.523

f >= 2.02L0 = 121125.195

Fig. 2. An area is introduced in the city center of Augsburg in which tra1c jams occur in the afternoon. Thegraphics show optimum con+gurations for diIerent strengths of the tra1c jam f, in each case the lengthL0 of the ground state is given. L0 equals the ground state energy in the cases f = 1 and f¿ 2:02. Thenode at which the traveling salesman starts his tour is marked by a +lled circle. The last edge of each touris omitted in order to clarify the direction in which the traveling salesman moves.

between driving a detour in order to avoid the tra1c jam region in the afternoon anddriving through the tra1c jam region in order not to extend the tour length too much.Therefore, the Hamiltonian can be rewritten as H = Hopt + Hde + Htime with thetour length Hopt +Hde, consisting of the length of the optimum tour for the originalproblem and the additional detour the traveling salesman drives, and Htime, the amountof time the traveling salesman is supposed to wait due to the tra1c jams.Figs. 3–6 show the results of simulations with various f. It can be clearly seen

that the initial value of the Hamiltonian 〈H〉, the position of the right peak of C, the

Page 4: The time-dependent traveling salesman problem

154 J. Schneider / Physica A 314 (2002) 151–155

105

106

107

108

109

100 101 102 103 104 105 106 107 108

<H

>

T

f=1.25f=2

f=10f=100

f=2000

0

50

100

150

200

250

100 101 102 103 104 105 106 107 108

C

T

f=1.25f=2

f=10f=100

f=2000

Fig. 3. Mean energy 〈H〉 and speci+c heat C of the TdTSP instance. Note that the single peak of thespeci+c heat of the original problem (see Fig. 1) splits into up to three peaks. The left two are at the sameposition as the peak of the speci+c heat of the original problem, the incursion between these two peaksindicates a clustering and ordering eIect as in Ref. [2]. The right peak only occurs for large f and showsthe temperature range in which the system tries to avoid the tra1c jam region in the afternoon.

0

6×105

5×105

4×105

3×105

2×105

1×105

100 101 102 103 104 105 106 107 108

<H

de>

T

f=1.25f=2

f=10f=100

f=2000

2.5×105

2.0×105

1.5×105

1.0×105

0.5×105

100 101 102 103 104 105 106 107 108

χ de

T

f=1.25f=2

f=10f=100

f=2000

Fig. 4. The detour 〈Hde〉 the traveling salesman has to make in order to avoid the tra1c jams and its corre-sponding susceptibility �de. For larger f, the ordering and clustering eIects can be seen at the intermediateplateau of 〈Hde〉.

initial value of 〈Htime〉, the position of the peak of �time, and the point of inJectionof the curve for the correlation �de; time depend in a linear way on f. As additionallyshown in Ref. [6], there is a dependency of the initial value of 〈H〉, the height of theright peak of C, the initial value of 〈Htime〉, the height of �time, and the initial valueof �de; time upon the fourth order of the number of nodes inside the tra1c jam region.Summarizing, I have proposed an extension of the classic traveling salesman prob-

lem: considering the constraint that distances vary in time, further complexity is addedto the TSP. Depending on the impact strength of the tra1c jam on the system,the traveling salesman has to +nd some compromise between avoiding detours andavoiding tra1c jams. I will continue to investigate this problem and would like tothank Johannes Bentner (University of Regensburg, Germany), Sigismund Kobe

Page 5: The time-dependent traveling salesman problem

J. Schneider / Physica A 314 (2002) 151–155 155

1010

108

106

104

102

100

10−2

10−4

1010

108

106

104

102

100

10−2

10−4

100 101 102 103 104 105 106 107 108

<H

time>

T100 101 102 103 104 105 106 107 108

T

f=1.25f=2

f=10f=100

f=2000

χ tim

e

f=1.25f=2

f=10f=100

f=2000

Fig. 5. The time 〈Htime〉 the traveling salesman spends in tra1c jams and its corresponding susceptibility�time.

-1

-0.5

0

0.5

1

100 101 102 103 104 105 106 107 108

ρ de,

time

T

f=1.25f=2

f=10f=100

f=2000

Fig. 6. The correlation �de; time between the partial energies Hde and Htime. The higher the tra1c jam factorf, the earlier the correlation vanishes. An anticorrelation can be measured for small f only. For large f,the optimization process is split into +rst avoiding any tra1c jam and second optimizing the tour length.

(Technical University of Dresden, Germany), and Frank Schweitzer (Fraunhofer In-stitute for Autonomous Intelligent Systems, Sankt Augustin, Germany) for fruitfuldiscussions.

References

[1] E.L. Lawler, J.K. Lenstra, A.H.G. Rinnoy Kan, D.B. Shmoys, The Traveling Salesman Problem, Wiley,New York, 1985.

[2] S. Kirkpatrick, C.D. Gelatt Jr., M.P. Vecchi, Science 220 (1983) 671.[3] N. Metropolis, A.W. Rosenbluth, M.N. Rosenbluth, A.H. Teller, E. Teller, J. Chem. Phys. 21 (1953)

1087.[4] S. Lin, Bell System Tech. J. 44 (1965) 2245.[5] http://www.iwr.uni-heidelberg.de/groups/comopt/software/TSPLIB95.[6] J. Bentner, G. Bauer, G.M. Obermair, I. Morgenstern, J. Schneider, Phys. Rev. E 64 (2001) 36 701.