This chapter introduces two classic problems in computational complexity theory:
Hamiltonian Cycle (HC)
Traveling Salesman Problem (TSP)
They have three important implications:
Both are representative NP-Complete / NP-Hard problems.
Both are very "intuitive," but fundamentally extremely difficult.
They serve as the theoretical foundation and starting point for subsequent approximation algorithms.
Given an undirected graph
We focus on the decision problem: Hamiltonian Cycle Problem
Given graph G, does a Hamiltonian Cycle exist? **
This is a standard YES/NO question, preparing for the subsequent discussion on NP-completeness.
This problem is quite simple; proving membership in NP is usually not difficult.
Certificate: If a Hamiltonian Cycle exists in the graph, the certificate can be a sequence of vertices
Certifier: Check the following:
Does the sequence contain all vertices without repetition?
For any adjacent pair
Does an edge exist between
These checks can all be completed in polynomial time.
This is a core conclusion, and the construction in this part is quite complex.
We choose to use the Vertex Cover problem for reduction.
Vertex Cover:
Given a graph
and an integer , does there exist a set of vertices of size such that every edge has at least one endpoint in the set?
The core idea of the reduction is:
Transforming the choice of "selecting vertices to cover edges"
into "the Hamiltonian Cycle must pass through the gadget in a certain way"
In other words: Does a Hamiltonian Cycle exist ⇔ Does a valid Vertex Cover exist?
The lecture slides (570) use a set of complex gadgets; we won't copy them verbatim here, but explain why this design is effective. |
|
|
|---|---|
The intuition can be summarized in three points:
Each edge corresponds to a structure: The way the Hamiltonian Cycle passes through this structure is equivalent to "which endpoint is chosen to cover this edge."
Vertex selection is restricted: Through selector vertices, it is enforced that at most k "covering decisions" can be made.
The Hamiltonian Cycle must cover all gadgets: No gadget can be skipped, otherwise a complete cycle cannot be formed.
Therefore:
If a vertex cover of size ≤ k exists → a Hamiltonian Cycle can be constructed.
If a Hamiltonian Cycle exists → a vertex cover can be deduced.
Conclusion: Hamiltonian Cycle is NP-Complete
Optimization version of TSP:
Find the shortest path that visits every city once and returns to the starting point.
However, the NP-completeness discussion only concerns the decision version:
TSP (Decision Version) Given a weighted complete graph and a threshold D, does there exist a tour whose total weight is ≤ D?
Certificate: A permutation of cities (tour)
Certifier:
Check if every city is visited once
Calculate the total path length and check if it is ≤ D
All steps can be completed in polynomial time.
Therefore: TSP ∈ NP
This is all very simple.
The lecture slides from course 570 use a very classic and elegant construction. Given a graph
If
If
And set the threshold:
At this point:
If the original graph has a Hamiltonian Cycle → the total cost of this cycle in the new graph = |V| → TSP answers YES
If there is no Hamiltonian Cycle → any tour contains at least one edge with weight 2 → total weight > |V| → TSP answers NO
Therefore:
Hamiltonian Cycle ≤ₚ TSP
So TSP is NP-Complete
Metric TSP requires edge weights to satisfy the triangle inequality:
This fundamentally changes the problem structure.

The algorithm idea in the lecture slides:
Calculate the Minimum Spanning Tree (MST)
Perform a preorder traversal of the MST
Use the triangle inequality shortcut to handle repeated nodes
Conclusion: Metric TSP has a 2-approximation algorithm
The key conclusion is:
If General TSP has a constant approximation algorithm ⇒ Hamiltonian Cycle can be solved in polynomial time ⇒ implies P = NP
Therefore:
General TSP does not have any constant factor approximation algorithm (unless P=NP)
And this is the essential difference between Metric TSP and General TSP.