Dancing MODEL Links: Part IV(a) - eXploring the Search Tree

a search tree in a natural way, with the original problem at the root and with level k containing each subalgorithm that corresponds to k chosen rows

He also shows a search tree for another problem (the Pentamino), also an "exact cover" problem:

The search tree made sense... once I rotated it 90 degrees counter-clockwise. Consider this 2x2 matrix:

A B -- columns
- -
1 0 -- row 1
1 1 -- row 2

So the rotated search tree has that 2x2 matrix (above) as the root (leftside, below). The first level (middle column) just represents looping through the "A" column's rows. The second level (rightmost column) is the "B" column's rows.

So, I visualize this as like a Pac-Man game. Pac-Man eats the pellets (nodes in the search tree) moving "rightward". When he gets to the end of a row, he backtracks... until he can drop "down" (the next row in the column) and move rightward. The game's over when he has eaten all the pellets.

Because of a spare matrix is used for algorithm X, it's not strictly true that column A is always the first level, B always the second, etc. But it's an easy conceptual jump to say that the first level is the iteration over the first column's values. The second level is the iteration over the next submatrix's first column, etc.

Disclaimer: Blog contents express the viewpoints of their independent authors and
are not reviewed for correctness or accuracy by
Toolbox for IT. Any opinions, comments, solutions or other commentary
expressed by blog authors are not endorsed or recommended by
Toolbox for IT
or any vendor. If you feel a blog entry is inappropriate,
click here to notify
Toolbox for IT.