A Polynomial Algorithm with Approximation Ratio 2/3 ...

4 downloads 1600 Views 767KB Size Report
cycles H1 and H2 which is an optimal solution to our problem. .... Then there are an edge going out from C colored with color 3 and a path (A, D, . . . , C) colored ...
c Pleiades Publishing, Ltd., 2015. ISSN 1990-4789, Journal of Applied and Industrial Mathematics, 2015, Vol. 9, No. 1, pp. 61–67.  c A.N. Glebov, D.Zh. Zambalaeva, A.A. Skretneva, 2014, published in Diskretnyi Analiz i Issledovanie Operatsii, 2014, Vol. 21, No. 6, pp. 11-20. Original Russian Text 

A Polynomial Algorithm with Approximation Ratio 2/3 for the Asymmetric Maximum 2-Peripatetic Salesman Problem A. N. Glebov* , D. Zh. Zambalaeva** , and A. A. Skretneva*** Sobolev Institute of Mathematics, pr. Akad. Koptyuga 4, Novosibirsk, 630090 Russia Received December 2, 2013; in final form, July 11, 2014

Abstract—A polynomial approximation algorithm with approximation ratio 2/3 and cubic running time is presented for the maximization version of the Asymmetric 2-Peripatetic Salesman Problem that consists in finding two edge-disjoint Hamiltonian cycles of maximum total weight in a complete weighted graph. DOI: 10.1134/S199047891501007X Keywords: Traveling Salesman Problem, 2-Peripatetic Salesman Problem, polynomial algorithm, guaranteed accuracy bound, directed graph

INTRODUCTION The article deals with a special case (for m = 2) of the Asymmetric Maximum m-Peripatetic Salesman Problem (m-APSP-max) consisting in the search of m oriented edge-disjoint Hamiltonian cycles of maximum total weight in a complete directed graph. This problem is also a modification of the symmetric case of the Maximum 2-Peripatetic Salesman Problem (2-PSP-max) which has been actively studied in recent years. It is known that the Traveling Salesman Problem (both for minimization and maximization) and all meaningful versions of the 2-Peripatetic Salesman Problem are NP-complete [3-5]. Therefore, it is interesting to distinguish polynomially solvable subclasses of these problems and construct efficient approximate algorithms for solving them with some guaranteed accuracy bound (or ratio). For example, for the Symmetric Maximum Traveling Salesman Problem (TSP-max), the best available algorithm has guaranteed accuracy bound 7/9 [7]. The same accuracy bound was obtained for the 2-PSP-max problem in [1]. For the Asymmetric Maximum Traveling Salesman Problem (ATSP-max), in [2], an efficient algorithm was constructed with the guaranteed accuracy bound 2/3. We obtain a similar result for the 2-APSP-max. Namely, for the Asymmetric Maximum 2-Peripatetic Salesman Problem, we construct an algorithm having the ratio 2/3 and time complexity bound O(n3 ), where n is the number of vertices in the graph. As well as the algorithm in [1], this algorithm is based on constructing a special coloring of the graph edges and subsequently distinguishing a pair of the edge-disjoint partial tours of sufficiently large weight. 1. NOTATION AND STATEMENT OF THE PROBLEM Let G = G(V, E) be a complete directed n-vertex graph with vertex set V = V (G) and edge set E = E(G) and let w : E → R+ be the edge weight function taking arbitrary nonnegative values. Use the following notation for a vertex v ∈ V in a diraph H: d+ (v) is the indegree (the number of incoming edges); *

E-mail: [email protected] E-mail: [email protected] *** E-mail: [email protected] **

61

62

GLEBOV et al.

