Friday, August 7, 2020

Approximation Algorithm - Part 3 ( Traveling-Salesman Problem)

 

ยงProblem: A salesman must visits  n cities. Visiting each city exactly once and finishing at the city he starts from (Hamiltonian cycle). There is a non-negative cost c (i, j) to travel from the city i to city j.
ยงDefinition: Given a complete undirected graph G=(V, E) that has nonnegative integer cost  c(u, v) associated with each edge (u, v) in E, the problem is to find a hamiltonian cycle (tour) of G with minimum cost.
ยงGoal: Find a tour of minimum cost. We assume that every two cities are connected
ยงNP-Hard problem.
Triangle inequality
โ€ขThere are approximate algorithms to solve the problem though.
โ€ขThe approximate algorithms work only if the problem instance satisfies Triangle-Inequality.
โ€ขThe cost function satisfies the triangle inequality for all vertices u, v, w in V

c(u,w) <= c(u,v) + c(v,w)

โ€ขEssentially this means that it is no more costly to go directly from u to v than it would be to go between them via a third point w.

Approximate Algorithm TSP

Approx-TSP (G= (V, E))   

{  

  1. Compute a MST T of G;  

  2. Select any vertex r is the root of the tree;  

  3. Let L be the list of vertices visited in a preorder tree walk of T;  

  4. Return the Hamiltonian cycle H that visits the vertices in the order L;  

}  

Runtime is dominated by MST-PRIM, which is ฮ˜(V2 ).


Approximation Algorithm:  Returns a tour whose cost is never more than twice the cost of an optimal tour (2-approximation algorithm). 

TSP with Triangle Inequality

Step-1



Proof of the Approximation Ratio

ยงTheorem: APPROX-TSP is a polynomial-time 2-approximation for the traveling-salesman problem with the triangle inequality.
ยงConsider the optimal tour Hโˆ— and remove an arbitrary edge
ยงโ‡’ yields a spanning tree T , So,   c(T) โ‰ค c(Hโˆ—)


Let W be the full walk of the minimum spanning tree Tmin (including repeated visits)
 

A full walk is lists all vertices when they are first visited in preorder, it also lists vertices when they are returned after a sub-tree is visited in preorder. 

Full walk traverses every edge exactly twice, so,  c(W) = 2c(Tmin)

Full walk traverses every edge exactly twice, so     c(W) = 2c(Tmin) โ‰ค 2c(T) โ‰ค 2c(H โˆ— )


Full walk traverses every edge exactly twice, so             c(W) = 2c(Tmin) โ‰ค 2c(T) โ‰ค 2c(H โˆ— )

Deleting duplicate vertices from W yields a tour H.

โ€ขDeleting duplicate vertices from W yields a tour H with a smaller cost: c(H) โ‰ค c(W)


                                                        TSP without Triangle Inequality

ยงIf P โ‰  NP, then for any constant ฯโ‰ฅ1, there is no polynomial-time approximation algorithm with approximation ratio ฯ for the general traveling-salesman problem.

ยงSuppose to the contrary that there exists a polynomial-time algorithm A for pโ‰ฅ1.
ยงNow, use algorithm A to solve instance of HAM-CYCLE problem in polynomial-time. Since HAM-CYCLE problem is NP-complete then by theorem:

ยงIf any NP-complete problem is polynomial-time solvable, then P=NP. Equivalently, if any problem in NP is not polynomial-time solvable than no NP-complete problem is polynomial solvable.

ยงSolving HAM-CYCLE in polynomial-time implies that P=NP.

ยงSince the HAM-CYCLE is NP-complete and we assumed and we assumed that Pโ‰ NP, a contradiction arises.

ยงReduction

ยงLet G = (V, E) be an instance of the Hamiltonian cycle problem. We want to determine efficiently whether G contains a Hamiltonian cycle by making use of an algorithm A. We transform G into an instance of the TSP problem as follows:

ยงConsider a complete graph G`=(V, E`) where E` = {(u, v): u, v in V and uโ‰ v}. Assign an integer cost to each edge in E` as follows:
c(u,v) =  1                if (u, v) in E
P|V| + 1                   otherwise


Because algorithm A is guaranteed to return a tour of cost no more than P times the cost of an optimal tour, if graph G contains a Hamiltonian cycle, then A must return it. If G has no Hamiltonian cycle, then A returns a tour of cost more than P|V|. Therefore, we can use algorithm A to solve the Hamiltonian cycle problem in polynomial time and this is impossible unless P=NP 








No comments:

Post a Comment

How to Write Summary of a Research Paper

Paper Summary should contain the following points: What problem authorโ€™s solved? What are the motivations for that problem? Why is it import...