1 / 28

Artificial Intelligence Tutorials

Artificial Intelligence Tutorials. Tutorial # 3. Q1.1. Describe a heuristic estimating function that will make A* search behave exactly like uniform-cost search for a given cost function. Q1.1 – When A* search Like UCS. We know: A* expands nodes with minimal f(n) = g(n) + h(n).

clott
Download Presentation

Artificial Intelligence Tutorials

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Artificial Intelligence Tutorials

  2. Tutorial # 3

  3. Q1.1 Describe a heuristic estimating function that will make A* search behave exactly like uniform-cost search for a given cost function.

  4. Q1.1 – When A* search Like UCS • We know: • A* expands nodes with minimal f(n) = g(n) + h(n). • UCS expands nodes with minimal path cost g(n). • Then: • For h(n) = 0 or constant  A* Expands nodes with minimal path cost g(n)  i.e. A* behave like UCS.

  5. Q1.2 Describe a heuristic estimating function that will make greedy search behave like breadth-first search.

  6. Q1.2 – When Greedy search Like BFS • We know: • Greedy search expand nodes with minimal h(n). • Then, If h(n) = d(n) where d(n) is the depth of node n: • Nodes will be expanded according to increasing values of depth  i.e. the shallowest before the deepest  i.e. like BFS.

  7. Q2 proof that If h(n) is consistent, then the values of f(n) along any path are non-decreasing.

  8. Q2 - h(n) consistent : f(n) non-decreasing. • We know in A*: • F(n) = g(n) + h(n) • If n’ successor of n  g(n’) = g(n) + c(n,a,n’) • if h(n) consistent  h(n) < c(n,a,n’) + h(n’). • Then: • F(n’) = g(n’) + h(n’) • F(n’) = g(n) + c(n,a,n’) + h(n’) • F(n’) = g(n) + c(n,a,n’) + h(n’) >= g(n) + h(n) • F(n’) >= F(n)  i.e. nodes expanding is non-decreasing order of [f(n)].

  9. Q3 Trace BFS, DFS, IDS and UCS …

  10. BFS • Final Closed List [A B C D E] • Solution path A B D G • Order of node expansion A B C A C D A B D E B C G

  11. DFS • Final Closed List [A B C D] • Solution path A B C D G • Order of node expansion A B A C A B D B C G

  12. IDS • D=0 • Final Closed List [A] • Solution Failure • Order of node expansion A • D=1 • Final Closed List [ABC] • Solution Failure • Order of node expansion A B C

  13. IDS cont • D=2 • Final Closed List [ABCDE] • Solution Failure • Order of node expansion A B A C D C A B D E • D=3 • Final Closed List [ABCD] • Solution pathA B C D G • Order of node expansion A B A C A B D B C G

  14. UCS • Final Closed List [A0 C2 B5 D5 E5] • Solution path [A0 C2 D5 G6] • Order of node expansion A0 C2 A4 B5 B5 D5 E5 G6

  15. Q4 Prove…

  16. Q4.1 – BFS special of UCS • We know: • When step costs are the same  UCS expands with minimal path cost. • Then: • Path costs will increase in depth. • Nodes of the same level have equal path cost. • Path cost of nodes at level I is less than path cost of nodes at level i+1. • Then: • UCS will expand shallowest nodes before deepest, i.e. like the case of BFS.

  17. Q4.2.1 – BFS special of Best First search • We know: • Best first search expands nodes with minimal f(n). • Using Q1.2  Greedy search behave like BFS when h(n) = d(n)  f(n) = d(n)  BFS is a special case of Greedy search. • Greedy search is a best first search. • Then: • BFS is a special case of Best First search.

  18. Q4.2.2 – DFS special of Best First search • We know: • Best first search expands nodes with minimal f(n). • If h(n) = 1/d(n)  Greedy search will expand deepest nodes before shallowest  behave like DFS  i.e. DFS is a special case of Greedy search. • Greedy search is a best first search. • Then: • BFS is a special case of Best First search.

  19. Q4.2.3 – UCS special of Best First search • We know: • Best first search expands nodes with minimal f(n). • Using Q1.1  A* behave like UCS when h(n) = 0  f(n) = g(n)  UCS is a special case of A*. • A* is a best first search. • Then: • UCS is a special case of Best First search.

  20. Q4.3 – UCS special of A* search • Same as Q4.2.3.

  21. G e f d c b a Q5 Answer questions on the figure…

  22. Q5.1 – Complete States G e 4 f 3 d c 2 1 b a

  23. G e f d c b a Q5.2 – Which better (DFS or BFS) • DFS… a b d 1 a 2 3 4 1 b 2 c 1 . . . Repeated States  Infinite Loop!

  24. G e f d c b a Q5.2 – Which better (DFS or BFS) • BFS… a b d 1 a a 3 4 . . . . . . e d f c d e b 2 2 2 3 4 1 . . . . . . . . . . . . . . . 1 3 G 3 1 4 3 G G . . . . 2 e f d • Complete!

  25. G e 4 f 3 d 5.3 – More Suitable Technique c 2 1 b a Try A* technique

  26. Example…g(n) 1 5 G e 4 2 2 1 2 f 3 d 5 2 5 c 3 1 2 1 1 b a 6

  27. Example…h(n) 6 5 0 G e 4 6 2 f 3 d 5 3 c 6 4 2 1 8 b a 5

  28. 6 6 5 2 1 D 4 E 5 0 1 2 G 3 2 5 2 5 3 F 8 A 2 6 2 6 5 4 A*: Final Closed List [A D 3 B 4 E F 1] Solution path A D 3 E G Order of node expansion A D 3 B 4 D E F 1 E G 1 B 1 5 1 C 3

More Related