d− (v) is the outdegree (the number of outcoming edges); d(v) = d+ (v) + d− (v) is the degree of a vertex v. An oriented 2-factor in a digraph H is a set of edge-disjoint cycles covering all vertices in H. A partial tour in a digraph H is a set of vertex-disjoint oriented paths covering all vertices in the digraph (these paths may include so-called singles; i.e., paths consisting of a single vertex). Let |T | and p(T ) denote the numbers of edges and vertices in a partial tour T respectively. Clearly, |T | + p(T ) = |V (H)| for every partial tour T in H. A bipartite model of a digraph H is a bipartite undirected graph D with parts V = V (H) and V  , where V  is the set of copies of all vertices of H and {X, Y  } ∈ E(D) ⇔ (X, Y ) ∈ E(H). The Asymmetric m-Peripatetic Salesman Problem (m-APSP) consists in finding m edge-disjoint Hamiltonian cycles in a digraph G for which the total weight of the edges is minimal or maximal (it is possible here that a cycle Hi contains an edge (X, Y ) and a cycle Hj contains the opposite edge (Y, X)). Let w∗ denote the weight of an optimal solution to the m-APSP. Clearly, the m-APSP is a generalization of the Asymmetric Traveling Salesman Problem (ATSP). For the maximum ATSP (ATSP-max), in [2], an algorithm was elaborated with guaranteed accuracy bound 2/3. We obtain an analogous result for the maximum 2-APSP (2-APSP-max). 2. ALGORITHM A2/3 FOR THE 2-APSP-MAX Given n ≤ 15 and a digraph G, by exhaustive search, we find a pair of edge-disjoint Hamiltonian cycles H1 and H2 which is an optimal solution to our problem. Suppose now that n ≥ 16. Phase 1. In G, find a subgraph G4 with maximal total edge weight such that, in G4 , every vertex v ∈ V satisfies the equalities d+ (v) = d− (v) = 2. For searching G4 , use a bipartite model D of the digraph G for which, by Gabow’s algorithm [6], in time O(n3 ), find a cyclic covering of maximal weight. A desired subgraph G4 of maximal weight in G corresponds to this covering. Since the problem of the search of a subgraph G4 of maximal weight with the indicated properties is a relaxation of the problem of the search of two edge-disjoint Hamiltonian cycles of maximal weight, the weight of the digraph G4 satisfies the estimate w(G4 ) ≥ w∗ . Phase 2. In G4 , distinguish two edge-disjoint partial tours T1 and T2 with the properties 2 n p(T2 ) ≥ . w(T1 ) + w(T2 ) ≥ w(G4 ), 3 5 Construct the tours separately for each connected component H of G4 . The following cases are possible: Case 1. The component H is isomorphic to a “double triangle” (see Fig. 1); i.e., to a digraph with the vertex set {A, B, C} and the edge set {(A, B), (B, A), (B, C), (C, B), (C, A), (A, C)}. The digraph H contains the three pairs of tours with edge sets: (1) {(A, B), (B, C)} and {(B, A), (A, C)}, (2) {(B, C), (C, A)} and {(C, B), (B, A)}, (3) {(C, A), (A, B)} and {(A, C), (C, B)}. Let (T1 , T2 ) stand for the pair of these tours with maximal edge weight. Since all three pairs of tours cover E(H) twice, we have w(T1 ) + w(T2 ) ≥

2 w(H), 3

p(T2 ) = 1 >

|V (H)| 3 = . 5 5

JOURNAL OF APPLIED AND INDUSTRIAL MATHEMATICS

Vol. 9 No. 1 2015

A POLYNOMIAL ALGORITHM WITH APPROXIMATION RATIO 2/3

63

Fig. 1. A double triangle.

Case 2. The component H is not isomorphic to a double triangle. This case splits into the two subcases: Subcase 2.1. The digraph H contains no cycle of length 2; i.e., H does not contain opposite edges. Then partition the edges in E(H) into two oriented 2-factors F1 and F2 . To this end, it suffices to partition the cyclic covering corresponding to H (see Phase 1) in the bipartite graph D into two matchings. After that construct partial tours T1 and T2 by removing the |C|/3 ≥ |C|/5 lightest edges from every cycle C in each 2-factor. In result, we obtain a pair of partial tours (T1 , T2 ) with total edge weight at least 23 w(H) (since the length of each cycle C is at least 3) satisfying the conditions |Ti | ≤

