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

Finding the longest path in a graph is intractable problem. Th decision version is $NP$-complete. However, Given a graph, Is there an efficient algorithm to determine the parity of the longest path in a graph?

The algorithm should output YES if the length of the longest path is even otherwise the output is NO. Also, What is the complexity if we restrict the input to cubic graphs?

share|cite|improve this question
cross posted on TCS stack exchange.… – Mohammad Al-Turkistany Sep 13 '11 at 16:44
up vote 12 down vote accepted

Seems to me there's an easy reduction from the problem of hamiltonian path: Give a graph G you want to determine if it contains a hamiltonian path or not, simply add a disjoint path of length equal to the length of the expected hamiltonian path minus 1. Now check the parity and see if it equals that of the path you added or not.

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.