1 / 55

The Traveling Salesman Problem in Theory & Practice

The Traveling Salesman Problem in Theory & Practice. Lecture 4: Polynomial-Time Solvable Special Cases Completed and Practical Heuristics Begun 11 February 2014 David S. Johnson dstiflerj@gmail.com http:// davidsjohnson.net Seeley Mudd 523, Tuesdays and Fridays. Outline.

jalia
Download Presentation

The Traveling Salesman Problem in Theory & Practice

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. The Traveling Salesman Problem in Theory & Practice Lecture 4: Polynomial-Time Solvable Special Cases Completed and Practical Heuristics Begun 11 February 2014 David S. Johnson dstiflerj@gmail.com http://davidsjohnson.net Seeley Mudd 523, Tuesdays and Fridays

  2. Outline • Weighted Planar TSP Corrected • Gilmore-Gomory Algorithm Concluded • Tour Construction Heuristics Introduced

  3. TSP for Planar Weighted Graphs • Solvable in time 2O(sqrt(N)) by Divide-and-Conquer (it was claimed…) • (Recall our best general TSP algorithm takes time O(n22n)). • Exploited planar separator theorem [Lipton & Tarjan, 1979]: • In any planar graph G with N vertices, the vertices of G can be partitioned into 3 sets, S, A, and B, such that |S| ≤ 2sqrt(2N), both |A| and |B| are bounded by 2N/3, and there is no edge between a vertex in A and one in B. This partition can be found in linear time. ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ A B B A ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ S S S

  4. How an Optimal Tour Might Look Forced Edges ∂∂∂ ∂∂∂ B A ∂∂∂ ∂∂∂ ∂∂∂ S

  5. How an Optimal Tour Might Look Forced Edges ∂∂∂ ∂∂∂ B A ∂∂∂ ∂∂∂ ∂∂∂ S

  6. Previous Implicit Claim For each possible Hamilton Circuit topology, simply solve these two sub-problems and glue the solutions together. But there is a problem with this reasoning.

  7. Think of our “Fixed Edges” as Schemata for Half the Tour ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ B A ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ S

  8. For a given A-side Schemata, more than one B-side Schemata may be valid. ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ B A ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ S

  9. For a given A-side Schemata, more than one B-side Schemata may be valid. ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ B A ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ S

  10. For a given A-side Schemata, more than one B-side Schemata may be valid. ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ B A ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ S

  11. Potential Difficulty ∂∂∂ Possible Topologies for B: T1, T2, T3, …, Tm. Possible topologies for A if we force the edges corresponding to Ti: Ti,1, Ti,2, …, Ti,m[i]. Suppose the best topology for B is T2, but the best Ti,j for A is T3,1. Are we guaranteed that the union of T2 and T3,1 is a tour? ∂∂∂ ∂∂∂ Forced Edges ∂∂∂ A ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ S

  12. New Basic Problem to Be Solved by Divide-and-Conquer • Given:a planar graph G = (V,E), a collection P of k pairs {ui,vi} of vertices, no two pairs overlapping, and a set E’ ⊆ E of forced edges. • Find: a collection of kvertex-disjoint paths, where the kth path connects ui to vi, such that the union of the paths covers all vertices of G and includes all edges in E’. • Note: For the TSP, we take k=1,u1 = v1, and E’ = Φ.

  13. Instance(G,E’,P)solved by constructing pairs of sub-problems: ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ A B ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ S Construct a separator system (A,B,S) as described earlier. Let GA be the subgraph induced by A∪S and GB by the subgraph induced by B∪S. Let EA’ be the subset of E’ with both endpoints in A∪S and at least one in A, and let EB’ be the subset of E’ with both endpoints in B∪S and at least one in B. Let ES be the set of edges in G between vertices in S, and let ES’ = ES∩E’. Pick a subset ES’’, ES’ ⊆ ES’’⊆ES such that no vertex is incident on more than 2 edges in ES’’. The A sub-problem will have graph GA and forced-edge set ES’’∪EA’, and the Bsub-problem will have graph GB and forced-edge set ES’’∪EB’. The choices for the Path sets PA and PB are derived as follows:

  14. Segments S-vertex S-vertex ∂∂∂ ∂∂∂ S-segments ∂∂∂ E’-edge A B ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ Independent S-vertex ∂∂∂ S-segment: Lies entirely within S, consists of a maximal path using edges of E’’ and including at least two vertices. A-segment: Lies entirely within A∪S, contains at least one A-vertex, and each endpoint is either an endpoint in P, an independent S-vertex, or an endpoint of an S-segment. B-segment: Lies entirely within B∪S, contains at least one B-vertex, and each endpoint is either an endpoint in P, an independent S-vertex, or an endpoint of an S-segment.

  15. Path Schemata • A path for a pair {u,v} in P withu∈Aandv∈A∪S can be • An A-segment with endpoints u and v. • A sequence of segments, starting with an A-segment and alternating between A- and B-segments thereafter, with adjacent A- and B-segments either sharing an S-vertex as a common endpoint, or being linked by an S-segment with endpoints sand s’, with the A-segment having s for an endpoint and the B-segment having s’ for an endpoint. • In the first case, we keep {u,v} in PA. • In the second, we replace {u,v} in PA by the sequence of pairs representing the A-segments in the path, and add the B-segments to PB. • We do correspondingly for pairs {u,v} in P withu∈Bandv∈B∪S. • For pairs {u,v} in Pwithu∈Aandv∈B, the path is a sequence of segments, starting with an A-segment and ending with a B-segment, and we again add pairs to PA and PB in the appropriate way.

  16. S-vertex ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂

  17. Path Schemata • A path for a pair {u,v} in P withu∈Aandv∈A∪S can be • An A-segment with endpoints u and v, or • A sequence of segments, starting with an A-segment and alternating between A- and B-segments thereafter, with adjacent A- and B-segments either sharing an independent S-vertex as a common endpoint, or being linked by an S-segment with endpoints sand s’, with the A-segment having s for an endpoint and the B-segment having s’ for an endpoint. • In the first case, we keep {u,v} in PA. • In the second, we replace {u,v} in PA by the sequence of pairs representing the A-segments in the path, and add the B-segments to PB. • We do correspondingly for pairs {u,v} in P withu∈Bandv∈B∪S. • For pairs {u,v} in Pwithu∈Aandv∈B, the path is a sequence of segments, starting with an A-segment and ending with a B-segment, and we again add pairs to PA and PB in the appropriate way.

  18. S-vertex ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ Note: No two A-segments (red segments) share an endpoint, nor do any two B-segments (blue segments). Every independent S-vertex, and one endpoint of every S-segment, is an endpoint of one A-segment and one B-segment.

  19. Path Schemata • A path for a pair {u,v} in P withu∈Aandv∈A∪S can be • An A-segment with endpoints u and v, or • A sequence of segments, starting with an A-segment with u as an endpoint, ending with an A-segment with v as an endpoint, in between alternating between A- and B-segments, with adjacent A- and B-segments either sharing an independent S-vertex as a common endpoint, or being linked by an S-segment with endpoints sand s’, with the A-segment having s for an endpoint and the B-segment having s’ for an endpoint. • In the first case, we keep {u,v} in PA. • In the second, we replace {u,v} in PA by the sequence of pairs representing the A-segments in the path, and add the B-segments to PB. • We do correspondingly for pairs {u,v} in P withu∈Bandv∈B∪S. • For pairs {u,v} in Pwithu∈Aandv∈B, the path is a sequence of segments, starting with an A-segment with endpoint u and ending with a B-segment with endpoint v, and we again add pairs to PA and PB in the appropriate way. • For pairs {u,v} in P with both u and v in S, if they are both endpoints of the same S-segment, their path is covered by E’ and we can delete {u,v}. Otherwise, it must contain an A-vertex, a B-vertex, or both, and the treatment is as expected.

  20. Overall Connectivity Schema • The overall schema for a solution to (G,E’,P) is the union the pairs corresponding to the segments making up all the connecting paths for the pairs in P, and can be partitioned into disjoint sets PA and PBcorresponding to those segments that contain elements of A and B, respectively. • In this way, every possible solution to (G,E’,P) yields a pair of matching sub-problems (GA,EA’,PA) and (GB,EB’,PB), whose solutions will together yield a solution to the original problem. • To bound the number of such pairs, and also to provide a non-topological way to generate them, we label the vertices of S and exploit planarity. • Vertices labeled A will be members of pairs in PA, and vertices labeled B will be in pairs in PB.

  21. Labeling S (Actually, one label per independent S-vertex and per S-segment) Case 1: Items not involved in pairs of P. • Consider an independent S-vertex v. Our cover must contain two edges between v and non-S vertices. There are three choices. • If both neighbors are in A, delete from GB all edges from v to vertices in B and leave v unlabeled. • If both neighbors are in B, delete from GAall edges from v to vertices in A and leave v unlabeled. • If one neighbor is in A and the other in B, label vas both A and B. • Consider an S-segment with endpoints u and v, where u precedes v in the original ordering of the vertices. Our cover must contain an edge linking u to a non-S-vertex and an edge linking v to a non-S-vertex. There are now four choices. • If both neighbors are in A, delete from GB all edges from u and vto vertices in B and leave the segment unlabeled. • If both neighbors are in B, delete from GA all edges from u and v to vertices in Aand leave the segment unlabeled. • If the neighbor of u is in A and the neighbor of v is in B, label the segment (A,B) . • If the neighbor of u is in Band the neighbor of v is in A, label the segment (B,A).

  22. Labeling S Case 2: Items that involve members of pairs of P. Note that a member v of a pair will have only one neighbor in our union of paths. Let u be the other member of the pair in P containing v. • If v is an independent S-vertex, then our cover must contain a segment linking it to a member of A or of B. Choose one and label v with that choice. • If v is an endpoint of an S-segment, let w be the other end of the S-segment containing v. If w = u, our required set ES’’ already contains a path for the {v,u} pair, so we can delete that pair. Otherwise, u must be in A∪B, and we label v either A or B, noting that the path from v must go through the S-segment. Note: in neither Case 1 nor Case 2 is there a situation where there are more than 3 choices of label for a vertex or 4 for a segment. Since there are always at least two vertices in a segment, this means that there are at most 3 choices per vertex in S.

  23. Bounding the Total Possibilities to be Considered Assume as before that N ≥ 225. Every item labeled with an X ∈ {A,B} will generate a pair corresponding to an X-segment, the other end being either a similarly labeled item in S or a member of X that is a member of a pair in P. • The choices involving other S-vertices and S-segments will collectively be constrained to at most 2|S| =22sqrt(2N) by planarity. • The choices involving members of A and B are constrained by the size of P. • At the top level |P| = 1. Each recursive call can add at most two pairs for each element of the new separator, which is no more than x=22sqrt(2n)< 6sqrt(n), where n is the number of vertices in the current graph. The number of vertices in the sub-problems is reduced to something less than .87 times that for the parent problem, and so the separator size for them will be less than .95 times its former value and so, at any level, the total size of P is at most x∑1∞(.95)i < x/(1-.95) = 20x < 120sqrt(N). • Conservatively, this means that each of the at most 2|S| labels can have no more than 120sqrt(N) choices, for a total of (120sqrt(N))6sqrt(N) <26(7+log(sqrt(N)))sqrt(N). To bound the total number of choices, we need to multiply this by the number of choices for E’’ (23sqrt(N)) and the number of labellings (3|S| < 25sqrt(N)), yielding 2 (50+6log(sqrt(N)))sqrt(N) < 219log(sqrt(N))sqrt(N) Since log(sqrt(N) > 3.9 when N ≥ 225 and hence 50 < 13log(sqrt(N)).

  24. Running Time Induction • Claim:We can solve this problem in time O(2αsqrt(N)log(sqrt(N))) for a constant α to be determined later (previously determined to be 217 with the log(sqrt(N)) term omitted). • Proof: We will show that if the bound holds for N’ <N, then it holds for N as well. As a basis for the induction, we solve the problem by exhaustive search when N ≤ 225(in large but constant time).

  25. So, suppose N > 225. Find a planar separator S with max(|A|,|B|)≤ 2N/3, and |S| ≤ 2sqrt(2N) < 3sqrt(N), which is less than N/5 since N > 225. Thus neither |A∪S| nor |B∪S| exceeds (0.87)N. So for each of our less than 219sqrt(N)log(sqrt(N)choices, we can solve the relevant A and B problems in time no more than than 2αsqrt(.87N)log(sqrt(.87N))< 2(.94)αsqrt(N)log(sqrt(N)) For a total of at most 219sqrt(N)log(sqrt(N))2(.94)αsqrt(N) log(sqrt(N))= 2(19+(.94)α)sqrt(N) log(sqrt(N)). 19+(.94)α will be less than α if (.06)α > 19. Thus α > 317 will suffice and our overall running time is O(2317sqrt(N)log(sqrt(N))). QED

  26. Gilmore-Gomory Distances • Cities are pairs of rational numbers vi = (ai,bi), 1 ≤ i ≤ N. • Distances determined by two real integrable functions f,g: R→ R, subject to the constraint that for any x, f(x) + g(x) ≥ 0. • Cost of from city vito city vjis • (The area between ai and bj under the relevant curve f or g.) • Note that this is not necessarily symmetric. • The constraint guarantees that the total cost of any cycle is non-negative.

  27. The Algorithm • Standard Heuristic: • Find a minimum-cost directed matching on the bipartite graph with copies of the cities representing the out-ports of the cities on the left and copies representing the in-ports on the right, with the cost of the edge from vi(out) to vi(in) being cij. • A matching thus yields a set of N directed arcs, with each city having in- and out-degree 1. If the resultig graph is a single cycle, then it is an optimal tour and we are done. • Otherwise, we have a union of directed cycles. • Patch the cycles together repeatedly by • picking a pair of cycles • removing one arc from each, and • replacing the removed arcs by a pair of arcs joining the two cycles. ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂

  28. Finding the Matching • Index the cities so that b1 ≤ b2 ≤ … ≤ bN. • By sorting, find a permutation πsatisfying aπ(1) ≤ aπ(2) ≤ … ≤ aπ(N). • Our matching then can then be viewed as consisting of the pairs (vi,vπ(i)), 1≤ i≤ N. • Proof by an uncrossing argument, given last week.

  29. Digression: Tours & Permutations • Two different correspondences: • vπ(i) is the ith city in the tour (“tour order”). Tour cost = • vπ(i) is the successor of vi in the tour (“successor order”). Tour cost = • Note: There are n! permutations, but only (n-1)! distinct tours. • For tour order, each tour is represented by n different permutations. • For permutation order, only (n-1)! of the permutations actually represent tours. The rest represent covers by two or more disjoint cycles. The definition above of “tour cost” for permutation order extends naturally to cost(π) for any permutation π.

  30. Products of Permutations • Let π and σ be permutations of length n. • Then the product πσ is defined by πσ(i) = π(σ(i)), 1 ≤ i ≤ n. • More generally, πσ1σ2σ3σk(i) = π(σ1(σ2(σ3((σk(i)))))) • Note: Associative, but not necessarily commutative. • Let σi,j, i < j, denote the “transposition” that interchanges i and j and leaves everything else the same

  31. Permutation π: Transposition σ1,2: Transposition σ2,3: Product πσ1,2: Product πσ1,2σ2,3: Product πσ2,3σ1,2: 5 (1,2) (2,3) 5 (2,3) (1,2) ∂∂∂ ∂∂∂ 4 1 4 1 ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ 3 6 3 6 ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ 9 8 2 7 9 8 2 7

  32. Permutation π: Transposition σ = (1,2): Transposition τ = (2,3): Product πσ: Product πστ: Product πτσ: 5 (1,2) (2,3) 5 (2,3) (1,2) ∂∂∂ ∂∂∂ 4 1 4 1 ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ 3 6 3 6 ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ ∂∂∂ 9 8 2 7 9 8 2 7

  33. The Transposition Graph • Let Gπbe the directed graph induced by π, and suppose it contains cycles C1, C2, …, Ck. • We construct an auxiliary weighted multi-graph G* whose vertices are the cycles of Gπ. For each transposition σi,jwith i < j, there is an edge joining the cycle containing vertex i to the cycle containing vertex j (a self-loop if i = j). The weight of this edge is cost(cπσi,j) – cost(π), the increase in the cost of our assignment if the corresponding swap is performed on Gπ. • Note that if vertices i and j are in distinct cycles Cg and ChofGπ, then performing the swap indicated by σi,jwill merge those cycles into a single combined cycle, although if they are in the same cycle Ch of Gπ, then performing the swap will only rearrange the vertices in Ch • As a consequence, any connected subgraph of G* corresponds to a set of transpositions that, if performed in any order, will turn Gπ into a tour. • The Gilmore-Gomory algorithm works by computing a particular minimum spanning tree (MST) for G* and performing the corresponding swaps in a particular order.

  34. Costs of Transpositions First: Another Way of Looking at Costs • For an interval X of the reals, possibly empty, let Xf, Xg, and Xf+gdenote the integrals of f, g, and (f+g) over X, respectively. • For example, if a ≤ b, then the interval [a,b] is defined, and [a,b]f = • On the other hand, if X is empty, then the values are all 0. • Using this notation, we have ci,j = ([bi,+∞]∩[-∞,aj])f + ([-∞,bi]∩[aj,+∞])g • Note that the first intersection is [bi,aj] if bi < aj, and otherwise empty. The second is [aj,bi] if bi > aj, and otherwise empty. So this agrees with our original definitions.

  35. The Cost of a Swap Let σi,j denote the transposition that interchanges i < j. Let cπ(σ) be the increase in cost derived from replacing the permutation π be πσ, that is, by performing the swap σ on the assignment denoted by π. Note that cπ(σi,j) then equals ci,π(j)- ci,π(i)+ cj,π(i) - cj,π(j). Also, note that since i < j, we have bi <bjand aπ(i) < aπ(j). In our new notation, we have ci,π(j) - ci,π(i) = ([bi,+∞]∩[-∞,aπ(j)])f + ([-∞,bi]∩[aπ(j),+∞])g - (([bi,+∞]∩[-∞,aπ(i)])f + ([-∞,bi]∩[aπ(i),+∞])g ) = ([bi,+∞]∩[aπ(i),aπ(j)])f - ([-∞,bi]∩[aπ(i), π(j)])g. Similarly, cj,π(i) - cj,π(j) =([bj,+∞]∩[-∞,aπ(i)])f + ([-∞,bj]∩[aπ(i),+∞])g - (([bj,+∞]∩[-∞,aπ(j)])f + ([-∞,bj]∩[aπ(j),+∞])g ) = - ([bj,+∞]∩[aπ(i),aπ(j)])f + ([-∞,bj]∩[aπ(i), π(j)])g). Thus we have cπ(σi,j) = ([bi,bj]∩[aπ(i),aπ(j)])f + ([bi,bj]∩[aπ(i), π(j)])g= ([bi,bj]∩[aπ(i),aπ(j)])f+g

  36. The Cost of a Transposition [bi, bi]∩[aπ(i),aπ(j)] bi bj σi,j aπ(i) aπ(j) Optimal Matching cπ(σi,j) = ([bi, bi]∩[aπ(i),aπ(j)])f+g

  37. Lemma: There is a MST for G* consisting only of edges corresponding to transpositions σi,i+1, 1 ≤ i < N. Proof: Suppose not, and let T be an MST containing the minimum possible number of non-adjacent transpositions. Suppose σi,j, j>i+1, is such a transposition in T, and let Cg and Ch be the cycles ofGπcontaining i and j, respectively. Note that these cycles must be distinct, as otherwise σi,j is a self-loop, which minimum spanning trees do not contain. Now consider the set of adjacent transpositions {σi,i+1, σi+1,i+2, …, σj-1,j}. These by themselves will cause all the cycles containing i, i+1, i+2, …, j-1, and j to merge together, and in particular will cause Cgand Chto become part of the same cycle. Hence replacing σi,jby this set will still yield a spanning subgraphT’ for G*. Claim: the cost of the transpositions in T’ will be no larger than the cost of the transpositions in T. Given the Claim, any spanning tree T’’ of T’ will be an MST for G* that has fewer non-adjacent transpositions than T, a contradiction. So all we need do is prove the Claim and we will be done.

  38. Proof by Picture [bi, bi]∩[aπ(i),aπ(j)] bi bj σi,j aπ(i) aπ(j) Optimal Matching

  39. Ordering the Swaps • As we have observed, order makes a difference, and the eventual effect of the swap σi,j need not be cπ(σi,j). • However, for a set of adjacent swaps, there is an ordering such that the total increase in cost over cost(cπ) is, in fact, the sum, over all σin T, of cπ(σ), and this can be proved to be the best possible. • To define this order, say vertex i is of “Type 1” relative to a permutation ψif bi ≤ aψ(i), and otherwise is of “Type 2”. • Let the type of a transposition σi,i+1 relative to ψ be that of vertex i. • Let S1 be the set of transpositions that are of Type 1 relative to our optimal assignment π, and let S2 be the set of transpositions that are of Type 2 relative to π. • Our order is as follows: • First do all the transpositions σi,i+1 in S1 in order of decreasing value i. Then do all the transpositions σi,i+1 in S2 in order of increasing value i.

  40. Theorem: Let τ be product of the transpositions in T in the stated order. Then cost(πτ) = cost(π) + ∑σ∈Tcπ(σ). Proof: Say that a permutation ψ is order-preserving on a pair (i,j) if bj > bi ⇒ aψ(j) ≥ aψ(i). Note that our initial permutation π is order-preserving on all pairs. We rely on the following: Lemma: Let ψ be a permutation that is order-preserving on (i,j) and (p,q) with i < j and p < q. Let ψ’ =ψσp,q. Then cψ’(σi,j) = cψ(σi,j) and ψ’ is order-preserving on (i,j) if any of the following four case apply: • p > j, • q < i, • p = j and vertex j is of Type 1 relative to ψ, • q = I and vertex iis of Type 2 relative to ψ. Moreover, in case (c), vertex j is still of Type 1 relative to ψ’, and in case (d), vertex i is still of Type 2 relative to ψ’. Proof of Lemma: See next slide. We shall use the Lemma to show that the transposition costs never change under our permutation order, and hence the Theorem holds.

  41. Say that a permutation ψ is order-preserving on a pair (i,j) if bj > bi ⇒ aψ(j) ≥ aψ(i). We rely on the following: • Lemma: Let ψ be a permutation that is order-preserving on (i,j) and (p,q) with i < j and p < q. Let ψ’ =ψσp,q. Then cψ’(σi,j) = cψ(σi,j) and ψ’ is order-preserving on (i,j) if any of the following four case apply: • p > j, • q < i, • p = j and vertex j is of Type 1 relative to ψ, • q = iand vertex i is of Type 2 relative to ψ. • Moreover, in case (c), vertex j is still of Type 1 relative to ψ’, and in case (d), vertex i is still of Type 2 relative to ψ’. • Proof: (a) and (b) are obvious, since the transpositions do not overlap. For (c), we have • Case (d) is similar. bi bj= bp bq

  42. Say that a permutation ψ is order-preserving on a pair (i,j) if bj > bi ⇒ aψ(j) ≥ aψ(i). We rely on the following: • Lemma: Let ψ be a permutation that is order-preserving on (i,j) and (p,q) with i < j and p < q. Let ψ’ =ψσp,q. Then cψ’(σi,j) = cψ(σi,j) and ψ’ is order-preserving on (i,j) if any of the following four case apply: • p > j, • q < i, • p = j and vertex j is of Type 1 relative to ψ, • q = iand vertex i is of Type 2 relative to ψ. • Moreover, in case (c), vertex j is still of Type 1 relative to ψ’, and in case (d), vertex i is still of Type 2 relative to ψ’. • Proof of Cost Theorem: • Recall that our initial permutation π is order-preserving on all pairs by definition. • Consider a Type 1 transposition σh,h+1 encountered in the downward phase, and let it be the σp,q of the Lemma. Consider a remaining unexecuted transposition. If it does not involve p or p+1, case (a) or (b) applies. Otherwise, if it is above σh,h+1 it must be σh+1,h+2 and case (d) applies with h+1 = i. And, finally, if it is below, then it must be σh-1,h and case (c) applies with h = j. • Similarly, consider a Type 2 transposition σh,h+1 encountered in the upward phase, and let it be the σp,q of the Lemma, and consider an unexecuted transposition which does not satisfy (a) or (b). Then that transposition must be Type 2 and hence σh+1,h+2. Thus case (d) applies with h+1 = i.QED

  43. What Remains We have shown that cost(πτ) = cost(π) + ∑σ∈Tcπ(σ), where τis the product permutation generated by Gilmore and Gomory’s ordering of their set of MST transpositions T. It remains to be shown that there is no τ’ with cost(πτ’) < cost(π) + ∑σ∈Tcπ(σ). It is not surprising that this is true, but.. Gilmore and Gomory take 4.5 pages. The two TSP books prove it by relying on much more general and abstract results about distribution matrices, etc. A potential topic for a student presentation?

  44. One More Polynomial-Time Solvable Special Case:Fixed-Head Drum Scheduling S. H. Fuller, “An optimal drum scheduling algorithm,” IEEE Trans. Comput.C-21 (1972), 1153-1165.

  45. Disk Scheduling (Restricted) Locations of the files one want to retrieve Distance between two files = time it takes for the head to rotate from the end of one to the beginning of the next. (In the fixed-head drum version, there is assumed to be a head for each track, and switching between heads is assumed to be instantaneous.)

  46. New Topic: Practical Heuristics For now, we will concentrate on the Symmetric TSP, where d(a,b) = d(b,a) for all cities a, b. Unlike the Christofides and Double MST algorithms, most of the heuristics we discuss will make sense even if the Triangle inequality does not hold, Although our performance bounds for them do depend on it holding. And our empirical results typically concern geometric instances. We will start with theoretical results, but subsequent emphasis will be placed on real-world running time, solution quality, and the trade-offs between them. We will also cover implementation details that affect running time/tour quality, both those that apply in general and those that exploit geometry.

  47. Nearest Neighbor (NN): Start with some city. Repeatedly go next to the nearest unvisited neighbor of the last city added. When all cities have been added, go from the last back to the first.

  48. No -Inequality Danger • Theorem[Karp, 1972]: Given a graph G = (V,E),it is NP-hard to determine whether G contains a Hamiltonian circuit (collections of edges that make up a tour). • Given a graph, construct a TSP instance in which d(c,c’) = • If Hamiltonian circuit exists, OPT = N, if not, OPT > N2N. • A polynomial-time approximation algorithm that guaranteed a tour of length no more than 2N OPT would imply P = NP. { 1 if {c,c’}  E N2N if {c,c’}  E

  49. Theorem [Rosenkrantz, Stearns, & Lewis, 1977]: • There exists a constant c, such that if instance I obeys the triangle inequality, then we have NN(I) ≤ clog(N)Opt(I). • There exists a constant c’, such that for all N > 3, there are N-city instances I obeying the triangle inequality for which we have NN(I) > c’log(N)Opt(I). • For any algorithm A, let RN(A) = max{A(I)/OPT(I): I is an N-city instance} • ThenRN(NN) = Θ(log(N)) (worst-case ratio)

  50. Upper Bound Proof (Sketch) • Observation 1: For symmetric instances with the -inequality, d(c,c’) ≤ OPT(I)/2 for all pairs of cities {c,c’}. P1 c Optimal Tour P2 c’ -inequality  d(c,c’) ≤ length(P1) and d(c,c’) ≤ length(P2) 2d(c,c’) ≤ OPT(I)

More Related