Hints to Exercises 12.1
1. a. Resume the algorithm by backtracking from the first solution’s leaf.
b. How can you get the second solution from the first one by exploit-
ing a symmetry of the board?
To make your comparison with an exhaustive-search algorithm easier, you
may consider the version that finds all the solutions to the problem with-
out taking advantage of the symmetries of the board. Also note that an
exhaustive-search algorithm can try either all placements of queens on
distinct squares of the ×board, or only placements of the queens in
different rows, or only placements in different rows and different columns.
b. Although it is interesting to see how accurate such an estimate is for a
single random path, you would want to compute the average of several of
them to get a reasonably accurate estimate of the tree size.
7. This application of backtracking is quite straightforward.
8. a. Another instance of this problem is solved in the section.
b. Some of the nodes will be deemed promising when, in fact, they are
not.
3