A Hamiltonian cycle of an undirected graph G = (V, E) is a simple cycle that contains each vertex in V only once. A Hamiltonian path of an undirected graph G = (V, E) is a simple path that contains each vertex in V only once. Let Ham-Cycle = { : there is a Hamiltonian cycle between u and v in graph G} and Ham-Path = {< G, u, v>: there is a Hamiltonian path between u and v in graph G}. Prove that Ham-Path is NP-hard using the reduction technique, i.e. find a known NP-complete

icon
Related questions
Question

A Hamiltonian cycle of an undirected graph G = (V, E) is a simple cycle that contains each vertex in V
only once. A Hamiltonian path of an undirected graph G = (V, E) is a simple path that contains each vertex
in V only once.

Let Ham-Cycle = {<G, u, v> : there is a Hamiltonian cycle between u and v in graph G} and
Ham-Path = {< G, u, v>: there is a Hamiltonian path between u and v in graph G}.

Prove that Ham-Path is NP-hard using the reduction technique, i.e. find a known NP-complete
problem L ≤p Ham-Path (reduce from the Ham-Cycle problem). Make sure to give the following
details:

1) Describe an algorithm to compute a function f mapping every instance of L to an instance of Ham-Path

2) Prove that x ∈ L if and only if f(x) ∈ Ham-Path

3) Show that f runs in polynomial time

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer