|
@@ -29,11 +29,12 @@ The problem can be formulated defining the following five elements:
|
|
|
1. The __initial state__: a description of the initial situation of the problem
|
|
|
2. __Actions__ (s) = {actions that are applicable is s} Return the legal moves from the state s.
|
|
|
|
|
|
- The state s<sub>0</sub> is
|
|
|
- 7|2|3
|
|
|
- ---|---|---
|
|
|
- 1|4|8
|
|
|
-6|5|
|
|
|
+The state s<sub>0</sub> is
|
|
|
+
|
|
|
+|7|2|3|
|
|
|
+|---|---|---|
|
|
|
+|1|4|8|
|
|
|
+|6|5|4|
|
|
|
|
|
|
Actions(s<sub>0</sub>)={$\leftarrow,\uparrow$}
|
|
|
3. __Result__ (s,a) = s' have the chosen move as argument and returns the new state.
|
|
@@ -71,16 +72,18 @@ The __optimal solution__ is the solution with *minimum* path cost.
|
|
|
Our model is limited to the relevant aspects of the problem, for example it doesn't comprehend the color of the tiles in the 8 puzzle.
|
|
|
|
|
|
### The 8 queens problem
|
|
|
--|1|2|3|4|5|6|7|8
|
|
|
----|---|---|---|---|---|---|---|---
|
|
|
-1|Q
|
|
|
-2|
|
|
|
-3|
|
|
|
-4|||||||Q
|
|
|
-5|
|
|
|
-6|
|
|
|
-7|
|
|
|
-8|
|
|
|
+
|
|
|
+|-|1|2|3|4|5|6|7|8|
|
|
|
+|---|---|---|---|---|---|---|---|---|
|
|
|
+|1|Q||||||||
|
|
|
+|2|||||||||
|
|
|
+|3|||||||||
|
|
|
+|4|||||||Q||
|
|
|
+|5||||||||||
|
|
|
+|6||||||||||
|
|
|
+|7||||||||||
|
|
|
+|8||||||||||
|
|
|
+
|
|
|
We have to place the 8 queens so that no two queens are in the same row, column or diagonal.
|
|
|
#### first problem formulation:
|
|
|
1. initial state: empty board
|