4 |V (H)|, 5

p(Ti ) = |V (H)| − |Ti | ≥ |V (H)|/5,

i = 1, 2.

Subcase 2.2. H contains a cycle of length 2. Partition the edge set E(H) into the three partial tours, which is equivalent to an edge coloring ϕ : E(H) → {1, 2, 3} of H such that each color class induces a tour. The Acyclic 3-Coloring recursive procedure described below uses a connected digraph K(V, E) with the following properties: (i) K is not isomorphic to a double triangle; (ii) (∀v ∈ V ) d+ (v) ≤ 2 and d− (v) ≤ 2; (iii) K contains either a vertex of degree at most 3 or a 2-cycle. Acyclic 3-Coloring(K) If K contains at most three edges then color them with pairwise distinct colors. Otherwise consider the following two cases: Case A1. K contains a 2-cycle (A, B, A). Denote other edges incident to A and B by (C, A), (A, D), (E, B), and (B, F ) (some of them possibly do not exist). Remove the edges (A, B) and (B, A) from the digraph K. Applying Acyclic 3-Coloring to the obtained digraph (or to its connected components), we obtain a 3-coloring ϕ of all edges in K except for the edges (A, B) and (B, A). Note that the appeal to this procedure is justified because conditions (i) and (ii) are obviously fulfilled and the vertices A and B have degree at most 2; i.e., (iii) also holds. Extend the coloring ϕ to (A, B) and (B, A). Up to a redenotation of colors, symmetry between A and B, and the replacement of the orientations of all edges in the digraph by the opposite orientation, the following cases of the coloring of the edges incident to A and B are possible: Subcase A1.1. ϕ(C, A) = ϕ(A, D) = 1, ϕ(E, B) ∈ {1, 2}, and ϕ(B, F ) ∈ {1, 3}. Put ϕ(A, B) := 3 and ϕ(B, A) := 2. Subcase A1.2. ϕ(C, A) = ϕ(A, D) = 1 and ϕ(E, B) = ϕ(B, F ) = 2. There is a color α ∈ {2, 3} such that, at the vertex C, there is no outgoing edge colored with α (Fig. 2). Put ϕ(A, B) := 3 and ϕ(B, A) := 1, then recolor the edge (C, A) with the color α. JOURNAL OF APPLIED AND INDUSTRIAL MATHEMATICS

Vol. 9 No. 1

2015

64

GLEBOV et al.

Fig. 2. Subcase A1.2, α = 3.

Fig. 3. Subcase A1.3.

Subcase A1.3. ϕ(C, A) = ϕ(E, B) = 1 and ϕ(A, D) = ϕ(B, F ) = 2. If this is possible then recolor the edge (C, A) and put ϕ(A, B) := 3 and ϕ(B, A) := 1. Suppose that recoloring (C, A) is impossible. Then there are an edge going out from C colored with color 3 and a path (A, D, . . . , C) colored with 2 (it is in particular possible that C = D). Consider the edge (A, D). Recolor it if possible and put ϕ(A, B) := 2 and ϕ(B, A) := 3. Otherwise, there exist an edge incoming to D colored with color 3 and a path (D, . . . , C, A) colored with 1. Put ϕ(A, B) := 3, ϕ(B, A) := 1, ϕ(C, A) := 2, and ϕ(A, D) := 1 (Fig. 3). No cycle of color 1 appears here since the path (. . . , E, B, A, D, . . .) of color 1 ends at C. Subcase A1.4. ϕ(C, A) = ϕ(B, F ) = 1 and ϕ(A, D) = ϕ(E, B) = 2. If possible, put ϕ(A, B) := 1,

