If you want to include these, you can take the approach described immediately following your quoted paragraph from Knuth’s paper: “A generalized cover problem can be converted to an equivalent exact cover problem if we simply append one row for each secondary column, containing a single 1 in that column.”

]]>[0, 1, 0]

[0, 0, 1]

[1, 0, 0]

[1, 1, 0]

[0, 1, 1]

[1, 1, 1]

the sets of rows that result in an exact cover (all columns having at most one 1) are:

[0, 1, 2], [1, 3], [2, 4], and [5]

However, the details regarding the secondary columns is a bit vague. From what I could gather from various Knuth/non-Knuth resources, it says that all you need to do is:

” The only difference is that we initialize the data structure by making

a circular list of the column headers for the primary columns only. The header for each

secondary column should have L and R fields that simply point to itself. The remainder

of the algorithm proceeds exactly as before, so we will still call it algorithm DLX.”

After making these changes to how the matrix is represented and then setting the first column as a secondary column (columns 2 and 3 are primary), I end up with the following sets of rows as solutions:

[0, 1], [1, 3], [4], and [5]

While all of these are valid solutions and some overlap with exact the exact cover solutions, it appears that other solutions are missing (i.e., some of those from the exact cover solution set):

[0, 1, 2] and [2, 4]

Perhaps this is a misunderstanding on my part but am I missing something conceptually or is Knuth’s explanation incomplete?

]]>There are other puzzles for which there are exactly two solutions; one that seems particularly challenging is (1,4,5,6).

]]>The solution is (4 – (4/7)) * 7

It requires quite a bit of thinking. ]]>