your chance to review
Download
Skip this Video
Download Presentation
Your chance to review

Loading in 2 Seconds...

play fullscreen
1 / 35

Your chance to review - PowerPoint PPT Presentation


  • 72 Views
  • Uploaded on

Your chance to review. Consider a state space where the start state is number 1 and the successor function for state n returns two states, numbers 2n and 2n+1. Draw the portion of the state space for states 1 to 15.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Your chance to review' - meris


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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
your chance to review
Your chance to review
  • Consider a state space where the start state is number 1 and the successor function for state n returns two states, numbers 2n and 2n+1.
    • Draw the portion of the state space for states 1 to 15.
    • Suppose the goal state is 11. List the order in which nodes will be visited for breadth-first and depth-first searches.
solution
Solution
  • Breadth First
    • 1, 2, 3, 4, 5, 6, 7, 8 , 9, 10, 11
  • Depth First
    • Trick Question
    • 1, 2, 4, 8, 16, 32, ….
properties of depth first search1
Properties of Depth-first Search
  • Complete?? No: fails in infinite-depth spaces, spaces with loops Modify to avoid repeated states along path complete in finite spaces
properties of depth first search2
Properties of Depth-first Search
  • Complete?? No: fails in infinite-depth spaces, spaces with loops Modify to avoid repeated states along path complete in finite spaces
  • Optimal??
properties of depth first search3
Properties of Depth-first Search
  • Complete?? No: fails in infinite-depth spaces, spaces with loops Modify to avoid repeated states along path complete in finite spaces
  • Optimal?? No.
properties of depth first search4
Properties of Depth-first Search
  • Complete?? No: fails in infinite-depth spaces, spaces with loops Modify to avoid repeated states along path complete in finite spaces
  • Optimal?? No.
  • Time??
properties of depth first search5
Properties of Depth-first Search
  • Complete?? No: fails in infinite-depth spaces, spaces with loops Modify to avoid repeated states along path complete in finite spaces
  • Optimal?? No.
  • Time?? O(bm): terrible if m is much larger than dbut if solutions are dense, may be much faster than breadth-first
properties of depth first search6
Properties of Depth-first Search
  • Complete?? No: fails in infinite-depth spaces, spaces with loops Modify to avoid repeated states along path complete in finite spaces
  • Optimal?? No.
  • Time?? O(bm): terrible if m is much larger than dbut if solutions are dense, may be much faster than breadth-first
  • Space??
properties of depth first search7
Properties of Depth-first Search
  • Complete?? No: fails in infinite-depth spaces, spaces with loops Modify to avoid repeated states along path complete in finite spaces
  • Optimal?? No.
  • Time?? O(bm): terrible if m is much larger than dbut if solutions are dense, may be much faster than breadth-first
  • Space?? O(bm), I.e., linear space!
properties of breadth first search1
Properties of Breadth-First Search
  • Complete?? Yes (if b is finite)
properties of breadth first search2
Properties of Breadth-First Search
  • Complete?? Yes (if b is finite)
  • Optimal??
properties of breadth first search3
Properties of Breadth-First Search
  • Complete?? Yes (if b is finite)
  • Optimal?? Yes (if cost = 1 per step); not optimal in general
properties of breadth first search4
Properties of Breadth-First Search
  • Complete?? Yes (if b is finite)
  • Optimal?? Yes (if cost = 1 per step); not optimal in general
  • Time??
properties of breadth first search5
Properties of Breadth-First Search
  • Complete?? Yes (if b is finite)
  • Optimal?? Yes (if cost = 1 per step); not optimal in general
  • Time?? 1 + b + b2 + b3 + … + bd + b(bd – 1)= O( bd+1 ), ie, exp. in d
properties of breadth first search6
Properties of Breadth-First Search
  • Complete?? Yes (if b is finite)
  • Optimal?? Yes (if cost = 1 per step); not optimal in general
  • Time?? 1 + b + b2 + b3 + … + bd + b(bd – 1)= O( bd+1 ), ie, exp. in d
  • Space??
properties of breadth first search7
Properties of Breadth-First Search
  • Complete?? Yes (if b is finite)
  • Optimal?? Yes (if cost = 1 per step); not optimal in general
  • Time?? 1 + b + b2 + b3 + … + bd + b(bd – 1)= O( bd+1 ), ie, exp. in d
  • Space?? O( bd+1 ) (keep every node in memory)
properties of breadth first search8
Properties of Breadth-First Search
  • Complete?? Yes (if b is finite)
  • Optimal?? Yes (if cost = 1 per step); not optimal in general
  • Time?? 1 + b + b2 + b3 + … + bd + b(bd – 1)= O( bd+1 ), ie, exp. in d
  • Space?? O( bd+1 ) (keep every node in memory)
  • Space is the big problem: can easily generate nodes at 10MB/sec, so 24hours = 860GB.
