Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is finding a hamiltonian cycle as hard as determining if one exists? Can a hamiltonian cycle be found in polynomial time given an oracle for detecting hamiltonian cycles?

share|cite|improve this question
up vote 7 down vote accepted

Assume you have a method to detect whether or not a graph $G$ with $v$ vertices and $e$ edges has a Hamiltonian cycle in time $p(v,e)$ for some polynomial $p$. The following method then actually finds such a cycle:

For each edge: Remove the edge; check if the graph is still Hamiltonian; if not, add the edge back, otherwise leave it deleted. Once we have treated all edges, a cycle remains.

This makes $e$ tests of time $\le p(v,e)$ each, hence the time is $\le e\cdot p(v,e)$ and still polynomial.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.