Lecture Notes 2
description
Transcript of Lecture Notes 2
![Page 1: Lecture Notes 2](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814f0a550346895dbc9d5a/html5/thumbnails/1.jpg)
Lecture Notes 2
Prof. Dechter
ICS 270A
Winter 2003
![Page 2: Lecture Notes 2](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814f0a550346895dbc9d5a/html5/thumbnails/2.jpg)
Explicit Graph
![Page 3: Lecture Notes 2](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814f0a550346895dbc9d5a/html5/thumbnails/3.jpg)
Graph Theory
Sates: board configurations Operators: move-blank: up, down, right, left
(when possible)
![Page 4: Lecture Notes 2](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814f0a550346895dbc9d5a/html5/thumbnails/4.jpg)
Graph Theory (continued)
![Page 5: Lecture Notes 2](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814f0a550346895dbc9d5a/html5/thumbnails/5.jpg)
Breadth-First Search (BFS) Properties Solution Length: optimal Search Time: O(Bd) Memory Required: O(Bd) Drawback: require exponential space
1
3
7
15141312111098
4 5 6
2
![Page 6: Lecture Notes 2](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814f0a550346895dbc9d5a/html5/thumbnails/6.jpg)
Iterative Deepening (DFS)
Every iteration is a DFS with a depth cutoff.
Iterative deepening (ID)1. i = 1
2. While no solution, do
3. DFS from initial state S0 with cutoff i
4. If found goal, stop and return solution, else, increment cutoff
Comments: ID implements BFS with DFS Only one path in memory BFS at step i may need to keep 2i nodes in OPEN
![Page 7: Lecture Notes 2](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814f0a550346895dbc9d5a/html5/thumbnails/7.jpg)
Iterative Deepening (DFS)
Time:
2)1(
22
11
11)()(
b
nbnn
jb
jb bonT
BFS time is O(bn) B is the branching degree ID is asymptotically like BFS For b=10 d=5 d=cut-off DFS = 1+10+100,…,=111,111 IDS = 123,456 Ratio is
?
b
![Page 8: Lecture Notes 2](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814f0a550346895dbc9d5a/html5/thumbnails/8.jpg)
Bi-Directional Search
![Page 9: Lecture Notes 2](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814f0a550346895dbc9d5a/html5/thumbnails/9.jpg)
Bi-Directional Search (continued)
![Page 10: Lecture Notes 2](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814f0a550346895dbc9d5a/html5/thumbnails/10.jpg)
Breadth First Search
1. Put the start node s on OPEN.
2. If OPEN is empty exit with failure.
3. Remove the first node n from OPEN and place it on CLOSED.
4. If n is a goal node, exit successfully with the solution obtained by tracing back pointers from n to s.
5. Otherwise, expand n, generating all its successors attach to them pointer back to n, and put them at the end of OPEN
6. Go to step 2.
For shortest cost path:
5’. Otherwise, expand n, generating all its successors attach to them pointer back to n, put them at in OPEN and order OPEN based on shortest cost partial path.
![Page 11: Lecture Notes 2](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814f0a550346895dbc9d5a/html5/thumbnails/11.jpg)
Uniform Cost Search
Expand lowest-cost OPEN node (g(n)) In BFS g(n) = depth(n)
Requirement g(successor)(n)) g(n)
![Page 12: Lecture Notes 2](https://reader035.fdocuments.in/reader035/viewer/2022062409/56814f0a550346895dbc9d5a/html5/thumbnails/12.jpg)
Comparison of Algorithms