CS486/686 Lecture Slides (c) 2009 K. Larson and P.Poupart
1
1 CS486/686 Lecture Slides (c) 2009 K. Larson and P.Poupart 2 - - PowerPoint PPT Presentation
1 CS486/686 Lecture Slides (c) 2009 K. Larson and P.Poupart 2 CS486/686 Lecture Slides (c) 2009 K. Larson and P.Poupart Solving Problems by Searching CS486/686 University of Waterloo Sept 17, 2009 3 CS486/686 Lecture Slides (c) 2009 K.
CS486/686 Lecture Slides (c) 2009 K. Larson and P.Poupart
1
CS486/686 Lecture Slides (c) 2009 K. Larson and P.Poupart
2
CS486/686 Lecture Slides (c) 2009 K. Larson and P.Poupart
3
CS486/686 Lecture Slides (c) 2009 K. Larson and P.Poupart
4
CS486/686 Lecture Slides (c) 2009 K. Larson and P.Poupart
5
CS486/686 Lecture Slides (c) 2009 K. Larson and P.Poupart
6
CS486/686 Lecture Slides (c) 2009 K. Larson and P.Poupart
7
Giurgiu Urziceni Hirsova Eforie Neamt Oradea Zerind Arad Timisoara Lugoj Mehadia Dobreta Craiova Sibiu Fagaras Pitesti Vaslui Iasi Rimnicu Vilcea Bucharest 71 75 118 111 70 75 120 151 140 99 80 97 101 211 138 146 85 90 98 142 92 87 86
Start End Formulate Goal Get to Bucharest Formulate Problem Initial state: In(Arad) Actions: Drive between cities Goal Test: In(Bucharest)? Path cost: Distance between cities Find a solution Sequence of cities: Arad, Sibiu, Fagaras, Bucharest
CS486/686 Lecture Slides (c) 2009 K. Larson and P.Poupart
8
2
Start State Goal State
1 3 4 6 7 5 1 2 3 4 6 7 8 5 8
States: Locations of 8 tiles and blank Initial State: Any state Succ Func: Generates legal states that result from trying 4 actions (blank up, down, left, right) Goal test: Does state match desired configuration Path cost: Number of steps States: Arrangement of 0 to 8 queens on the board Initial State: No queens on the board Succ Func: Add a queen to an empty space Goal test: 8 queens on board, none attacked Path cost: none
CS486/686 Lecture Slides (c) 2009 K. Larson and P.Poupart
9
CS486/686 Lecture Slides (c) 2009 K. Larson and P.Poupart
10
CS486/686 Lecture Slides (c) 2009 K. Larson and P.Poupart
11
Games against an adversary Chance Infinite number of states Hidden states All of the above
CS486/686 Lecture Slides (c) 2009 K. Larson and P.Poupart
12
CS486/686 Lecture Slides (c) 2009 K. Larson and P.Poupart
13
1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8
Node
PARENT− NODE STATE P COST
ATH−
= 6 DEPTH = 6 ACTION = right
CS486/686 Lecture Slides (c) 2009 K. Larson and P.Poupart
14
(a) The initial state (b) After expanding Arad (c) After expanding Sibiu
Rimnicu Vilcea
Lugoj Arad Fagaras Oradea Arad Arad Oradea
Rimnicu Vilcea
Lugoj Zerind Sibiu Arad Fagaras Oradea Timisoara Arad Arad Oradea Lugoj Arad Arad Oradea Zerind Arad Sibiu Timisoara Arad
Rimnicu Vilcea
Zerind Arad Sibiu Arad Fagaras Oradea Timisoara
CS486/686 Lecture Slides (c) 2009 K. Larson and P.Poupart
15
CS486/686 Lecture Slides (c) 2009 K. Larson and P.Poupart
16
CS486/686 Lecture Slides (c) 2009 K. Larson and P.Poupart
17
A B C D E F G A B C D E F G A B C D E F G A B C D E F G
CS486/686 Lecture Slides (c) 2009 K. Larson and P.Poupart
18
CS486/686 Lecture Slides (c) 2009 K. Larson and P.Poupart
19
CS486/686 Lecture Slides (c) 2009 K. Larson and P.Poupart
20
– Instead of expanding shallowest node it expands the node with lowest path cost – Implemented using a priority queue
Optim al Yes Com plete if ε > 0 Tim e: O(bceiling(C* / ε )) Space: O(bceiling(C* / ε ))
C* is cost of
solution
minimum action cost
CS486/686 Lecture Slides (c) 2009 K. Larson and P.Poupart
21
CS486/686 Lecture Slides (c) 2009 K. Larson and P.Poupart
22
CS486/686 Lecture Slides (c) 2009 K. Larson and P.Poupart
23
CS486/686 Lecture Slides (c) 2009 K. Larson and P.Poupart
24
CS486/686 Lecture Slides (c) 2009 K. Larson and P.Poupart
25
CS486/686 Lecture Slides (c) 2009 K. Larson and P.Poupart
26
CS486/686 Lecture Slides (c) 2009 K. Larson and P.Poupart
27
CS486/686 Lecture Slides (c) 2009 K. Larson and P.Poupart
28
CS486/686 Lecture Slides (c) 2009 K. Larson and P.Poupart
29
CS486/686 Lecture Slides (c) 2009 K. Larson and P.Poupart
30
CS486/686 Lecture Slides (c) 2009 K. Larson and P.Poupart
31
– Assume no knowledge about the problem (general but expensive) – Mainly differ in the order in which they consider the states
No O(bl) O(bl) No DLS Yes No Yes Yes Optimal O(bd) O(bm) O(bceiling(C*/ε)) O(bd) Space O(bd) O(bm) O(bceiling(C*/ε)) O(bd) Time Yes No Yes Yes Complete IDS DFS Uniform BFS Criteria
CS486/686 Lecture Slides (c) 2009 K. Larson and P.Poupart
32
CS486/686 Lecture Slides (c) 2009 K. Larson and P.Poupart
33