ϕ(B, A) := 3

or

ϕ(A, B) := 3,

ϕ(B, A) := 2.

If both variants are impossible then the digraph K contains a path P1 = (B, F, . . . , C, A) colored with 1 and a path P2 = (A, D, . . . , E, B) colored with 2. If at C there is no outgoing edge colored with 2 then put ϕ(A, B) := 1,

ϕ(B, A) := 3,

ϕ(C, A) := 2.

Suppose that from C there goes out an edge of color 2, and, by symmetry, from E there goes out an edge of color 1. If C = E then recolor both edges (C, A) and (E, B) with color 3 and put ϕ(A, B) := 1 and ϕ(B, A) := 2 (Fig. 4). Let C = E. We may assume in view of symmetry that D = F . Since the digraph K is not isomorphic to a double triangle, C = D, and, by the existence of the paths P1 and P2 , there are no edges of color 3 at the vertices C and D. Consequently, we may color the edges (C, A) and (A, D) with color 3, after which we put ϕ(A, B) := 1 and ϕ(B, A) := 2 (Fig. 5). Subcase A1.5. ϕ(C, A) = ϕ(B, F ) = 1, ϕ(A, D) = 2, and ϕ(E, B) = 3. Assume that there is a path (B, F, . . . , C, A) colored with 1; otherwise, put ϕ(A, B) := 1 and ϕ(B, A) := 2. If at E there is no outgoing edge of color 1 then put ϕ(A, B) := 3,

ϕ(B, A) := 2,

ϕ(E, B) := 1.

Otherwise, there is no outgoing edge of color 2 at E. In this case, recolor the edge (E, B) with 2 and pass to Case A1.4. Subcase A1.6. ϕ(C, A) = ϕ(E, B) = 1, ϕ(A, D) = 2, and ϕ(B, F ) = 3. Put ϕ(A, B) := 3 and ϕ(B, A) := 2. JOURNAL OF APPLIED AND INDUSTRIAL MATHEMATICS

Vol. 9 No. 1 2015

A POLYNOMIAL ALGORITHM WITH APPROXIMATION RATIO 2/3

65

Fig. 4. Subcase A1.4, C = E.

Fig. 5. Subcase A1.4, C = E and D = F .

Case A2. K contains no 2-cycles but does contain a vertex A of degree at most 3. Remove one of the edges at the vertex A from K. Obviously, the connected components of the so-obtained digraph K  satisfy conditions (i)–(iii) in the description of Acyclic 3-Coloring. Apply this procedure to the digraph K  and its connected components. After that we must color only the remote edge e. This can be done without prior recoloring with the exception of the case when d(A) = 3. Then the vertex A is incident to the edges (A, B), (C, A) and to one of the edges (A, D) or (D, A). We may assume without loss of generality that e = (A, B). Denote the edges incident to B and different from (A, B) by (E, B), (B, F ), and (B, H). In coloring the edge (A, B), there appear the following nontrivial cases (in the other cases, the recoloring is made without prior recolorings): Subcase A2.1. There exists a path P = (B, F, . . . , C, A) colored with color 1, ϕ(A, D) = 2, and ϕ(E, B) = 3. If at D there are no incoming edges of color 3 then put ϕ(A, B) = 2 and ϕ(A, D) = 3. Otherwise, since the digraph K contains the path P , we can recolor the edge (A, D) with color 1 and color (A, B) with 2. Subcase A2.2. There exist paths P1 = (B, F, . . . , C, A) of color 1 and P2 = (B, H, . . . , D, A) of color 2, ϕ(E, B) = 3. There is a color α ∈ {1, 2} such that from E there goes out no edge of color α. Since K contains the paths P1 and P2 , we can recolor (E, B) with color α, after which color (A, B) with 3. Clearly, the complexity of Acyclic 3-Coloring is O(n2 ), where n = |V (K)|, since it consecutively colors the 2n edges of the digraph K and the coloring of each edge requires time O(n), which is determined by the complexity of the infinite looping check for the edges of each color. Denote by T1 , T2 , and T3 three tours in the digraph H constructed by Acyclic 3-Coloring(H), where  Ti consists of edges of color i = 1, 2, 3 respectively. Assume without loss of generality that p(T1 ) ≥ p(T2 ) ≥ p(T3 ). JOURNAL OF APPLIED AND INDUSTRIAL MATHEMATICS

