0

I just newly started looking into computational complexity.

Since we don’t know if P = NP, we would like to have a way of saying “This problem is in NP and is really hard unless P = NP.”

This is made more formal by the notion of NP-completeness.

Therefore, we say a problem A is NP-complete if

(a) it is in NP, and (b) every problem B in NP is polynomial-time reducible to A.

Using a graph $G$ and an edge $e$ in $G$ as an example, how do I determine whether or not there is a Hamiltonian cycle that includes $e$?

With this, I could show that the problem is NP-complete and use the same approach for similar problems.

Mike
  • 33
  • 4

2 Answers2

1

There is no known efficient way to determine whether or not there is a Hamiltonian cycle that includes $e$. That is a NP-complete problem. (If you could determine that, you could use that as a subroutine to test whether the graph contains any Hamiltonian cycle, and even to find a Hamiltonian cycle if one exists; so it's not reasonable to expect there to be an efficient algorithm to do that.)

D.W.
  • 159,275
  • 20
  • 227
  • 470
  • @ D.W. True...How do I then simply prove that the problem I used as an example is an NP-complete problem? – Mike Dec 01 '22 at 00:03
  • @Mike, via a reduction - see https://cs.stackexchange.com/q/11209/755, https://cs.stackexchange.com/q/1240/755, https://cs.stackexchange.com/q/9556/755 – D.W. Dec 01 '22 at 01:27
  • Many thanks! I would look through – Mike Dec 01 '22 at 01:31
0

A problem is in NP if every instance with the answer “yes” can be solved in polynomial time if you get a clever hint.

A problem X is NP complete if it is in NP (and not harder), and some NP-complete problem can be solved by solving X. That means if I take an instance Y of this other NP-complete problem then I can construct a problem X so a solution of X allows me to solve Y. That doesn’t require that X is easy to solve.

gnasher729
  • 29,996
  • 34
  • 54