Your chance to review
Download
1 / 35

Your chance to review - PowerPoint PPT Presentation


  • 66 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