![Page 1: Problem Solving as Search. Problem Types Deterministic, fully observable single-state problem Non-observable conformant problem Nondeterministic and/or](https://reader034.vdocuments.mx/reader034/viewer/2022050809/5697bfeb1a28abf838cb7f18/html5/thumbnails/1.jpg)
Problem Solving as Search
![Page 2: Problem Solving as Search. Problem Types Deterministic, fully observable single-state problem Non-observable conformant problem Nondeterministic and/or](https://reader034.vdocuments.mx/reader034/viewer/2022050809/5697bfeb1a28abf838cb7f18/html5/thumbnails/2.jpg)
Problem Types• Deterministic, fully observable single-state
problem
• Non-observable conformant problem
• Nondeterministic and/or partially observable contingency problem
• Unknown state space exploration problem
![Page 3: Problem Solving as Search. Problem Types Deterministic, fully observable single-state problem Non-observable conformant problem Nondeterministic and/or](https://reader034.vdocuments.mx/reader034/viewer/2022050809/5697bfeb1a28abf838cb7f18/html5/thumbnails/3.jpg)
Consider this problem
• Five missionaries and five cannibals• Want to cross a river using one canoe.• Canoe can hold up to three people.• Can never be more cannibals than
missionaries on either side of the river.• Aim: To get all safely across the river
without any missionaries being eaten.
• States?? Actions?? Goal test?? Path cost??
![Page 4: Problem Solving as Search. Problem Types Deterministic, fully observable single-state problem Non-observable conformant problem Nondeterministic and/or](https://reader034.vdocuments.mx/reader034/viewer/2022050809/5697bfeb1a28abf838cb7f18/html5/thumbnails/4.jpg)
Single-State Problem Formulation
• A problem is defined by four items:1. initial state
2. successor function (which actually defines all reachable states)
3. goal test
4. path cost (additive)e.g., sum of distances, number of
actions executed, etc.C(x,a,y) is the step cost, assumed to be
0
![Page 5: Problem Solving as Search. Problem Types Deterministic, fully observable single-state problem Non-observable conformant problem Nondeterministic and/or](https://reader034.vdocuments.mx/reader034/viewer/2022050809/5697bfeb1a28abf838cb7f18/html5/thumbnails/5.jpg)
Problem Representation : Cannibals and Missionaries
• Initial State– We can show number of cannibals,
missionaries and canoes on each side of the river.
– Start state is therefore:• [5,5,1,0,0,0]
![Page 6: Problem Solving as Search. Problem Types Deterministic, fully observable single-state problem Non-observable conformant problem Nondeterministic and/or](https://reader034.vdocuments.mx/reader034/viewer/2022050809/5697bfeb1a28abf838cb7f18/html5/thumbnails/6.jpg)
Problem Representation : Cannibals and Missionaries
• Initial State– However, since the system is closed, we only
need to represent one side of the river, as we can deduce the other side.
– We will represent the starting side of the river, and omit the ending side.
– So start state is:• [5,5,1]
![Page 7: Problem Solving as Search. Problem Types Deterministic, fully observable single-state problem Non-observable conformant problem Nondeterministic and/or](https://reader034.vdocuments.mx/reader034/viewer/2022050809/5697bfeb1a28abf838cb7f18/html5/thumbnails/7.jpg)
Problem Representation : Cannibals and Missionaries
• Goal State(s)– [0,0,0] – TECHNICALLY also [0,0,1]
![Page 8: Problem Solving as Search. Problem Types Deterministic, fully observable single-state problem Non-observable conformant problem Nondeterministic and/or](https://reader034.vdocuments.mx/reader034/viewer/2022050809/5697bfeb1a28abf838cb7f18/html5/thumbnails/8.jpg)
Problem Representation : Cannibals and Missionaries
• Successor Function (9 actions)1. Move one missionary.
2. Move one cannibal.
3. Move two missionaries.
4. Move two cannibals.
5. Move three missionaries.
6. Move three cannibals.
7. Move one missionary and one cannibal.
8. Move one missionary and two cannibals.
9. Move two missionaries and one cannibal.
![Page 9: Problem Solving as Search. Problem Types Deterministic, fully observable single-state problem Non-observable conformant problem Nondeterministic and/or](https://reader034.vdocuments.mx/reader034/viewer/2022050809/5697bfeb1a28abf838cb7f18/html5/thumbnails/9.jpg)
Problem Representation : Cannibals and Missionaries
• Successor Function (9 actions)1. Move one missionary.
2. Move one cannibal.
3. Move two missionaries.
4. Move two cannibals.
5. Move three missionaries.
6. Move three cannibals.
7. Move one missionary and one cannibal.
8. Move one missionary and two cannibals.
9. Move two missionaries and one cannibal.
![Page 10: Problem Solving as Search. Problem Types Deterministic, fully observable single-state problem Non-observable conformant problem Nondeterministic and/or](https://reader034.vdocuments.mx/reader034/viewer/2022050809/5697bfeb1a28abf838cb7f18/html5/thumbnails/10.jpg)
Problem Representation : Cannibals and Missionaries
• Successor Function– To be a little more mathematical/computer
like, we want to represent this in a true successor function format…
S(state) state
1. Move one cannibal across the river.S([x,y,1]) [x-1,y,0]S([x,y,0]) [x+1,y,1]
[Note, this is a slight simplification. We also require, 0 x, y, [x+1 or x-1] 5 ]
![Page 11: Problem Solving as Search. Problem Types Deterministic, fully observable single-state problem Non-observable conformant problem Nondeterministic and/or](https://reader034.vdocuments.mx/reader034/viewer/2022050809/5697bfeb1a28abf838cb7f18/html5/thumbnails/11.jpg)
Problem Representation : Cannibals and Missionaries
• Successor FunctionS([x,y,0]) [x+1,y,1] //1 missionaryS([x,y,1]) [x-1,y,0]…S([x,y,0]) [x+2,y,1] //2 missionariesS([x,y,1]) [x-2,y,0]…S([x,y,0]) [x+1,y+1,1] // 1 of eachS([x,y,1]) [x-1,y-1,0]
![Page 12: Problem Solving as Search. Problem Types Deterministic, fully observable single-state problem Non-observable conformant problem Nondeterministic and/or](https://reader034.vdocuments.mx/reader034/viewer/2022050809/5697bfeb1a28abf838cb7f18/html5/thumbnails/12.jpg)
Problem Representation : Cannibals and Missionaries
• Path Cost– One unit per trip across the river.
![Page 13: Problem Solving as Search. Problem Types Deterministic, fully observable single-state problem Non-observable conformant problem Nondeterministic and/or](https://reader034.vdocuments.mx/reader034/viewer/2022050809/5697bfeb1a28abf838cb7f18/html5/thumbnails/13.jpg)
Implementation: General Tree Search
![Page 14: Problem Solving as Search. Problem Types Deterministic, fully observable single-state problem Non-observable conformant problem Nondeterministic and/or](https://reader034.vdocuments.mx/reader034/viewer/2022050809/5697bfeb1a28abf838cb7f18/html5/thumbnails/14.jpg)
Tree Search Example
![Page 15: Problem Solving as Search. Problem Types Deterministic, fully observable single-state problem Non-observable conformant problem Nondeterministic and/or](https://reader034.vdocuments.mx/reader034/viewer/2022050809/5697bfeb1a28abf838cb7f18/html5/thumbnails/15.jpg)
Tree Search Example
![Page 16: Problem Solving as Search. Problem Types Deterministic, fully observable single-state problem Non-observable conformant problem Nondeterministic and/or](https://reader034.vdocuments.mx/reader034/viewer/2022050809/5697bfeb1a28abf838cb7f18/html5/thumbnails/16.jpg)
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
![Page 17: Problem Solving as Search. Problem Types Deterministic, fully observable single-state problem Non-observable conformant problem Nondeterministic and/or](https://reader034.vdocuments.mx/reader034/viewer/2022050809/5697bfeb1a28abf838cb7f18/html5/thumbnails/17.jpg)
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
![Page 18: Problem Solving as Search. Problem Types Deterministic, fully observable single-state problem Non-observable conformant problem Nondeterministic and/or](https://reader034.vdocuments.mx/reader034/viewer/2022050809/5697bfeb1a28abf838cb7f18/html5/thumbnails/18.jpg)
Breadth-First Search
• Expanding shallowest unexpanded nodeImplementation
fringe is a FIFO queue, i.e., new successors go at end
![Page 19: Problem Solving as Search. Problem Types Deterministic, fully observable single-state problem Non-observable conformant problem Nondeterministic and/or](https://reader034.vdocuments.mx/reader034/viewer/2022050809/5697bfeb1a28abf838cb7f18/html5/thumbnails/19.jpg)
Breadth-First Search
• Expanding shallowest unexpanded nodeImplementation
fringe is a FIFO queue, i.e., new successors go at end
![Page 20: Problem Solving as Search. Problem Types Deterministic, fully observable single-state problem Non-observable conformant problem Nondeterministic and/or](https://reader034.vdocuments.mx/reader034/viewer/2022050809/5697bfeb1a28abf838cb7f18/html5/thumbnails/20.jpg)
Breadth-First Search
• Expanding shallowest unexpanded nodeImplementation
fringe is a FIFO queue, i.e., new successors go at end
![Page 21: Problem Solving as Search. Problem Types Deterministic, fully observable single-state problem Non-observable conformant problem Nondeterministic and/or](https://reader034.vdocuments.mx/reader034/viewer/2022050809/5697bfeb1a28abf838cb7f18/html5/thumbnails/21.jpg)
Breadth-First Search
• Expanding shallowest unexpanded nodeImplementation
fringe is a FIFO queue, i.e., new successors go at end
![Page 22: Problem Solving as Search. Problem Types Deterministic, fully observable single-state problem Non-observable conformant problem Nondeterministic and/or](https://reader034.vdocuments.mx/reader034/viewer/2022050809/5697bfeb1a28abf838cb7f18/html5/thumbnails/22.jpg)
Depth-First Search• Expand deepest unexpanded node
Implementation:fringe = LIFO queue, I.e., put successors
at front
![Page 23: Problem Solving as Search. Problem Types Deterministic, fully observable single-state problem Non-observable conformant problem Nondeterministic and/or](https://reader034.vdocuments.mx/reader034/viewer/2022050809/5697bfeb1a28abf838cb7f18/html5/thumbnails/23.jpg)
Depth-First Search• Expand deepest unexpanded node
Implementation:fringe = LIFO queue, I.e., put successors
at front
![Page 24: Problem Solving as Search. Problem Types Deterministic, fully observable single-state problem Non-observable conformant problem Nondeterministic and/or](https://reader034.vdocuments.mx/reader034/viewer/2022050809/5697bfeb1a28abf838cb7f18/html5/thumbnails/24.jpg)
Depth-First Search• Expand deepest unexpanded node
Implementation:fringe = LIFO queue, I.e., put successors
at front
![Page 25: Problem Solving as Search. Problem Types Deterministic, fully observable single-state problem Non-observable conformant problem Nondeterministic and/or](https://reader034.vdocuments.mx/reader034/viewer/2022050809/5697bfeb1a28abf838cb7f18/html5/thumbnails/25.jpg)
Depth-First Search• Expand deepest unexpanded node
Implementation:fringe = LIFO queue, I.e., put successors
at front
![Page 26: Problem Solving as Search. Problem Types Deterministic, fully observable single-state problem Non-observable conformant problem Nondeterministic and/or](https://reader034.vdocuments.mx/reader034/viewer/2022050809/5697bfeb1a28abf838cb7f18/html5/thumbnails/26.jpg)
Depth-First Search• Expand deepest unexpanded node
Implementation:fringe = LIFO queue, I.e., put successors
at front
![Page 27: Problem Solving as Search. Problem Types Deterministic, fully observable single-state problem Non-observable conformant problem Nondeterministic and/or](https://reader034.vdocuments.mx/reader034/viewer/2022050809/5697bfeb1a28abf838cb7f18/html5/thumbnails/27.jpg)
Depth-First Search• Expand deepest unexpanded node
Implementation:fringe = LIFO queue, I.e., put successors
at front
![Page 28: Problem Solving as Search. Problem Types Deterministic, fully observable single-state problem Non-observable conformant problem Nondeterministic and/or](https://reader034.vdocuments.mx/reader034/viewer/2022050809/5697bfeb1a28abf838cb7f18/html5/thumbnails/28.jpg)
Depth-First Search• Expand deepest unexpanded node
Implementation:fringe = LIFO queue, I.e., put successors
at front
![Page 29: Problem Solving as Search. Problem Types Deterministic, fully observable single-state problem Non-observable conformant problem Nondeterministic and/or](https://reader034.vdocuments.mx/reader034/viewer/2022050809/5697bfeb1a28abf838cb7f18/html5/thumbnails/29.jpg)
Depth-First Search• Expand deepest unexpanded node
Implementation:fringe = LIFO queue, I.e., put successors
at front
![Page 30: Problem Solving as Search. Problem Types Deterministic, fully observable single-state problem Non-observable conformant problem Nondeterministic and/or](https://reader034.vdocuments.mx/reader034/viewer/2022050809/5697bfeb1a28abf838cb7f18/html5/thumbnails/30.jpg)
Depth-First Search• Expand deepest unexpanded node
Implementation:fringe = LIFO queue, I.e., put successors
at front
![Page 31: Problem Solving as Search. Problem Types Deterministic, fully observable single-state problem Non-observable conformant problem Nondeterministic and/or](https://reader034.vdocuments.mx/reader034/viewer/2022050809/5697bfeb1a28abf838cb7f18/html5/thumbnails/31.jpg)
Depth-First Search• Expand deepest unexpanded node
Implementation:fringe = LIFO queue, I.e., put successors
at front
![Page 32: Problem Solving as Search. Problem Types Deterministic, fully observable single-state problem Non-observable conformant problem Nondeterministic and/or](https://reader034.vdocuments.mx/reader034/viewer/2022050809/5697bfeb1a28abf838cb7f18/html5/thumbnails/32.jpg)
Depth-First Search• Expand deepest unexpanded node
Implementation:fringe = LIFO queue, I.e., put successors
at front
![Page 33: Problem Solving as Search. Problem Types Deterministic, fully observable single-state problem Non-observable conformant problem Nondeterministic and/or](https://reader034.vdocuments.mx/reader034/viewer/2022050809/5697bfeb1a28abf838cb7f18/html5/thumbnails/33.jpg)
Depth-First Search• Expand deepest unexpanded node
Implementation:fringe = LIFO queue, I.e., put successors
at front
![Page 34: Problem Solving as Search. Problem Types Deterministic, fully observable single-state problem Non-observable conformant problem Nondeterministic and/or](https://reader034.vdocuments.mx/reader034/viewer/2022050809/5697bfeb1a28abf838cb7f18/html5/thumbnails/34.jpg)
Search Strategies• A strategy is defined by picking the order of node
expansion• Strategies are evaluated along the following
dimensions: completeness – does it always find a
solution if one exists?time complexity – number of nodes
generated/expandedspace complexity – maximum number of
nodes in memoryoptimality – does it always find a least-cost
solution
![Page 35: Problem Solving as Search. Problem Types Deterministic, fully observable single-state problem Non-observable conformant problem Nondeterministic and/or](https://reader034.vdocuments.mx/reader034/viewer/2022050809/5697bfeb1a28abf838cb7f18/html5/thumbnails/35.jpg)
This is how far we got
![Page 36: Problem Solving as Search. Problem Types Deterministic, fully observable single-state problem Non-observable conformant problem Nondeterministic and/or](https://reader034.vdocuments.mx/reader034/viewer/2022050809/5697bfeb1a28abf838cb7f18/html5/thumbnails/36.jpg)
Search Strategies
• Time and space complexity are measured in terms of
b – maximum branching factor of the search treed – depth of the least-cost solutionm – maximum depth of the state space (may be infinite)
![Page 37: Problem Solving as Search. Problem Types Deterministic, fully observable single-state problem Non-observable conformant problem Nondeterministic and/or](https://reader034.vdocuments.mx/reader034/viewer/2022050809/5697bfeb1a28abf838cb7f18/html5/thumbnails/37.jpg)
Properties of Depth-first Search
• Complete??
![Page 38: Problem Solving as Search. Problem Types Deterministic, fully observable single-state problem Non-observable conformant problem Nondeterministic and/or](https://reader034.vdocuments.mx/reader034/viewer/2022050809/5697bfeb1a28abf838cb7f18/html5/thumbnails/38.jpg)
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
• Time??
![Page 39: Problem Solving as Search. Problem Types Deterministic, fully observable single-state problem Non-observable conformant problem Nondeterministic and/or](https://reader034.vdocuments.mx/reader034/viewer/2022050809/5697bfeb1a28abf838cb7f18/html5/thumbnails/39.jpg)
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
• Time?? O(bm): terrible if m is much larger than dbut if solutions are dense, may be much faster than breadth-first
• Space??
![Page 40: Problem Solving as Search. Problem Types Deterministic, fully observable single-state problem Non-observable conformant problem Nondeterministic and/or](https://reader034.vdocuments.mx/reader034/viewer/2022050809/5697bfeb1a28abf838cb7f18/html5/thumbnails/40.jpg)
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
• 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!• Optimal??
![Page 41: Problem Solving as Search. Problem Types Deterministic, fully observable single-state problem Non-observable conformant problem Nondeterministic and/or](https://reader034.vdocuments.mx/reader034/viewer/2022050809/5697bfeb1a28abf838cb7f18/html5/thumbnails/41.jpg)
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
• 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!• Optimal?? No.
![Page 42: Problem Solving as Search. Problem Types Deterministic, fully observable single-state problem Non-observable conformant problem Nondeterministic and/or](https://reader034.vdocuments.mx/reader034/viewer/2022050809/5697bfeb1a28abf838cb7f18/html5/thumbnails/42.jpg)
Properties of Breadth-First Search
• Complete??
![Page 43: Problem Solving as Search. Problem Types Deterministic, fully observable single-state problem Non-observable conformant problem Nondeterministic and/or](https://reader034.vdocuments.mx/reader034/viewer/2022050809/5697bfeb1a28abf838cb7f18/html5/thumbnails/43.jpg)
Properties of Breadth-First Search
• Complete?? Yes (if b is finite)
• Time??
![Page 44: Problem Solving as Search. Problem Types Deterministic, fully observable single-state problem Non-observable conformant problem Nondeterministic and/or](https://reader034.vdocuments.mx/reader034/viewer/2022050809/5697bfeb1a28abf838cb7f18/html5/thumbnails/44.jpg)
Properties of Breadth-First Search
• Complete?? Yes (if b is finite)
• Time?? 1 + b + b2 + b3 + … + bd + b(bd – 1)= O( bd+1 ), ie, exp. in d
• Space??
![Page 45: Problem Solving as Search. Problem Types Deterministic, fully observable single-state problem Non-observable conformant problem Nondeterministic and/or](https://reader034.vdocuments.mx/reader034/viewer/2022050809/5697bfeb1a28abf838cb7f18/html5/thumbnails/45.jpg)
Properties of Breadth-First Search
• Complete?? Yes (if b is finite)
• 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)
• Optimal??
![Page 46: Problem Solving as Search. Problem Types Deterministic, fully observable single-state problem Non-observable conformant problem Nondeterministic and/or](https://reader034.vdocuments.mx/reader034/viewer/2022050809/5697bfeb1a28abf838cb7f18/html5/thumbnails/46.jpg)
Properties of Breadth-First Search
• Complete?? Yes (if b is finite)• 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)• Optimal?? Yes (if cost = 1 per step); not optimal
in general• Space is the big problem: can easily generate
nodes at 10MB/sec, so 24hours = 860GB.
![Page 47: Problem Solving as Search. Problem Types Deterministic, fully observable single-state problem Non-observable conformant problem Nondeterministic and/or](https://reader034.vdocuments.mx/reader034/viewer/2022050809/5697bfeb1a28abf838cb7f18/html5/thumbnails/47.jpg)
Implementation: General Tree Search