Vol. 9 No. 1

2015

66

GLEBOV et al.

The procedure described below reconstructs the triple of tours (T1 , T2 , T3 ) in H into another triple of tours (T1 , T2 , T3 ) with the additional property p(T1 ) ≥ p(T2 ) ≥ |V (H)|/5. Equalization(T1 , T2 , T3 ) If p(T2 ) ≥ |V (H)|/5 then put Ti := Ti , i = 1, 2, 3. Otherwise, from the equalities |T1 | + |T2 | + |T3 | = |E(H)| = 2|V (H)|,

p(Ti ) + |Ti | = |V (H)|,

i = 1, 2, 3,

we conclude that |T3 | ≥ |T2 | >

4 |V (H)|, 5

|T1 | < 2|V (H)| − 2 ·

p(T1 ) > |V (H)| −

2 4 |V (H)| = |V (H)|, 5 5

2 3 |V (H)| = |V (H)|. 5 5

While p(T1 ) > 35 |V (H)|, repeat the following operation: find and move a “suitable” edge in T2 ∪ T3 = E(H) \ T1 to T1 , where a “suitable” edge is an edge whose addition to T1 leaves T1 a partial tour. For proving that such an edge can be found while p(T1 ) > 35 |V (H)|, observe that (X, Y ) ∈ E(H) \ T1 is a suitable edge if X is the terminal vertex of a path in the tour T1 , whereas Y is the initial vertex of another path in this tour. For each path P in T1 , there exist two edges in E(H) \ T1 going out of its terminal vertex. At least one of these edges does not lead to the initial vertex of P . Thus, E(H) \ T1 contains at least p(T1 ) > 35 |V (H)| candidate edges. Note that not all these edges lead to noninitial vertices of the paths of T1 because T1 contains 2 |V (H)| − p(T1 ) < |V (H)| 5 noninitial vertices, and every noninitial vertex of a path of T1 can be the terminal vertex only for one candidate edge. Consequently, the candidate edges contain at most |V (H)|/5 suitable edges. Clearly, the complexity of the Equalization(T1 , T2 , T3 ) procedure is equal to O(n2 ). After applying Equalization(T1 , T2 , T3 ), choose as T1 and T2 a pair of tours with maximal total edge weight among T1 , T2 , and T3 , where p(T1 ) ≤ p(T2 ). By its main property, p(T2 ) ≥ |V (H)|/5. Phase 3. Now the time has come to present the final procedure Construction(H1 , H2 ), which constructs two edge-disjoint Hamiltonian cycles H1 and H2 in the digraph G on the basis of the tours T1 and T2 obtained at Phase 2 in such a way that H1 ∪ H2 ⊃ T1 ∪ T2 , and hence 2 2 w(H1 ) + w(H2 ) ≥ w(T1 ) + w(T2 ) ≥ w(G4 ) ≥ w∗ . 3 3 As a result of Phase 2, for each connected component H in G4 , we have the inequality   p T2H ≥ |V (H)|/5, where T2H is the set of the paths of T2 contained in the connected component H. Thus, p(T2 ) ≥ |V |/5 = n/5 ≥ 4, since n ≥ 16. Construction(H1 , H2 ) Join the tour T1 in a Hamiltonian cycle H1 by arbitrary suitable edges. If the added paths belonged to T2 then carry them over from T2 to H1 . After that, if p(T2 ) > 4 then add suitable edges from E \ H1 to T2 until we decrease the number of paths to 4. JOURNAL OF APPLIED AND INDUSTRIAL MATHEMATICS

