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

Given a multi-undirected graph, how can I find the number of different paths from Node A to B using every node in the graph (means shortest path algorithms are useless)

In some cases there may be no way to achieve this. I am looking for the number of available different paths.

Note: You have to use every node and use them once.

share|cite|improve this question
This is surely NP-Hard. Hamiltonian Path can easily be reduced to it. – Aryabhata Dec 15 '10 at 3:33
up vote 3 down vote accepted

This problem is #P-complete. Informally, that essentially means that the best you can do is try every possible path.

See for a more complete discussion of this problem.

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.