Consider the following state for the 8-queens problem:
Discuss different representations of this problem as a CSP.
Why might we prefer one representation over another?
Bonus Challenge: Write a Prolog program to solve this puzzle.
Consider the following four algorithms applied to the task of searching through the space of bitstrings of length 20 to find the bitstring which maximizes a given fitness function:
For concreteness, let's assume that the GA has a population of 200, with 100 individuals replaced at each generation.
For each of the fitness functions listed below, which of the four algorithms would find the solution fastest? which would be slowest? or would two of them take about the same amount of time?
| 1. | f(x) = | the number of 1's in x. |
| 2. | f(x) = | 100, if x = 00000000000000000000, |
| 0, otherwise. | ||
| 3. | f(x) = | 100, if x = 00000000000000000000, |
| the number of 1's in x, otherwise. | ||
| 4. | f(x) = | 14, if x contains 7 consecutive 1's and 7 consecutive 0's, |
| 7, if x contains 7 consecutive 1's or 7 consecutive 0's, | ||
| 0, otherwise. |