Subset dynamic programming for a Hamiltonian path

ID: subset-dynamic-programming-for-a-hamiltonian-path

For a directed graph with adjacency matrix , let record whether a path visits precisely the vertices of once and ends at . The singleton states are true. A larger state is true exactly when some predecessor has a true state for and an edge to . Removing or adjoining the last edge proves this recurrence by mathematical induction on . There are states, each requiring at most predecessor checks, giving time and storage. A true state for certifies a Hamiltonian path.

New to topics? Read the docs here!