1 / 33

Introduction to Artificial Intelligence CS 438 Spring 2008

Introduction to Artificial Intelligence CS 438 Spring 2008. Today AIMA, Ch. 3 Uniformed Search Next Week AIMA, Ch. 4 Informed Search Home Work: 4.1 and 4.3. “Russian researcher developed a system that can correctly identify images from Yahoo’s CAPTCHA system 35% of the time.”.

lassie
Télécharger la présentation

Introduction to Artificial Intelligence CS 438 Spring 2008

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. Introduction to Artificial IntelligenceCS 438 Spring 2008 • Today • AIMA, Ch. 3 • Uniformed Search • Next Week • AIMA, Ch. 4 • Informed Search • Home Work: • 4.1 and 4.3 “Russian researcher developed a system that can correctly identify images from Yahoo’s CAPTCHA system 35% of the time.”

  2. Search (reminder) • Search Tree • Root is the initial state • Each expanded state is a search node • Search Node • Encodes the state, parent node, action applied, depth, and path cost • Expanding a state • Generating new states by applying possible (valid) actions to current state using the successor function S(x)

  3. Search strategies • A search strategy is defined by picking the order of node expansion • How the IA will explore the search space • Strategies are evaluated along the following dimensions: • completeness: does it always find a solution if one exists? • time complexity: How long does it take to find a solution; measured as worst case analysis in the number of nodes generated • space complexity: maximum number of nodes in memory • optimality: does it always find a least-cost solution? • Time and space complexity are measured in terms of • b: maximum branching factor of the search tree • d: depth of the search tree

  4. Tree search algorithms • Basic idea

  5. Tree search example

  6. Tree search example

  7. Tree search example

  8. Implementation: general tree search Important: How the nodes are ordered in the fringe will determine the search strategy.

  9. Uninformed search strategies • Uninformed search strategies use only the information available in the problem definition • Breadth-first search • Uniform-cost search • Depth-first search • Depth-limited search • Iterative deepening search

  10. Breadth-first search • Expand shallowest unexpanded node • Why is this called “Breadth-first”? • Implementation: • fringe is a FIFO queue, i.e., new successors go at end • What is FIFO?

  11. Planes, Trains, and Automobiles(Route Finding)

  12. Properties of breadth-first search • Complete? • Yes; if b, the branching factor, is finite • Time? • 1+b+b2+b3+… +bd + (bd+1- b) = O(bd+1) • Space? • O(bd+1) (keeps every node in memory) • Optimal? • Yes: if cost = 1 per step • Space is the bigger problem (more than time)

  13. How bad is it really?

  14. Uniform-cost Search • Variation of Breadth-first search by expanding the node with the lowest path cost: g(n) • Implementation: • Nodes on the fringe queue are ordered by path cost

  15. Uniform-cost Search

  16. Uniform-cost search Equivalent to breadth-first if step costs all equal • Complete? • Yes, if step cost ≥ ε • What would happen if there was a zero cost action? • Time? • # of nodes with g ≤ cost of optimal solution, O(bceiling(C*/ ε)) where C* is the cost of the optimal solution • This can be much larger than bd; Why? • Space? # of nodes with g≤ cost of optimal solution, O(bceiling(C*/ ε)) • Optimal? Yes – nodes expanded in increasing order of g(n)

  17. Depth-first Search • Expand deepest unexpanded node • Implementation: • Nodes on the fringe are ordered in a LIFO queue; new successors go to the end. • What is LIFO?

  18. Depth-first Search

  19. Properties of depth-first search • Complete? No • Why? • Can it be modified to be complete? • Time? • O(bm), where m is the length of the longest path: • terrible if m is much larger than d but if solutions are dense, may be much faster than breadth-first • Space? • O(bm), i.e., linear space! • Optimal? • Yes or no?

  20. Repeated states • Failure to detect repeated states can turn a linear problem into an exponential one!

  21. Avoiding Redundant States • Dynamic Programming Principle • When looking for the best path from S to G, ignore all paths from S to any intermediate node, K, other than the minimum-length path from S to K

  22. Uniform-cost search with DPP

  23. Three Levels of DPP • Do not return to a state you just came from • Check parent (easiest to implement) • Do not return to a state that you have already visited along the path • Check ancestors • Do not go to any state that has already been generated before • Check all prior states • IMPORTANT: must compare path cost

  24. General Graph search Add a closed list Fringe list is sometimes referred as the open list

  25. Depth-limited search • A variation on depth-first search with depth limit l, • nodes at depth l have no successors • What does this solve? • Recursive implementation:

  26. Iterative deepening depth-first search

  27. Iterative deepening search l =0

  28. Iterative deepening search l =1

  29. Iterative deepening search l =2

  30. Iterative deepening search l =3

  31. Iterative deepening depth-first search • Number of nodes generated in a depth-limited search to depth d with branching factor b: NDLS = b0 + b1 + b2 + … + bd-2 + bd-1 + bd • Number of nodes generated in an iterative deepening search to depth d with branching factor b: NIDS = (d+1)b0 + d b^1 + (d-1)b^2 + … + 3bd-2 +2bd-1 + 1bd • For b = 10, d = 5, • NDLS = 1 + 10 + 100 + 1,000 + 10,000 + 100,000 = 111,111 • NIDS = 6 + 50 + 400 + 3,000 + 20,000 + 100,000 = 123,456 • Overhead = (123,456 - 111,111)/111,111 = 11%

  32. Properties of IDDF search • Complete? • Yes • Time? • (d+1)b0 + d b1 + (d-1)b2 + … + bd = O(bd) • Space? • O(bd) • Optimal? • Yes, if step cost = 1

  33. Summary of algorithms

More Related