Lecture 25: Hamiltonian Cycle Problem
Hamiltonian Cycle Problem:
Given a graph G, is there “a path that visits each vertex once and return to the start,” i.e. a Hamiltonian Cycle?
Claim: “Hamiltonian Cycle is NP-complete.”
Proof: Hamiltonian Cycle is in NP because a given list of vertices can be checked for a tour in polynomial time. Now, we want to show that 3-SAT reduces to Hamiltonian Cycle in polynomial time. Thus, we need some way of mapping the variables and clauses to a hamiltonian cycle problem graph:

While this graph is complex at first, look at how it is built. For each variable, there is a row of at most 2n nodes, where n is the number of clauses. Two of these nodes are connected to each clause if the variable appears in that clause. The ends of each row of nodes are connected to the ends of the next. Walking left to right down a row means “true,” while right to left means “false.” In this way, a Hamiltonian cycle through the graph represents an assignment of truth values to the variables in a list of 3-SAT clauses.
Claim: “The 3-SAT boolean formula is satisfiable if and only if the graph has a hamiltonian cycle.”
Proof (=>): Assume the formula is satisfiable by some truth assignment. Choose one true term in each clause, traverse the graph moving across each variable’s path in the appropriate direction, and take a diversion to a clause node for each term chosen above. This path is a Hamiltonian cycle.
Proof (<=): Suppose there exists a Hamiltonian cycle c that traverses a variable’s row either left to right or right to left. Call one way true, and the other false. Ecah clause node is visited by a side-trip from a variable row. This variable corresponds to a true term in the clause.
External Links:
This entry was posted on Monday, March 28th, 2005 at 3:40 pm and is tagged with hamiltonian cycle problem, traveling salesman problem, polynomial time, truth assignment, true term, truth values, cycle c, side trip, 2n, clauses, vertex, graph, choose one, node, diversion, variables, np, lt. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback.
3 Responses to 'Lecture 25: Hamiltonian Cycle Problem'
Leave a Reply
Please take time to enjoy the archives: May 2005 (1) April 2005 (11) March 2005 (11) February 2005 (15) January 2005 (7)
Fresh, related resources:
- There were no results.
on January 26th, 2006 at 3:22 am
Since we know that Hamiltonian cycle problem is a Np-complete one to answer to P vs NP question, is there any algorithm which always finds the Hamiltonian cycle in polynomial time? If no, what are the nearest solutions and if I want to work on it where is the starting point?
Thanks
on January 26th, 2006 at 11:13 am
If we knew of a p-time solution for the Hamiltonian cycle we would have shown that P=NP, one of the great unsolved questions of our time. In fact, while not proven, most mathematicians believe P != NP, and that there is no polynomial algorithm for this. However, you can probably come up with a stochastic approximation or just run the naive algorithm on small sets.