I'm trying to learn Complexity classes.I want to show Hamiltonian cycle is NP Complete.
The text tells me that
Inorder to prove NP-Completeness we first show it belongs to NP,by taking a certificate. The certificate is a set of N vertices making up the Hamiltonian cycle.The verification algorithm then checks if there is an edge between each of these vertices.It can be done in polynomial time.
My question is how can we say that the verification algorithm completes in polynomial time and if it does then how does it prove Ham cycle belongs to NP.
I lack perspective,can anyone explain this in simple terms.
A language is in NP if a proposed solution can be verified in polynomial time. In this case a proposed solution is simply a listing of the vertices in the order they appear in the claimed cycle. This list is the so-called certificate.
To check if this list is actually a solution to the Hamiltonian cycle problem, one counts the vertices to make sure they are all there, then checks that each is connected to the next by an edge, and that the last is connected to the first.
This takes time proportional to $n$, because there are $n$ vertices to count and $n$ edges to check. $n$ is a polynomial, so the check runs in polynomial time.
Note that this only shows that Hamiltonian Cycle is in NP, not that it is NP-complete.