Explore modules

Algorithm X Exact Cover

Cover every constraint once while watching reversible search decisions.

Free theory article

Cover every constraint once while watching reversible search decisions.

Concept & interpretation

The exact cover problem requires finding a subset of rows in a binary matrix such that every column contains exactly one 1. Algorithm X is a straightforward recursive, nondeterministic, depth-first backtracking algorithm proposed by Donald Knuth to find all solutions to the exact cover problem.

Experiment

You can interactively observe the results of different configurations of the exact cover matrix and the column-picking rules.

  1. Open the Algorithm X Exact Cover module.
  2. Select Three covers in the Problem control to see a matrix with multiple exact covers.
  3. Change the Column rule to First column and observe that the number of solutions remains the same, though the traversal order changes.
Read the full free theory article