Vol. 9 No. 1 2015

A POLYNOMIAL ALGORITHM WITH APPROXIMATION RATIO 2/3

67

Suppose that T2 consists of four paths: P1 = (A, . . . , B),

P2 = (C, . . . , D),

P3 = (F, . . . , K),

P4 = (M, . . . , L).

Since one of the edges (B, C) or (B, F ), say, (B, C), does not belong to H1 , we may add (B, C) to T2 , thus uniting the paths P1 and P2 into one path (A, . . . , D). Then, by the same principle, unite the path (A, . . . , D) with P3 , thus forming a path (A, . . . , K). If both edges (K, M ) and (L, A) do not belong to H1 then, adding them to T2 , we obtain a desired cycle H2 . Otherwise, the edge (K, A) does not belong to E(H1 ); adding it to T2 , we obtain a cycle S that contains P1 , P2 , and P3 . Note that at least two of the edges (B, M ), (D, M ), and (K, M ), for definiteness, (B, M ) and (D, M ), do not belong to H1 . Moreover, either (L, C) or (L, F ), for definiteness, (L, C), does not belong to H1 . Adding (B, M ) and (L, C) to T2 (and removing (B, C)), insert the path P4 between P1 and P2 . In result, we obtain a desired Hamiltonian cycle H2 . It is not hard to observe that the complexity of Construction(H1 ,H2 ) is O(n). Thus, the time complexity of the whole algorithm A2/3 is determined by Gabow’s algorithm, applied at Phase 1, and is equal to O(n3 ). ACKNOWLEDGMENTS The authors were supported by the Russian Foundation for Basic Research (projects nos. 12–01– 00090, 12–01–00093, 12–01–00448, and 12–01–00631) and the State Maintenance Program for the Leading Scientific Schools of the Russian Federation (project NSh–1939.2014.1). REFERENCES 1. A. N. Glebov and D. Zh. Zambalaeva, “A Polynomial Algorithm with Approximation ratio 7/9 for the Maximum Two Peripatetic Salesmen Problem,” Diskretn. Anal. Issled. Oper. 18 (4), 17–48 (2011) [J. Appl. Indust. Math. 6 (1), 69–89 (2012)]. 2. H. Kaplan, M. Lewenstein, N. Shafrir, and M. Sviridenko, “Approximation Algorithms for Asymmetric TSP by Decomposing Directed Regular Multigraphs,” JACM 52 (4), 602–626 (2005). 3. J. B. J. M. De Kort, “Lower Bounds for Symmetric K-Peripatetic Salesman Problems,” Optimization 22 (1), 113–122 (1991). 4. J. B. J. M. De Kort, “Upper Bounds for the Symmetric 2-Peripatetic Salesman Problems,” Optimization 23 (4), 357–367 (1992). 5. J. B. J. M. De Kort, “A Branch and Bound Algorithm for Symmetric 2-Peripatetic Salesman Problems,” Eur. J. Oper. Res. 10 (2), 229–243 (1993). 6. H. N. Gabow, “An Efficient Reduction Technique for Degree-Restricted Subgraph and Bidirected Network Flow Problems,” in Proceedings of the 15th Annual ACM Symposium on Theory of Computing (Boston, April 25–27, 1983) (ACM, New York, 1983), pp. 448–456. 7. K. Paluch, M. Mucha, and A. Madry, “A 7/9-Approximation Algorithm for the Maximum Traveling Salesman Problem,” in 12th International Workshop on Approximation Algorithms for Combinatorial Optimization Problems—APPROX 2009, 21–23 August 2009, UC Berkeley, USA (UC Berkeley, 2009), pp. 298-311.

JOURNAL OF APPLIED AND INDUSTRIAL MATHEMATICS

Vol. 9 No. 1

2015

Suggest Documents