Computers & Operations Research 33 (2006) 3450 – 3457 www.elsevier.com/locate/cor
A constructive heuristic for the Undirected Rural Postman Problem Gianpaolo Ghiania,∗ , Demetrio Laganàb , Roberto Musmannob a Dipartimento di Ingegneria dell’Innovazione, Università di Lecce, Strada per Arnesano, 73100 Lecce, Italy b Dipartimento di Elettronica, Informatica e Sistemistica, Università della Calabria, 87036 Rende (CS), Italy
Available online 23 November 2005
Abstract This paper describes a constructive heuristic for the well-known Undirected Rural Postman Problem. At each iteration, the procedure inserts a connected component of the required edges and performs a local postoptimization. Computational results on a set of benchmark instances with up to 350 vertices show that the proposed procedure is competitive with the classical Frederickson procedure. Its use is recommended when a high-quality solution is needed in a short amount of time (e.g., in laser plotter applications). 䉷 2005 Elsevier Ltd. All rights reserved. Keywords: Arc routing; Rural Postman Problem; Heuristics
1. Introduction The aim of this paper is to present a constructive heuristics for the Undirected Rural Postman Problem (RPP) defined as follows. Let G = (V , E) be an undirected graph, where V is the vertex set, E is the edge set, cij ( 0) is the cost of traversing edge (vi , vj ) ∈ E, dij is the cost of a shortest chain lij between vi and vj , and R ⊆ E is a set of required edges. The RPP amounts to determining a least cost tour traversing each edge of R at least once. Equivalently, solving the RPP is to determine a least cost set of additional edges that, along with the required edges, makes up a Eulerian and connected subgraph. Applications of the RPP to the control of plotting and drilling machines [1] and to the optimization of laser-plotter beam movements [2] have been described in recent years. Furthermore, the RPP is the ∗ Corresponding author.
0305-0548/$ - see front matter 䉷 2005 Elsevier Ltd. All rights reserved. doi:10.1016/j.cor.2005.02.014
G. Ghiani et al. / Computers & Operations Research 33 (2006) 3450 – 3457
3451
unconstrained version of more general classes of multi-vehicle Capacitated Arc Routing Problems arising, for instance, in garbage collection, road gritting, mail delivery, network maintenance, etc. [3–5]. Exact algorithms for the RPP have been developed by Christofides et al. [6], Corberán and Sanchis [7], Letchford [8], Ghiani and Laporte [9] and Fernandez et al. [10]. In addition, constructive heuristics for the RPP have been presented by Frederickson [11], Pearn and Wu [12], while improvement procedures have been described by Hertz et al. [13]. We illustrate a novel heuristic which iteratively inserts a connected component of the required edges into the partial solution, while performing a local re-optimization. The remainder of the paper is organized as follows. Section 2 depicts the new procedure, followed by the computational results in Section 3 and by the conclusions in Section 4.
2. An insertion procedure Let Ch (h = 1, . . . , p) be the hth connected component of the subgraph induced by R, Rh the set of required edges of Ch , VR the set of vertices vi such that an edge (vi , vj ) exists in R, and Vh ⊆ VR (h = 1, . . . , p) the set of vertices of the hth connected component of R. A vertex vi ∈ VR is said to be R-odd (R-even) if and only if an odd (even) number of required edges are incident to vi . Let VhO (VhE ) be the set of odd (even) vertices in Vh . Given a set of vertices {vi1 , . . . , vir } ⊆ VR such that vij = vij (j = 1, . . . , r; j = 2, . . . , r − 1), a polygonal [vi1 , . . . , vir ] is a chain made up of the shortest subchains between vertices vij and vij +1 (j = 1, . . . , r − 1). A polygonal is maximal if it is not included into a distinct polygonal. Finally, a (perfect) matching is a set of disjoint shortest chains between pairs of vertices vi ∈ VR , vj ∈ VR such that no intermediate vertex belongs to a component other than the ones of vi and vj . A polygonal connects two or more components as well as makes the endpoints vi1 and vir even (if vi1 = vir ). On theother hand, each chain of a matching makes even a pair of R-odd vertices. The chains that can be part of a matching can be easily determined. In Fig. 1 (where required edges are omitted for the sake of simplicity), 5–4–10 and 12–13–12 are polygonals while 21–20–19, 7–22 and 11–17 make up a matching.
9 C4
1
11
10 3 13
4 C1
C 5
3
14 20
7 C2
8
18 19
C5
12 15
6
17
16
2
21
22 C6
23
Fig. 1. Decomposition of a RPP solution into polygonals and a matching.
3452
G. Ghiani et al. / Computers & Operations Research 33 (2006) 3450 – 3457 Construct a partial solution including two components. Let {Ch, h∈L} be the set of uninserted components; while (L ≠ ) { Feasibly insert a component Ch(h∈L) into the partial solution; Postoptimize the maximal polygonals; Postoptimize the matching; Perform a polygonal-matching joint optimization; L:=L\{h}; }
Fig. 2. Outline of the insertion procedure.
Our insertion procedure is based on the observation that an optimal solution satisfies the following dominance relations: (i) the set of additional edges that, along with the required edges, makes up a Eulerian and connected subgraph can be decomposed in a set of maximal polygonals and a matching; moreover this decomposition is unique; (ii) for each R-odd vertex vi , there exists a unique chain having an endpoint in vi ; (iii) for each R-even vertex vi , there exist 0 or 2 chains having an endpoint in vi ; (iv) for each pair of vertices vi and vj , there may exist 0, 1 or 2 chains having the endpoints in vi and vj ; in particular, 2 chains may exist only if vi and vj are both R-even and belong to different connected components; (v) for each pair vi and vj of R-even vertices belonging to the same connected component, there is no chain having the endpoints in vi and vj . Fig. 2 reports a Pascal-like description of the insertion procedure. In the following, we describe the main ingredients of the procedure in a greater detail. 2.1. Construction of the initial partial solution The initial partial solution includes a single component defined as follows: Ch = argmin min dij u=1,...,p u =h
vi ∈Vh vj ∈Vu
and is made Eulerian by solving a matching problem on VhO in a greedy fashion. The heuristic approach is motivated by the computational effort needed by the exact O(|V |3 ) procedure [14]. 2.2. Insertion of a new component Our insertion procedure is based on the observation that in order to insert a component into a partial solution, we can first make the new partial solution connected, then we can make vertices even. Let P be the set of chains that, along with the required edges h∈L Rh , constitutes the current partial solution. In
G. Ghiani et al. / Computers & Operations Research 33 (2006) 3450 – 3457
3453
order to determine the next component to be inserted, we compute the following expressions: DhI = min{dit + dj t − dij , lij ∈ P , vt ∈ VhE }, II E Vk , vi ∈ Vh , Dh = min 2dij , vi ∈
(1) (2)
k∈L
DhIII = min{dit + djk − dij , dik + djt − dij , lij ∈ P , vt , vk ∈ VhO , vt = vk }, IV O Vk , vt , vk ∈ Vh , vt = vk . Dh = min dit + dik , vi ∈
(3) (4)
k∈L
Expressions (1)–(4) are the cost increases associated to four possible ways to connect component Ch to the current partial solution. In particular, Eq. (1) corresponds to the substitution of lij with a polygonal [vi , vt , vj ]; Eq. (2) is associated to the insertion of a polygonal [vi , vj , vi ]; Eq. (3) corresponds to the substitution of chain lij with chains lit and lit ; finally, Eq. (4) is associated to the insertion of chains lit and lik . We select the component Ch∗ = arg min DhI , DhII , DhIII , DhIV , and implement the insertion associated to the corresponding expression (1), (2), (3) or (4). Finally, we make the new partial solution feasible by solving heuristically a matching problem among the R-odd vertices of component Ch∗ . 2.3. Postoptimization of the polygonals For each maximal polygonal [vi1 , . . . , vir ] affected by the insertion of Ch∗ , we perform a local search in which a neighbor is obtained by replacing each “internal” vertex vij (j = 2, . . . , r − 1) with another vertex of the same connected component. 2.4. Matching postoptimization A 2-opt local search is performed in order to improve the matching of the current partial solution. A neighbor is obtained by substituting a pair of matching chains lij , lpq with chains lip , lj q or liq , ljp if this results in a connected solution. 2.5. Joint postoptimization For each chain lpq of the matching associated to the current partial solution and for each maximal polygonal [vi1 , . . . , vir ] such that there exists a vertex vij (j = 2, . . . , r − 1) belonging to the same component as vp or vq (say vp ), remove both chain lpq and polygonal [vi1 , . . . , vir ] while inserting polygonals [vi1 , . . . , vij −1 , vp ] and [vq , vij +1 , . . . , vir ].
|V |
50 50 50 50 50
80 80 80 80 80
150 150 150 150 150
200 200 200 200 200
250 250 250 250 250
300 300 300 300
350 350 350 350 350
Instance
A0500001 A0500002 A0500003 A0500004 A0500005
A0800001 A0800002 A0800003 A0800004 A0800005
A1500001 A1500002 A1500003 A1500004 A1500005
A2000001 A2000002 A2000003 A2000004 A2000005
A2500001 A2500002 A2500003 A2500004 A2500005
A3000001 A3000002 A3000003 A3000005
A3500001 A3500002 A3500003 A3500004 A3500005
133 153 187 130 153
99 78 144 116
105 69 102 146 94
82 108 104 77 91
57 148 73 46 48
34 34 41 24 20
18 17 13 22 24
|R|
15814 17137 18038 14417 16553
13615 11368 16536 15256
13562 9893 13659 17153 12711
10680 15726 13568 11026 13184
10543 25812 12309 8853 9813
7761 7029 10370 6901 6101
6497 6031 4689 6822 7495
1.468 1.750 1.968 1.500 1.891
0.950 0.920 1.106 1.044
0.607 0.576 0.632 5.890 0.592
0.390 0.532 0.519 0.422 0.500
0.203 2.403 0.281 0.203 0.204
0.109 0.125 0.125 0.094 0.094
0.094 0.078 0.078 0.078 0.094
14917 17307 19556 14634 16649
13663 10602 18205 14034
13328 9830 13866 17006 12798
11444 16848 14381 10947 13316
9499 26961 11590 8520 9577
7818 7110 9694 7157 5384
6379 5903 4147 6613 6927
Obj
Obj
Sec
Insertion
Frederickson
Table 1 Computational results for type A graphs
6.610 5.422 5.750 6.673 6.657
4.824 4.980 4.886 4.725
4.317 3.669 3.824 7.804 3.871
2.500 2.250 4.703 2.078 2.688
2.344 20.544 2.329 1.875 1.969
0.922 0.672 1.360 0.734 0.985
0.547 0.563 0.562 0.391 0.812
Sec
13901 16289 17099 12363 14993
12343 9609 15641 13235
12199 8961 12344 15986 11536
10441 14429 12763 9337 11726
9270 25288 11516 7916 8701
7400 6639 9231 6726 5281
5471 5208 4141 6064 6905
Obj
3376.895 3671.413 4554.389 4046.009 3670.613
1549.658 1109.441 3168.635 2101.455
1720.485 654.507 1221.658 1826.799 1065.812
562.770 1459.150 1740.320 1281.580 1824.620
193.187 3221.270 260.688 279.790 557.870
42.375 45.609 149.672 22.765 22.312
21.875 8.687 11.203 13.016 33.687
Sec
Frederickson + 2-Opt
14230 15747 16924 13156 14825
12202 9348 15819 13197
12099 9280 12139 16057 11897
10756 14279 12839 10027 11918
8682 25068 11098 8158 8745
6924 6641 9361 7021 5259
5471 5255 4141 6064 6927
Obj
3381.479 5563.342 5783.929 5593.472 6162.275
5462.950 3010.080 9170.910 1190.219
2782.750 1212.810 3183.370 3545.770 2308.960
778.460 1238.485 889.295 353.668 960.015
546.450 1791.051 446.320 219.430 567.540
99.360 90.350 91.230 37.680 44.980
33.010 13.680 11.860 25.930 20.440
Sec
Insertion + 2-Opt
0.940 1.010 1.080 1.020 1.010
1.000 0.930 1.100 0.920
0.980 0.990 1.020 0.990 1.010
1.070 1.070 1.060 0.990 1.010
0.900 1.040 0.940 0.960 0.980
1.010 1.010 0.930 1.040 0.880
0.980 0.980 0.880 0.970 0.920
IF Ratio
1.020 0.970 0.990 1.060 0.990
0.990 0.970 1.010 1.000
0.990 1.040 0.980 1.00 1.030
1.030 0.990 1.010 1.070 1.020
0.940 0.990 0.960 1.030 1.010
0.940 1.000 1.010 1.040 1.000
1.000 1.010 1.000 1.000 1.000
IF2 Ratio
3454 G. Ghiani et al. / Computers & Operations Research 33 (2006) 3450 – 3457
|V |
50 50 50 50 50 100 100 100 100 100 150 150 150 150 150 200 200 200 200 200
Instance
C0500301 C0500302 C0500303 C0500304 C0500305 C1000301 C1000302 C1000303 C1000304 C1000305 C1500301 C1500302 C1500303 C1500304 C1500305 C2000301 C2000302 C2000303 C2000304 C2000305
24 30 18 22 22 61 45 60 57 56 75 86 82 75 88 89 116 107 113 108
|R|
7437 6708 5280 6895 7517 10074 10906 10874 10971 9642 11159 13665 11185 13619 12758 12577 14372 15524 14109 12922
0.094 0.078 0.093 0.090 0.094 0.172 0.125 0.140 0.125 0.125 0.880 0.880 0.820 0.930 1.040 1.380 1.600 1.380 1.430 1.480
6801 7508 5716 5725 6742 10621 10297 11593 11618 9444 10903 14129 11936 13739 13254 12674 14851 16369 14358 12768
Obj
Obj
Sec
Insertion
Frederickson
Table 2 Computational results for type C graphs
0.563 0.641 0.641 0.735 0.812 1.265 1.750 1.843 2.125 1.875 6.970 7.800 7.140 7.410 6.760 9.780 9.010 9.880 8.630 10.320
Sec 6371 6362 4443 5725 6283 8995 8721 10184 9878 8931 10175 12178 9850 11565 11803 11203 13442 13490 12666 11681
Obj 25.062 50.265 21.141 17.485 34.203 233.843 200.312 241.407 148.238 236.115 1277.510 859.800 961.360 1297.280 1339.300 3247.250 2129.520 5175.850 6736.620 3099.500
Sec
Frederickson + 2-Opt
6043 6362 4443 5725 6283 9158 8721 10319 10289 8741 10207 12456 10109 11685 11669 11183 13753 14122 13026 12407
Obj 63.820 84.750 94.360 19.390 43.830 515.810 389.530 235.740 547.170 462.530 1567.890 2638.180 614.450 2220.910 2827.340 2106.940 3128.830 3621.130 3453.440 3556.870
Sec
Insertion + 2-Opt
0.910 1.120 1.080 0.830 0.900 1.050 0.940 1.070 1.060 0.980 0.977 1.034 1.067 1.010 1.039 1.008 1.033 1.054 1.017 0.988
IF Ratio
0.950 1.000 1.000 1.000 1.000 1.020 1.000 1.010 1.040 0.980 1.003 1.023 1.026 1.010 0.988 0.998 1.023 1.047 1.028 1.062
IF2 Ratio
G. Ghiani et al. / Computers & Operations Research 33 (2006) 3450 – 3457 3455
3456
G. Ghiani et al. / Computers & Operations Research 33 (2006) 3450 – 3457
3. Computational results The constructive heuristic was coded in C and run on a Pentium-1 GHz personal computer. The procedure was tested on two sets of benchmark instances used in Ghiani and Laporte [9]. Type A graphs are graphs with vertices randomly generated in a plane with a test to ensure they are connected. In practice, R is always disconnected in these graphs. Type C graphs are graphs with vertex degrees equal to four and disconnected required edge sets. Five graphs of type A were considered for |V | = 50, 80, 150, 200, 250, 300, 350; five graphs of type C were considered for |V |=50, 100, 150, 200, and expected density =0.30. For each instance we compared the insertion heuristic with the classical Frederickson procedure; in addition, we applied the 2-opt procedure developed by Hertz et al. [13] to the solutions provided by the two constructive heuristics. Computational results are presented in Tables 1 and 2. The column headings are as follows: Obj Sec IF Ratio
objective function value computing time in seconds solution value provided by the insertion heuristic over the solution value provided by the Frederickson heuristic IF2 Ratio solution value provided by the insertion heuristic (followed by the 2-opt algorithm) over the solution value provided by the Frederickson heuristic (followed by the 2-opt algorithm) Computational results indicate that the insertion procedure is competitive with the Frederickson heuristic. For 19 type A instances out of 34, the insertion procedure provided a better solution in approximately the same amount of time. For 7 type C instances out of 20, the insertion procedure provided a better solution in approximately the same amount of time. When the 2-opt procedure is used to postoptimize the constructive solutions, it turns out that the insertion procedure is less competitive. As a result, we suggest using the insertion procedure instead of the Frederickson algorithm when a decision must be made in a short amount of time (e.g., in laser plotter applications, [9]). Both instances and results are available at http://deis.unical.it/deis1.0/portale/dottorandi (Ing. Demetrio Laganà).
4. Conclusion In this paper, we have presented a constructive heuristic for the well-known Undirected Rural Postman Problem. Computational results show that the proposed procedure is competitive with the classical Frederickson procedure. Its use is recommended when a high-quality solution is needed in a short amount of time (e.g., in laser plotter applications).
Acknowledgements This work was partly supported by Ministero dell’Università e della Ricerca Scientifica (MURST) and by the Center of Excellence on High-Performance Computing, University of Calabria, Italy. This support is gratefully acknowledged.
G. Ghiani et al. / Computers & Operations Research 33 (2006) 3450 – 3457
3457
References [1] Grötschel M, Jünger M, Reinelt G. Optimal control of plotting and drilling machines: a case study. Z Operations Research 1991;35:61–84. [2] Ghiani G, Improta G. The Laser-plotter beam routing problem. Journal of the Operational Research Society 2001;52: 945–51. [3] Eiselt HA, Gendreau M, Laporte G. Arc routing problems, part 1: the Chinese postman problem. Operations Research 1995;43:231–42. [4] Eiselt HA, Gendreau M, Laporte G. Arc routing problems, part 2: the rural postman problem. Operations Research 1995;43:399–414. [5] Assad AA, Golden BL. Arc routing methods and applications. In: Ball MO, Magnanti TL, Monma CL, Nemhauser GL, editors. Handbook of operations research and management science: networks. Amsterdam: North-Holland; 1995. p. 375–483. [6] Christofides N, Campos V, Corberán A, Mota E. An algorithm for the rural postman problem, Imperial College Report IC.O.R.81.5; 1981. [7] Corberán A, Sanchis JM. A polyhedral approach to the rural postman problem. European Journal of Operational Research 1994;79:95–114. [8] Letchford AN. New inequalities for the general routing problem. European Journal of Operational Research 1997;96: 317–22. [9] Ghiani G, Laporte G. A branch-and-cut algorithm for the undirected rural postman problem. Mathematical Programming 2000;87:467–81. [10] Fernandez E, Garfinkel R, Meza O, Ortega M. On the undirected rural postman problem: tight bounds based on a new formulation. Operations Research 2003;51/2:281–91. [11] Frederickson GN. Approximation algorithms for some postman problems. SIAM Journal on Computing 1979;7:178–93. [12] Pearn WL, Wu TC. Algorithms for the rural postman problem. Computers and Operations Research 1995;22:819–28. [13] Hertz A, Laporte G, Nanchen-Hugo P. Improvement procedures for the undirected rural postman problem. INFORMS Journal on Computing 1999;11:53–62. [14] Edmonds J. Maximum matching and a polyhedron with 0,1-vertices. Journal Res. Nat. Bureau Standards 1965;B69B: 125–30.