Professional Documents
Culture Documents
Search
o Uninformed search:
BFS, UCS, DFS, Depth-limited, Iterative Deepening depth-first search
§ How to perform: search order criteria
§ Evaluation: criteria
b: maximum branching factor of the
Criterion BFS UCS DFS
search tree
d: depth of the least-cost solution
Complete? Y(i) Y(ii) N
m: maximum depth of the state
Optimal? Y Y N space (may be ∞)
i: complete if b is finite;
Time O(bd) O(b1+[C*/ε]) O(bm) ii: complete if step costs ≥ ε
(positive ε)
Space O(bd) O(b1+[C*/ε]) O(bm)
o Heuristic search:
v Greedy best-first search:
Always expand node with lowest h-value
v A*:
§ f = g + h
§ Properties:
o Admissibility: h <= h* (optimistic)
o Monotonicity: h(n1) <= c(n1,n2) + h(n2) (triangle inequality)
o Simple proof: i.e. f value non-decreasing, etc.
Example:
Trace the execution of A* for the graph shown below.
A: 9 G: 3
B: 4 H: 5
C: 5 I: 8
D: 7 J: 2
E: 3 K: 0
F: 10 L: 7
3+8=11
I
2+3=5
1+4=4
E
3+2=5
B
J
0+9=9
A
2+3=5
K
4+0=4
1+5=6
G
C
3+5=8
3+7=10
H
L
2+7=9
D
3+10=13
F
CSP
o Problem formalization:
§ Variables: definition
§ Domain: possible values
§ Set of constraints (variable scopes): Binary/higher-order constraints
Example: Sudoku
§ Variables: V11, V12, …, V21, V22, …, V91, …, V99
§ Domains:
o Dom[Vij] = {1-9} for empty cells
o Dom[Vij] = {k} a fixed value k for filled cells.
§ Constraints:
o Row constraints:
§ All-Diff(V11, V12, V13, …, V19)
§ All-Diff(V21, V22, V23, …, V29)
§ ...., All-Diff(V91, V92, …, V99)
o Column Constraints:
§ All-Diff(V11, V21, V31, …, V91)
§ All-Diff(V21, V22, V13, …, V92)
§ ...., All-Diff(V19, V29, …, V99)
o Sub-Square Constraints:
§ All-Diff(V11, V12, V13, V21, V22, V23, V31, V32, V33)
§ All-Diff(V14, V15, V16,…, V34, V35, V36)