Quadratic Speedup for NP-Complete Problems
In this chapter, we show how quantum search can assist in solving the Hamiltonian cycle problem.
The Hamiltonian cycle problem asks whether a given graph contains a cycle that visits each vertex exactly once. This problem belongs to the class of NP-complete problems. Solving it involves searching through all possible orderings of the graph’s vertices:
- Generate each possible ordering (v_{1}, ..., v_{n}) of the vertices. Repetitions are allowed to simplify the analysis without changing the essential result.
- For each ordering, check whether it forms a Hamiltonian cycle. If not, continue checking the remaining orderings.
Since there are n^n = 2^{n\log n} possible orderings, the classical algorithm requires 2^{n\log n} checks in the worst case.
How Quantum Search Speeds Up NP Problems
A quantum algorithm can accelerate this process by speeding up the search. We use the method in quantum counting to determine whether a solution to the search problem exists.
Let:
- n: the number of vertices in the graph
- m = \lceil \log n \rceil: the number of qubits needed to represent a single vertex index
To find a Hamiltonian cycle, we consider all sequences of n vertex labels, requiring nm qubits. The computational basis state can be written as:
where each |v_i\rangle is a string of m qubits.
The oracle for the search algorithm applies the transformation:
Given a description of the graph, we can construct a polynomial-size classical circuit that checks for Hamiltonian cycles. This circuit can be converted into a reversible one (still polynomial in size) that performs:
where f(v_1, ..., v_n) = 1 if the sequence is a Hamiltonian cycle, and 0 otherwise.
We initialize q to |1\rangle and apply a Hadamard gate to create the superposition state:
This phase kickback enables the oracle to mark solutions.
Using quantum counting, we can determine whether a Hamiltonian cycle exists using only O(2^{mn/2}) applications of the oracle — giving a quadratic speedup over brute-force search.
To summerize:
References
[1]. M. A. Nielsen and I. L. Chuang, Quantum Computation and Quantum Information, 10th Anniversary Ed., Cambridge: Cambridge University Press, 2010.