File tree Expand file tree Collapse file tree 1 file changed +2
-0
lines changed
src/examples/source-3-non-det Expand file tree Collapse file tree 1 file changed +2
-0
lines changed Original file line number Diff line number Diff line change 11/*
22 SICP JS Exercise 4.35
3+
34 This file contains two solutions for the n-queens puzzle using non-determinism.
45 Each of them makes use of the generate-and-test paradigm.
56 The first (queens_slow) uses non-determinism for generating both the row and column
67 for each position. It does so in an optimized manner, testing the corresponding condition
78 as soon as the choice is generated, thereby reducing the search space. However, this is not
89 enough to yield a quick solution when N = 8.
910 This solution also gives repeated solutions (i.e different permutations that have all the same positions) upon backtracking.
11+
1012 The second (queens_fast) uses non-determinism in picking only the row and not the column of each position, with the
1113 columns being fixed. This further reduces the search space, yielding a quick solution when N = 8.
1214*/
You can’t perform that action at this time.
0 commit comments