1 / 35

Approximation Algorithms for the Traveling Salesperson Problem

Approximation Algorithms for the Traveling Salesperson Problem. Approximation Algorithm. Up to now, the best algorithm for solving an NP-complete problem requires exponential time in the worst case. It is too time-consuming.

maitland
Download Presentation

Approximation Algorithms for the Traveling Salesperson Problem

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. Approximation Algorithms for the Traveling Salesperson Problem

  2. Approximation Algorithm • Up to now, the best algorithm for solving an NP-complete problem requires exponential time in the worst case. It is too time-consuming. • To reduce the time required for solving a problem, we can relax the problem, and obtain a feasible solution “close” to an optimal solution

  3. Approximation Algorithm

  4. Error Ratio Bound

  5. (1+)-approximation algorithm

  6. An approximation algorithm for Euclidean traveling salesperson problem (ETSP) • The ETSP is to find a shortest closed path through a set S of n points in the plane. • The ETSP is NP-hard.

  7. Approximation Algorithm for ETSP • Input: A set S of n points in the plane. • Output:An approximate traveling salesperson tour of S. • Step 1: Find a minimal spanning tree T of S. • Step 2: Find a minimal Euclidean weighted matching M on the set of vertices of odd degrees in T. Let G=M∪T. • Step 3: Find an Eulerian cycle of G and then traverse it to find a Hamiltonian cycle as an approximate tour of ETSP by bypassing all previously visited vertices.

  8. Eulerian Cycle • An Eulerian path (Eulerian trail, Euler walk) in a graph is a path that uses each edge precisely once. If such a path exists, the graph is called traversable. • An Eulerian cycle (Eulerian circuit, Euler tour) in a graph is a cycle with uses each edge precisely once. If such a cycle exists, the graph is called Eulerian.

  9. L. Euler showed that an Eulerian cycle exists if and only if all vertices in the graph are of even degree and all edges are contained in the same component. • L. Euler also showed an Eulerianpath exists, if and only if at most two vertices in the graph are of odd degree and all edges are contained in the same component.

  10. Leonhard Euler (April 15, 1707 - September 18, 1783) (pronounced "oiler") was a Swiss mathematician and physicist. He is considered (together with Gauss) to be the greatest mathematician ever. • Leonhard Euler stated and solved the problem of Seven Bridges of Königsberg in 1736, which is the first formally discussed problem in graph theory.

  11. Eulerian Cycle exists becausedegree(V1) = 4 degree(V2) = 2 degree(V3) = 4 degree(V4) = 4.

  12. This is the Eulerian Cycle.

  13. A Hamiltonian path (also called traceable path) is a path that visits each vertex exactly once. • A Hamiltonian cycle (also called Hamiltonian circuit, vertex tour or graph cycle) is a cycle that visits each vertex exactly once, except for the starting vertex.

  14. Minimal Euclidean Weighted Matching Problem • Given a set of points in the plane, the minimal Euclidean weighted matching problem is to join the points in pairs by line segments such that the total length is minimum.

  15. Approximation Algorithm for ETSP • E.g. Step1:

  16. Approximation Algorithm for ETSP • Step2:The number of points with odd degrees must be even. , which is even One edge contributes 2 degrees

  17. Approximation Algorithm for ETSP • Step3: P3 and P4 are visited twice. By bypassing P3 and P4 and connecting P6 to P1 directly, we obtain a Hamiltonian cycle.

  18. Approximation Algorithm for ETSP • Time complexity: O(n3) Step 1: O(nlogn) Step 2: O(n3) Step 3: O(n) • How close the approximate solution to an optimal solution?

  19. How good is the solution ? • The approximate tour is within 3/2 of the optimal one. • Reasoning: L: optimal ETSP tour, T: MST, Lp: a path derived by removing one edge from L (Lp is also a spanning tree)  length(T)length(Lp)length(L) • Let Lp=j1…i1j2…i2j3…i2m, where {i1, i2,…, i2m} is the set of odd-degree vertices in T where indices of vertices in the set are arranged in the same order as they are in the optimal ETSP tour L.

  20. How good is the solution ? Let M be the minimal Euclidean weighted matching. Consider the two matchings:M1={[i1,i2],[i3,i4],…,[i2m-1,i2m]} and M2={[i2,i3],[i4,i5],…,[i2m,i1]}. We have length(L) length(M1) + length(M2) (triangular inequality)  2 length(M )  length(M) 1/2 length(L ) G = T∪M  length(T) + length(M)  length(L) + 1/2 length(L) = 3/2 length(L)

  21. The Bottleneck Traveling Salesperson Problem (BTSP) • Minimize the longest edge of a tour. • This is a mini-max problem. • This problem is NP-hard. • The input data for this problem fulfill the following assumptions: • The graph is a complete graph. • All edges obey the triangular inequality rule.

  22. An Algorithm for Finding an Optimal Solution Step1: Sort all edges in G = (V,E) into a nondecreasing sequence |e1||e2|…|em|. Let G(ei) denote the subgraph obtained from G by deleting all edges longer than ei. Step2: i←1 Step3: If there exists a Hamiltonian cycle in G(ei), then this cycle is the solution; hence, stop. Step4: i←i+1. Go to Step 3.

  23. An Example for BTSP Algorithm • e.g. • There is a Hamiltonian cycle, A-B-D-C-E-F-G-A, in G(BD). • The optimal solution is 13.

  24. Time complexity of the algorithm • The Hamiltonian cycle problem is NP-hard. • The algorithm cannot be a polynomial one.

  25. Theorem for Hamiltonian Cycles • Def : The t-th power of G=(V,E), denoted as Gt=(V,Et), is a graph that an edge (u,v)Et if there is a path from u to v with at most t edges in G. • Theorem: If a graph G is bi-connected, then G2 has a Hamiltonian cycle.

  26. An Example for the Theorem G2 A Hamiltonian cycle: A-B-C-D-E-F-G-A

  27. An Approximation Algorithm for BTSP • Input: A complete graph G=(V,E) where all edges satisfy triangular inequality. • Output: A tour in G whose longest edge is not greater than twice of the value of an optimal solution to the special bottleneck traveling salesperson problem of G. Step 1: Sort the edges into |e1||e2|…|em|. Step 2: i := 1. Step 3: If G(ei) is bi-connected, construct G(ei)2, find a Hamiltonian cycle in G(ei)2 and return this as the output. Step 4: i := i + 1. Go to Step 3.

  28. An Example Add some more edges. Then it becomes bi-connected.

  29. A Hamiltonian cycle: A-G-F-E-D-C-B-A. • The longest edge: 16

  30. Time complexity • The algorithm is of polynomial time • The determination of bi-connectedness can be solved by polynomial algorithms. • If G is bi-connected, then there exists a polynomial algorithm to solve the Hamiltonian cycle problem of G2.

  31. How Good is the Solution ? • The value of an approximate solution is bounded by two times that of an optimal solution. • Reasoning: A Hamiltonian cycle is bi-connected. eop: the longest edge of an optimal solution G(ei): the first bi-connected graph |ei||eop| The length of the longest edge in G(ei)22|ei| (triangular inequality) 2|eop|

More Related