Knuth's Algorithm X - Wikipedia