Download presentation

Presentation is loading. Please wait.

Published byNora Bristow Modified over 2 years ago

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

2
Outline Rectangular Graphs Weighted Planar Graphs Gilmore-Gomory Instances But first, corrections to, and elaborations on, Lecture 2. (Already incorporated in last week’s lecture notes at davidsjohnson.net)

3
Getting to the Grid Lemma: Any 2-connected planar graph with f faces and n edges (all of degree 2 or 3) has an embedding in the 2D grid that can be contained in square of size 2f+n (has “extent” no more than 2f+n).

4
Proof of Lemma Note that, if a graph is planar, then for each of its faces there is a planar representation in which that face is the external face (that is, the one that contains all the other vertices). We proceed by induction on the number of faces f, with the hypothesis that, for any graph G as above and a designated face, there is a grid embedding of extent 2f+n or less, such that – the designated face is the external face of the embedding, and – no degree-2 vertex of the external face has any vertex or edge of the embedding to its right on the gridline containing it.

5
Base Case: f = 1 ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ 2f + n = 4 + 6 = 10 > 8

6
Inductive step: Assume true for all f’ < f ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ Chosen Face F Planar 2-connected graph G with all vertex degrees equal to 2 or 3

7
∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ Chosen Face F Pick a face F’ that shares an edge with our chosen face. Delete all shared edges and degree-2 vertices, leaving n’ vertices. Now we have an (f-1)-face graph and a chosen face, for which the induction hypothesis holds. Neighboring Face F’ Combined Face F’’

8
Embedding with F’’ as external face. Extent no more than 2(f-1)+n’ ∂∂∂∂∂∂ ∂∂∂∂∂∂ Degree 2 vertices on the boundary of our original face ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ Two Cases for the boundary of F’’ that is not shared with F: 1.Interior 2.Exterior

9
Extent no more than 2(f-1)+n’ ∂∂∂∂∂∂ ∂∂∂∂∂∂ Degree 2 vertices on the boundary of our original face ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ First Case: Internal Deleted edges and degree-2 vertices from F. ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ Extent no more than 2(f-1)+n’ + 1 < 2f+n

10
Extent no more than 2(f-1) + n’ Extent no more than 2(f-1) + n’ + (n-n’) < 2(f-1) + n Extent no more than 2(f-1) + n + 1 < 2f + n ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ First Case: Internal But what if there were many deleted degree-2 vertices? ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂

11
2nd Case: External ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ Extent no more than 2(f-1) + n’ Extent no more than 2(f-1) + n’ + (n-n’) < 2(f-1) + n Extent no more than 2(f-1) + n + 2 < 2f + n ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂

12
Note that this argument assumes we can always find a neighboring face that shares only a single path with our chosen face. Exercise: Show that this is true. ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ F No Yes

13
Color-Preserving Embeddings If a graph is bipartite, we can two-color its vertices (say black and white), so that no two adjacent vertices get the same color. Similarly, we can 2-color the vertices of the 2D grid, where the vertices whose coordinates sum to an even number get white, and those with odd sum get black. Lemma: If our original planar graph is bipartite, we can obtain an embedding into the 2D grid is color preserving.

14
1.Embed as before. 2.Multiply the scale by two so that all vertices go to black grid points 3.Move white vertices one cell to the right, as illustrated below.

15
Rectangular Graphs 14 x 8 Rectangular subgraph of the infinite grid. Trivial Theorem: A rectangular graph has a Hamilton circuit if and only if at least one of its dimensions is even.

16
Hamilton Paths in Rectangular Graphs No specified endpoints: Always exists. One specified: Depends on the endpoint. Two specified endpoints: Depends on the endpoints. For the last two cases, algorithms exist for determining whether desired Hamilton path exists [Itai, Papadimitriou, & Swarcfiter, 1982].