comparing bfs and dfs
Comparing bfs and dfs
  • bfs is preferred if
    • The branching factor is not too large (hence memory costs)
    • A solution appears at a relatively shallow level
    • No path is excessively deep
  • dfs is preferred if
    • The Tree is deep
    • The branching factor is not excessive
    • Solutions occur deeply in the tree
uninformed search strategies
Uninformed Search Strategies
  • Uninformed strategies use only information available in the problem definition
    • Breadth-first search
    • Uniform-cost search
    • Depth-first search
    • Depth-limited search
    • Iterative deepening search
properties of breadth first search9
Properties of Breadth-First Search
  • Complete?? Yes (if b is finite)
  • Optimal?? Yes (if cost = 1 per step); not optimal in general
  • Time?? 1 + b + b2 + b3 + … + bd + b(bd – 1)= O( bd+1 ), ie, exp. in d
  • Space?? O( bd+1 ) (keep every node in memory)
  • Space is the big problem: can easily generate nodes at 10MB/sec, so 24hours = 860GB.
properties of breadth first search10
Properties of Breadth-First Search
  • Complete?? Yes (if b is finite)
  • Optimal?? Yes (if cost = 1 per step); not optimal in general
  • Time?? 1 + b + b2 + b3 + … + bd + b(bd – 1)= O( bd+1 ), ie, exp. in d
  • Space?? O( bd+1 ) (keep every node in memory)
  • Space is the big problem: can easily generate nodes at 10MB/sec, so 24hours = 860GB.
uniform cost search
Uniform-cost Search
  • Expand least-cost unexpanded node
  • Implementation:
    • fringe = queue ordered by path cost
    • Equivalent to breadth-first if step costs all equal
uniform cost search1
Uniform-cost Search
  • Expand least-cost unexpanded node
  • Implementation:
    • fringe = queue ordered by path cost
    • Equivalent to breadth-first if step costs all equal
  • Complete??
uniform cost search2
Uniform-cost Search
  • Expand least-cost unexpanded node
  • Implementation:
    • fringe = queue ordered by path cost
    • Equivalent to breadth-first if step costs all equal
  • Complete?? Yes, if step cost 
uniform cost search3
Uniform-cost Search
  • Expand least-cost unexpanded node
  • Implementation:
    • fringe = queue ordered by path cost
    • Equivalent to breadth-first if step costs all equal
  • Complete?? Yes, if step cost 
  • Optimal??
uniform cost search4
Uniform-cost Search
  • Expand least-cost unexpanded node
  • Implementation:
    • fringe = queue ordered by path cost
    • Equivalent to breadth-first if step costs all equal
  • Complete?? Yes, if step cost 
  • Optimal?? Yes – nodes expanded in increasing order of g(n)
uniform cost search5
Uniform-cost Search
  • Expand least-cost unexpanded node
  • Implementation:
    • fringe = queue ordered by path cost
    • Equivalent to breadth-first if step costs all equal
  • Complete?? Yes, if step cost 
  • Optimal?? Yes – nodes expanded in increasing order of g(n)
  • Time??
uniform cost search6
Uniform-cost Search
  • Expand least-cost unexpanded node
  • Implementation:
    • fringe = queue ordered by path cost
    • Equivalent to breadth-first if step costs all equal
  • Complete?? Yes, if step cost 
  • Optimal?? Yes – nodes expanded in increasing order of g(n)
  • Time?? # of nodes with g  cost of optimal solution, O(b C*/) where C* is cost of optimal solution
uniform cost search7
Uniform-cost Search
  • Expand least-cost unexpanded node
  • Implementation:
    • fringe = queue ordered by path cost
    • Equivalent to breadth-first if step costs all equal
  • Complete?? Yes, if step cost 
  • Optimal?? Yes – nodes expanded in increasing order of g(n)
  • Time?? # of nodes with g  cost of optimal solution, O(b C*/) where C* is cost of optimal solution
  • Space??
uniform cost search8
Uniform-cost Search
  • Expand least-cost unexpanded node
  • Implementation:
    • fringe = queue ordered by path cost
    • Equivalent to breadth-first if step costs all equal
  • Complete?? Yes, if step cost 
  • Optimal?? Yes – nodes expanded in increasing order of g(n)
  • Time?? # of nodes with g  cost of optimal solution, O(b C*/) where C* is cost of optimal solution
  • Space?? # of nodes with g  cost of optimal solution, O(b C*/)
ad