Unit-9: Introduction To NP-: Completeness
Unit-9: Introduction To NP-: Completeness
Unit-9: Introduction To NP-: Completeness
GTU # 3150703
Unit-9:
Introduction to NP-
Completeness
In other words, by "reducing" solving problem A to solving problem B, we use the "easiness" of
B to prove the "easiness" of A.
Dr. Gopi Sanghani #3150703 (ADA) Unit 9 –Introduction to NP-Completeness 12
NP Hard Problems
Hamiltonian Cycles
Hamiltonian Path in an undirected graph is a path that visits each vertex exactly once.
A Hamiltonian cycle (or Hamiltonian circuit) is a Hamiltonian Path such that there is an edge (in
the graph) from the last vertex to the first vertex of the Hamiltonian Path.
1 2 3 4
The graph has Hamiltonian cycles:
1, 3, 4, 5, 6, 7, 8, 2, 1 and 1, 2, 8, 7, 6, 5, 4, 3, 1.
8 7 6 5
Given a list of vertices and to check whether it forms a Hamiltonian cycle or not:
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.