17
Grid graphs without holes (Solid grid graphs) Theorem [Umans & Lenhart, “Hamiltonian cycles in solid grid graphs,” FOCS 97, 496-507. HAMILTON CYCLE is polynomial-time solvable for solid grid graphs.

18
Rectangular Graphs with Edge Weights Goal: Find Hamilton cycle with smallest total edge weight. Conjecture: NP-hard for general rectangular graphs. Idea of potential proof: Pick up vertices in holes using forced Hamilton paths, setting weights to do the forcing. Theorem: For any fixed k, solvable in polynomial time for rectangular graphs of height no more than k.

19
Proof by Dynamic Programming (for Even k)

23
States (j,E j,P j ) of the Dynamic Program 1 2 3 4 … n 1.Pick a vertical gridline j, 1 ≤ j ≤ n, [n possibilities]. 2.Pick a subset E j of the grid segments on the gridline j [2 k-1 possibilities]. 3.Pick a set P j of disjoint pairs of gridpoints on gridline j, where each pair must be connected by a path lying entirely to the right of the gridline. 4.Total number of possibilities is hence O(n2 3k ) which is linear in n for fixed k (although exponential in k). j

24
Bounding the Possibilities for P j For each vertex on the chosen j th vertical gridline, let deg j (v) be the number of edges in in E j incident on v. If deg j (v) = 0, then tour edges leave v both to left and right and v must be in a pair. If deg j (v) = 1, then an edge must go left or right, a total of at most 2 k choices. If deg j (v) = 2, then v cannot be in any pair. Thus there are at most 2 k choices, given E j, each yielding a set of k’ ≤ k pair members and hence k’/2 ≤ k/2 pairs (if k’ is odd, then the state is infeasible). Because our grid is planar, the paths connecting the pairs cannot intersect, and so the pairs can be viewed as a set of k’/2 correctly-matched parentheses. ((())) ()(()) ()()() (())() (()())

25
Catalan Numbers The number of ways one can correctly nest n parentheses is called the Catalan number C n. Wikipedia currently has 5 different proofs that: This means there are at most O(2 k C k/2 ) = O(2 2k ) possibilities for the set P j.

26
States (j,E j,P j ) of the Dynamic Program 1 2 3 4 … n 1.Pick a vertical gridline j, 1 ≤ j ≤ n, [n possibilities]. 2.Pick a subset E j of the grid segments on the chosen gridline [2 k-1 possibilities]. 3.Pick a set of properly nested pairs P j [O(2 2k ) possibilities]. 4.Total number of possibilities is hence O(n2 3k ) which is linear in n for fixed k (although exponential in k). j

27
1 2 3 4 … nj Let G j be the grid graph from column 1 through column j, augmented by artificial edges connecting the pairs in P j and having cost 0. The value f(j,E j,P j ) is the minimum cost of a Hamilton circuit H for the G j subject to the constraint that H contains all the segments in E j and all the artificial edges connecting pairs in P j. The value is ∞ if no such H exists. Value f(j,E j,P j ) of State (j,E j,P j )

28
Basis for the Dynamic Program Only finite-cost states for j = 1.

29
Suppose we wish to compute f(j,E j,P j ) and we know the values f(j’,E j’,P j’ ) for all states with j’ = j-1. Consider all “consistent” subsets of the k horizontal grid segments and k-1 vertical grid segments on the left (at most 2 2k-1 possibilities). Take best sum of – The value of a state (j-1,S G’,S A’ ) induced in this way, plus – The total weight of horizontal grid segments in the consistent subset inducing that state, plus – The total weight of the vertical segments in S A. J-1 j Not Consistent Induction

30
Potentially Consistent J-1 j J-1 J-1 j Suppose we wish to compute f(j,E j,P j ) and we know the values f(j’,E j’,P j’ ) for all states with j’ = j-1. Consider all “consistent” subsets of the k horizontal grid segments and k-1 vertical grid segments on the left (at most 2 2k-1 possibilities). Take best sum of – The value of a state (j-1,S G’,S A’ ) induced in this way, plus – The total weight of horizontal grid segments in the consistent subset inducing that state, plus – The total weight of the vertical segments in S A.

31
Computing the Optimal Value Compute the values of f(n,E j,Φ) for all potentially consistant states (n, E j,Φ). Return the smallest value found. Total running Time = O(n2 3k 2 2k-1 k) = O(nk2 5k ). Probably much better in practice, although still exponential. nnnnn

32
Proof for Odd k Answer is ∞ if n is odd. Otherwise, we only have valid states for j = 2i, i = 1 ≤ i ≤ n/2. Hence we must proceed in steps of two grid columns rather than just one. A bit more complicated, but do-able.

33
TSP for Planar Weighted Graphs Solvable in time 2 O(sqrt(N)) by Divide-and-Conquer. (Recall our best general TSP algorithm takes time O(n 2 2 n )). Exploits 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. S B A ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ A S ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ B S ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂

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

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

36
Cases (E S,P S ) for Separator and its State. E S = subset of the edges linking vertices of the separator S to each other such that no vertex in S has more than two incident edges from E S, and no cycle is present in E S. For this case, the edges in E S must be in our tour. Note that |E S | ≤ 3|S|- 6 by Euler’s Formula. Thus there are less than 2 6sqrt(2N) possibilities for E S (probably far fewer because of the degree and cycle restrictions). P S is a set of pairs of vertices in S which must be connected by paths, all of whose vertices are in A ∪ S, or else all are in B ∪ S. ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂

37
An upper bound on the possibilities for P S For each v in S, let deg E (v) be the number of edges in E S that are incident on v and note that we must have deg E (v) in {0,1,2}. – If deg E (v) = 2, then v cannot be the endpoint of any path in A or B. – If deg E (v) = 1, then v can be the endpoint of one path, in either A or B. [2 possibilities] – If deg E (v) = 0, then v can be the endpoint of one path in one path in A and one path in B, or can be in the middle of a path on the A side, or can be in the middle of a path on the B side. [3 possibilities] Note that in a Hamilton circuit for G, the paths through any connected component X of A between distinct vertices in S must correspond to a parenthesization with at most floor(|S X |/2) pairs, where S X is the subset of S consisting of those members that are adjacent to a node in component X, and similarly for B. The worst-case count will occur when there is just one connected component.

38
The Possibilities for P S For each choice of E S, there are at most 3 |S| possibilities for the roles of the members of S. In choosing endpoints of paths, we can never have more than floor(S/2) possible pairs of members of S. Using our previous Catalan number analysis, this gives at most 2 |S| possibilities for nested pairs. Thus, given E S, we have no more than (3 |S| )(2 |S| ) possibilities, or no more than 2 (1+log(3)) sqrt(2N) Multiplying by the number of possibilities for E S, we get a total number of possibilities of 2 6sqrt(2N) 2 (1+log(3)) sqrt(2N) = 2 (7+log(3)) sqrt(2N) < 2 13 sqrt(N)

39
Running Time Induction Claim: We can solve the planar weighted TSP (with some edges fixed) in time O(2 α sqrt(N) ) for a constant α to be determined later. 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, if N ≤ 225, we solve the problem by exhaustive search (in large but constant time).

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

41
Gilmore-Gomory Distances Cities are pairs of rational numbers v i = (a i,b i ), 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 v i to city v j is (The area between a i and b j 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.

42
Example 1: f(x) = 1, g(x) = -1 – If b i ≤ a j, c ij = a j - b i, – Otherwise c ij = -|b i - a j |. Example 2 (Scheduling Application): – Each city i represents a job that must be started at temperature a i and will end at temperature b i. – Distance from city i to city j then represents the cost of raising (or lowering) the temperature from the ending temperature for job i to the starting temperature for job j. – A tour can be viewed as a schedule that starts with job 1 at temperature a 1, executes all the jobs, and then returns the system to temperature a 1 so it can go round again. – The constraint guarantees that one cannot gain money by going through a cycle.

43
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 v i (out) to v i (in) being c ij. – 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. The Algorithm ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂

44
Gilmore & Gomory’s Novel Ideas Simple, problem-specific method for finding the initial matching in time O(NlogN), as compared to the O(N 3 ) of our best algorithm for the general problem. Clever algorithm, exploiting minimum spanning trees and some extra, problem-specific magic, that finds a series of patches that yields the optimal tour.

45
Finding the Matching Index the cities so that b 1 ≤ b 2 ≤ … ≤ b N. By sorting, find a permutation π satisfying a π(1) ≤ a π(2) ≤ … ≤ a π(N). Our matching then can then be viewed as consisting of the pairs (v i,v π(i) ), 1 ≤ i ≤ N. Proof by an uncrossing argument.

46
Classical Uncrossing Argument Theorem: For a TSP in the plane under a metric that obeys the triangle inequality, there is always an optimal tour in which no two edges intersect each other in their interiors. ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ BA DC X By the triangle inequality, d(A,B) ≤ d(A,X) + d(X,B), and similarly, d(C,D) ≤ d(C,X) + d(X,D) Crossing gone at no increase in cost!

47
Uncrossing Argument for our Matching b2b2 b1b1 a π(1) bjbj bibi a π(2) a π(i) a π(j) Claimed Optimal Matching with Crossing

48
Case 1: Both Jobs Warming bjbj bibi a π(i) a π(j) Integral Ranges for f CrossedUncrossed Same cost whether crossed or uncrossed!

49
Case 2: One Job Warming, One Cooling bjbj bibi a π(i) a π(j) Integral Ranges for f and g CrossedUncrossed f g f g Original has an extra region of f+g, which is non-negative and so removing it cannot make things worse – uncrossed is at least as good!

50
Additional Cases There are additional cases, depending on whether b i is below a π(i) and so forth, but they all work more-or-less the same way. Consequently, the no-crossing matching is optimal, as claimed.

51
Finding the Patching The Gilmore-Gomory patching techniques starts by restricting patches simply to the “consecutive patches” that delete the arcs following i and i+1 for some i, 1 ≤ i ≤ N. This still suffices to the connect the graph – consider the sub-cycle whose largest city index i is smallest. Then i+1 must be in some other cycle which can be merged with our first one by the (i,i+1) patch. Let G be the graph whose vertices are the cycles, with an edge joining cycles C and C’ if there is some i such that i is in one and i+1 is in the other. The cost of such an edge is obtained by subtracting the original cost of the matching from the cost of the matching obtained by making the swap. More precisely it is (c i, π(i+1) + c i+1, π(i) ) - (c i, π(i) + c i+1, π(i+1) ) Construct a minimum spanning tree T for G. The patches we will use are the ones corresponding to the edges of T.

52
Ordering the Patches If none of the patches corresponding to tree edges overlap, then order doesn’t matter. However, suppose our patches are (1,2) and (2,3) in the following set of cycles. ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ 1 2 3 4 5 6 978 (1,2) (2,3) ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ 1 2 3 4 5 6 978 (1,2)

53
Ordering the Patches If none of the patches corresponding to tree edges overlap, then order doesn’t matter. However, suppose our patches are (1,2) and (2,3) in the following set of cycles. ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ 1 2 3 4 5 6 978 (1,2) (2,3) ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ ∂∂∂∂∂∂ 1 2 3 4 5 6 978 (1,2)

56
Disk Scheduling (Restricted) Locations of the fragments of a file one want to retrieve Distance between two fragments = time it takes to move the read head from the end of one to the beginning of the next, taking into account the spinning of the disk BUT NOTHING ELSE

Similar presentations

Presentation is loading. Please wait....

OK

Great Theoretical Ideas in Computer Science

Great Theoretical Ideas in Computer Science

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google

Eat before dentist appt on your birthday Ppt on ready to serve beverages images Ppt on depth first search tree Ppt on job evaluation examples Ppt on case study of infosys Ppt on 3g mobile technology Scrolling message display ppt online Ppt on landing gear system of an aircraft Ppt on articles of association form Ppt on pi in maths draw