UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in...
-
Upload
milton-norris -
Category
Documents
-
view
241 -
download
18
Transcript of UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in...
![Page 1: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/1.jpg)
![Page 2: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/2.jpg)
UNINFORMED SEARCH
![Page 3: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/3.jpg)
Problem-solving agents
![Page 4: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/4.jpg)
Example: Romania
On holiday in Romania; currently in Arad.
Flight leaves tomorrow from Bucharest
![Page 5: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/5.jpg)
What do we need to define?
![Page 6: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/6.jpg)
Problem Formulation
The process of defining actions, states and goal.
States: Cities (e.g. Arad, Sibiu, Bucharest, etc)
Actions: GoTo(adjacent city)
Goal: Bucharest
Why not “turn left 5 degrees” or “walk 100 meters forward…”?
![Page 7: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/7.jpg)
Abstraction
The process of removing details from a representation. Simplifies the problem Makes problems tractable (possible to
solve) Humans are great at this!
Imagine a hierarchy in which another agent takes care of the lower level details, such as navigating from the city center to the highway.
![Page 8: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/8.jpg)
Back to Arad…
We are in Arad and need to find our way to Bucharest.
![Page 9: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/9.jpg)
Step 1 – Check Goal Condition
Check, are we at the goal? (obviously not in this case, but we need to
check in case we were)
![Page 10: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/10.jpg)
Step 2 – Expand Current Node
Enumerate all the possible actions you could take from the current state
Formally: apply each legal action to the current state, thereby generating a new set of states.
From Arad can go to: Sibiu Timisoara Zerind
![Page 11: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/11.jpg)
Step 3 – Select which action to perform
Perform one of the possible actions (e.g. GoTo(Sibiu))
Then go back to Step 1 and repeat.
![Page 12: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/12.jpg)
This is an example of Tree Search Exploration of state space by generating
successors of already-explored states (a.k.a. expanding states)
Usually performed offline, as a simulation
Returns the sequence of actions that should be performed to reach the goal, or that the goal is unreachable.
![Page 13: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/13.jpg)
Example: Romania
![Page 14: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/14.jpg)
Tree Search
![Page 15: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/15.jpg)
Tree search example
![Page 16: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/16.jpg)
Tree search example: start with Sibiu
![Page 17: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/17.jpg)
Tree search example: need to process the descendants of Sibiu
Note that we can loop back to Arad. Have to make sure we don’t go in circles forever!
![Page 18: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/18.jpg)
Tree search algorithms
![Page 19: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/19.jpg)
Implementation: general tree search
a.k.a. frontier
![Page 20: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/20.jpg)
This is the part that distinguishes different search strategies
![Page 21: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/21.jpg)
Search strategies
A search strategy is defined by picking the order of node expansion
![Page 22: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/22.jpg)
Uninformed search strategies Uninformed search strategies use only
the information available in the problem definition
What does it mean to be uninformed? You only know the topology of which states
are connected by which actions. No additional information.
Later we’ll talk about informed search, in which you can estimate which actions are likely to be better than others.
![Page 23: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/23.jpg)
Breadth-first search
Expand shallowest unexpanded node Implementation:
Fringe is a FIFO queue, i.e., new successors go at end
![Page 24: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/24.jpg)
Breadth-first search
Expand shallowest unexpanded node Implementation:
Fringe is a FIFO queue, i.e., new successors go at end
![Page 25: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/25.jpg)
Breadth-first search
Expand shallowest unexpanded node Implementation:
Fringe is a FIFO queue, i.e., new successors go at end
![Page 26: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/26.jpg)
Breadth-first search
Expand shallowest unexpanded node Implementation:
Fringe is a FIFO queue, i.e., new successors go at end
![Page 27: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/27.jpg)
BFS on a Graph
![Page 28: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/28.jpg)
Search Strategy Evaluation: finding solutions
Strategies are evaluated along the following dimensions: completeness: does it always find a
solution if one exists? optimality: does it always find a least-cost
solution?
![Page 29: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/29.jpg)
Search Strategy Evaluation: complexity
(cost) Two types of complexity
time complexity: number of nodes visited space complexity: maximum number of nodes
in memory
Time and space complexity are measured in terms of b: maximum branching factor of the search
tree (may ∞) d: depth of the least-cost solution m: maximum depth of the state space (may be
∞)
![Page 30: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/30.jpg)
Properties of breadth-first search Complete?
Yes (if b is finite)
Optimal? Yes (if cost = 1 per step)
Time? 1+b+b2+b3+… +bd = O(bd)
Space? O(bd) (keeps every node in memory)
![Page 31: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/31.jpg)
Problems of breadth first search Space is the biggest problem (more than
time)
Example from book, BFS b=10 to depth of 10 3 hours (not so bad) 10 terabytes of memory (really bad)
Only reason speed is not a problem is you run out of memory first
![Page 32: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/32.jpg)
Problems of breadth first search BFS is not optimal if the cost of some
actions is greater than others…
![Page 33: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/33.jpg)
Uniform-cost search
For graphs with actions of different cost Equivalent to breadth-first if step costs all
equal
Expand least-cost unexpanded node Implementation:
fringe = queue sorted by path cost g(n), from smallest to largest (i.e. a priority queue)
![Page 34: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/34.jpg)
Uniform-cost search
![Page 35: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/35.jpg)
Uniform-cost search
Complete? Yes, if step cost ≥ ε
Time? O(bceiling(C*/ ε)) where C* is the cost of the optimal solution
Space? # of nodes with g ≤ cost of optimal solution, O(bceiling(C*/ ε))
Optimal? Yes – nodes expanded in increasing order of g(n)
See book for detailed analysis.
![Page 36: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/36.jpg)
Depth-first search
Expand deepest unexpanded node Implementation: fringe = LIFO queue, i.e., put successors at front
(i.e. a stack)
![Page 37: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/37.jpg)
Depth-first search
Expand deepest unexpanded node Implementation:
fringe = LIFO queue, i.e., put successors at front
![Page 38: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/38.jpg)
Depth-first search
Expand deepest unexpanded node Implementation:
fringe = LIFO queue, i.e., put successors at front
![Page 39: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/39.jpg)
Depth-first search
Expand deepest unexpanded node Implementation:
fringe = LIFO queue, i.e., put successors at front
![Page 40: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/40.jpg)
Depth-first search
Expand deepest unexpanded node Implementation:
fringe = LIFO queue, i.e., put successors at front
![Page 41: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/41.jpg)
Depth-first search
Expand deepest unexpanded node Implementation:
fringe = LIFO queue, i.e., put successors at front
![Page 42: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/42.jpg)
This is the part that distinguishes different search algorithms
![Page 43: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/43.jpg)
Search Solution
Each node needs to keep track of its parent
Once the goal is found, traverse up the tree to the root to find the solution
![Page 44: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/44.jpg)
Properties of depth-first search
Complete? No: fails in infinite-depth spaces Yes: in finite spaces
Optimal? No
Time? O(bm): (m is max depth of state space) terrible if m is much larger than d but if solutions are plentiful, may be much faster than breadth-
first
Space? O(bm), i.e., linear space!
![Page 45: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/45.jpg)
Depth-limited search
depth-first search with depth limit l (i.e., don’t expand nodes past depth l)
… will fail if the goal is below the depth limit
![Page 46: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/46.jpg)
Iterative deepening search
![Page 47: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/47.jpg)
Iterative deepening search l =0
![Page 48: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/48.jpg)
Iterative deepening search l =1
![Page 49: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/49.jpg)
Iterative deepening search l =2
![Page 50: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/50.jpg)
Iterative deepening search l =3
![Page 51: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/51.jpg)
Properties of iterative deepening search
Complete? Yes
Time? (d+1)b0 + d b1 + (d-1)b2 + … + bd = O(bd)
Space? O(bd)
Optimal? Yes, if step cost = 1
![Page 52: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/52.jpg)
Bidirectional Search
Run two simultaneous searches One forward from the start One backward from the goal
Hope that the searches meet in the middle bd/2 +bd/2 << bd
![Page 53: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/53.jpg)
Summary of algorithms
![Page 54: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/54.jpg)
Graph search
The closed set keeps track of loops in the graph so that the search terminates.
![Page 55: UNINFORMED SEARCH Problem - solving agents Example : Romania On holiday in Romania ; currently in Arad. Flight leaves tomorrow from Bucharest.](https://reader035.fdocuments.net/reader035/viewer/2022062304/56649ccf5503460f9499b65c/html5/thumbnails/55.jpg)
Questions?
Waitlisted? Talk to me after class.