






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A review of np completeness, focusing on reductions and the concepts of np-hard and np-complete problems. It includes examples of reducing the directed hamiltonian cycle problem to the undirected hamiltonian cycle problem and proving the undirected hamiltonian cycle problem is np-complete. Additionally, it discusses the relationship between the hamiltonian cycle problem and the traveling salesman problem (tsp), and why the tsp is np-complete.
Typology: Slides
1 / 12
This page cannot be seen from the preview
Don't miss anything!







Homework 7
■ Change in grading policy: drop lowest hw
Review: Reduction
■ This rephrasing is called a transformation
Review: NP-Hard and NP-Complete
■ If all problems R ∈ NP are reducible to P, then P is NP-Hard ■ We say P is NP-Complete if P is NP-Hard and P ∈ NP
Directed Hamiltonian Cycle ⇒ Undirected Hamiltonian Cycle
■ Which variant am I proving NP-Complete?
■ What transformation do I need to effect?
Transformation: Directed ⇒ Undirected Ham. Cycle
■ Every vertex v in V transforms into 3 vertices v^1 , v^2 , v^3 in V’ with edges ( v^1 , v^2 ) and ( v^2 , v^3 ) in E’ ■ Every directed edge ( v , w ) in E transforms into the undirected edge ( v^3 , w^1 ) in E’ (draw it) ■ Can this be implemented in polynomial time? ■ Argue that a directed hamiltonian cycle in G implies an undirected hamiltonian cycle in G’ ■ Argue that an undirected hamiltonian cycle in G’ implies a directed hamiltonian cycle in G
Hamiltonian Cycle ⇒ TSP
■ Optimization variant: a salesman must travel to n cities, visiting each city exactly once and finishing where he begins. How to minimize travel time? ■ Model as complete graph with cost c( i,j ) to go from city i to city j
■ A: ask if ∃ a TSP with cost < k
Hamiltonian Cycle ⇒ TSP
■ Prove that TSP ∈ NP ( Argue this ) ■ Reduce the undirected hamiltonian cycle problem to the TSP ○ So if we had a TSP-solver, we could use it to solve the hamilitonian cycle problem in polynomial time ○ How can we transform an instance of the hamiltonian cycle problem to an instance of the TSP? ○ Can we do this in polynomial time?