Examples of Decision Problems in NP
Hamiltonian Path
- Nondeterministic algorithm: guess a path v1,v2,…vn then check no two vertices are the same and that for each i < n there is an edge between vi and vi+1.
Graph Coloring
- input: Graph G = (V,E) and a number k.
- output: Determine if all vertices can be colored with k colors such that no two adjacent vertices have the same color.
- Algorithm: Guess a coloring and then check it.
-