chapter 3: solving problems by searching uninformed search
TRANSCRIPT
![Page 1: Chapter 3: Solving Problems by Searching Uninformed Search](https://reader031.vdocument.in/reader031/viewer/2022013001/61ca9d522dc2b770bc37e59e/html5/thumbnails/1.jpg)
Chapter 3:Solving Problems by Searching
Uninformed SearchEdited by Neng-Fa Zhou
![Page 2: Chapter 3: Solving Problems by Searching Uninformed Search](https://reader031.vdocument.in/reader031/viewer/2022013001/61ca9d522dc2b770bc37e59e/html5/thumbnails/2.jpg)
Problem‐Solving Agents
• How does an agent can find a sequence of actions that achieves its goals with minimum cost?
• This is the general task of problem solving and is typically performed by searching through an internally modeled space of world states.
![Page 3: Chapter 3: Solving Problems by Searching Uninformed Search](https://reader031.vdocument.in/reader031/viewer/2022013001/61ca9d522dc2b770bc37e59e/html5/thumbnails/3.jpg)
Problem Formulation
• States• The initial state• ACTIONS(s): the set of actions that can be executed in state s
• The transition model: s’ = RESULT(s,a)• The goal test• A path cost function
![Page 4: Chapter 3: Solving Problems by Searching Uninformed Search](https://reader031.vdocument.in/reader031/viewer/2022013001/61ca9d522dc2b770bc37e59e/html5/thumbnails/4.jpg)
Problem Solving Task
• Given:– An initial state of the world– A set of possible possible actions or operators that can be performed.
– A goal test that can be applied to a single state of the world to determine if it is a goal state.
• Find:– A solution stated as a path of states and operators that shows how to transform the initial state into one that satisfies the goal test.
• State space– The initial state and set of operators implicitly
![Page 5: Chapter 3: Solving Problems by Searching Uninformed Search](https://reader031.vdocument.in/reader031/viewer/2022013001/61ca9d522dc2b770bc37e59e/html5/thumbnails/5.jpg)
Solution Quality
• Step Cost– Each individual action has an associated cost.
• Path cost– A function that assigns a cost to a path, typically by summing the cost of the individual operators in the path.
• Optimal Solution– Find a lowest‐cost path.
![Page 6: Chapter 3: Solving Problems by Searching Uninformed Search](https://reader031.vdocument.in/reader031/viewer/2022013001/61ca9d522dc2b770bc37e59e/html5/thumbnails/6.jpg)
Example Problems: Route Finding
• Find a route from Arad to Bucharest
![Page 7: Chapter 3: Solving Problems by Searching Uninformed Search](https://reader031.vdocument.in/reader031/viewer/2022013001/61ca9d522dc2b770bc37e59e/html5/thumbnails/7.jpg)
Example Problems: The Vacuum World
• States: An environment with n locations has nx2^n states.
• Initial state, actions, transition model, goal test, path cost
![Page 8: Chapter 3: Solving Problems by Searching Uninformed Search](https://reader031.vdocument.in/reader031/viewer/2022013001/61ca9d522dc2b770bc37e59e/html5/thumbnails/8.jpg)
Example Problems: 8‐Puzzle
![Page 9: Chapter 3: Solving Problems by Searching Uninformed Search](https://reader031.vdocument.in/reader031/viewer/2022013001/61ca9d522dc2b770bc37e59e/html5/thumbnails/9.jpg)
Example Problems: 8‐Queens Problem
![Page 10: Chapter 3: Solving Problems by Searching Uninformed Search](https://reader031.vdocument.in/reader031/viewer/2022013001/61ca9d522dc2b770bc37e59e/html5/thumbnails/10.jpg)
Other Example Problems
• Knuth’s Conjecture– Starting with the number 4, a sequence of factorial, square root, and floor operations will reach any desired positive integer.
• Cryptarithmetic– SEND + MORE = MONEY
• Water Jugs Problem• Missionaries and Cannibals Problem
![Page 11: Chapter 3: Solving Problems by Searching Uninformed Search](https://reader031.vdocument.in/reader031/viewer/2022013001/61ca9d522dc2b770bc37e59e/html5/thumbnails/11.jpg)
Real‐World Problems
• Route finding• Travelling salesman problem• VLSI layout• Robot navigation• Automatic assembly sequencing• Protein design
![Page 12: Chapter 3: Solving Problems by Searching Uninformed Search](https://reader031.vdocument.in/reader031/viewer/2022013001/61ca9d522dc2b770bc37e59e/html5/thumbnails/12.jpg)
Search‐Trees
• A state can be expanded by generating all states that can be reached by applying a legal operator to the state.
• State space can also be defined by a successor function that returns all states produced by applying a single legal operator.
• A search tree is generated by generating search nodes by successively expanding states starting from the initial state as the root.
![Page 13: Chapter 3: Solving Problems by Searching Uninformed Search](https://reader031.vdocument.in/reader031/viewer/2022013001/61ca9d522dc2b770bc37e59e/html5/thumbnails/13.jpg)
The Tree‐Node Data Structure
• A search node in the tree can contain– n.STATE: Corresponding state– n.PARENT: Parent node– n.ACTION: Operator applied to reach this node– n.PATH‐COST: g(n), path cost of path from initial state to node
![Page 14: Chapter 3: Solving Problems by Searching Uninformed Search](https://reader031.vdocument.in/reader031/viewer/2022013001/61ca9d522dc2b770bc37e59e/html5/thumbnails/14.jpg)
Expanding Nodes and Search
• Search algorithms all share this basic tructure; they vary in how they choose which state to expand next—the so‐called search strategy.
![Page 15: Chapter 3: Solving Problems by Searching Uninformed Search](https://reader031.vdocument.in/reader031/viewer/2022013001/61ca9d522dc2b770bc37e59e/html5/thumbnails/15.jpg)
Tree‐Search
![Page 16: Chapter 3: Solving Problems by Searching Uninformed Search](https://reader031.vdocument.in/reader031/viewer/2022013001/61ca9d522dc2b770bc37e59e/html5/thumbnails/16.jpg)
Graph‐Search
![Page 17: Chapter 3: Solving Problems by Searching Uninformed Search](https://reader031.vdocument.in/reader031/viewer/2022013001/61ca9d522dc2b770bc37e59e/html5/thumbnails/17.jpg)
Evaluate Search Algorithm’s Performance
• Completeness (systematic search vs local search)
• Time Complexity• Space Complexity• Optimality
![Page 18: Chapter 3: Solving Problems by Searching Uninformed Search](https://reader031.vdocument.in/reader031/viewer/2022013001/61ca9d522dc2b770bc37e59e/html5/thumbnails/18.jpg)
Search Strategies: Uniformed Search
• Blind, exhaustive, brute force, do not guide the search with any additional information about the problem– Breadth‐first search – Uniform Cost Search– Depth‐First Search– Depth‐limited search
– Iterative deepening depth‐first search – Bidirectional search
![Page 19: Chapter 3: Solving Problems by Searching Uninformed Search](https://reader031.vdocument.in/reader031/viewer/2022013001/61ca9d522dc2b770bc37e59e/html5/thumbnails/19.jpg)
Search Strategies: Informed Search
• Heuristic, intelligent, use information about the problem (estimated distance from a state to the goal) to guide the search.– Greedy best‐‐first search – A* search – Iterative deepening A* (IDA*)
![Page 20: Chapter 3: Solving Problems by Searching Uninformed Search](https://reader031.vdocument.in/reader031/viewer/2022013001/61ca9d522dc2b770bc37e59e/html5/thumbnails/20.jpg)
Breadth‐first search
![Page 21: Chapter 3: Solving Problems by Searching Uninformed Search](https://reader031.vdocument.in/reader031/viewer/2022013001/61ca9d522dc2b770bc37e59e/html5/thumbnails/21.jpg)
Breadth‐First Complexity
• Assume there are an average of b successors to each node, called the branching factor.
• Therefore, to find a solution path of length d must explore nodes.
• Plus need b^d nodes in memory to store leaves in queue.
![Page 22: Chapter 3: Solving Problems by Searching Uninformed Search](https://reader031.vdocument.in/reader031/viewer/2022013001/61ca9d522dc2b770bc37e59e/html5/thumbnails/22.jpg)
Uniform Cost Search
• Like breadth‐first except expands the node with lowest path cost, g(n).
![Page 23: Chapter 3: Solving Problems by Searching Uninformed Search](https://reader031.vdocument.in/reader031/viewer/2022013001/61ca9d522dc2b770bc37e59e/html5/thumbnails/23.jpg)
Depth‐first Search
• DFS expands the deepest unexpanded node first. Implemented using a stack (LIFO).
![Page 24: Chapter 3: Solving Problems by Searching Uninformed Search](https://reader031.vdocument.in/reader031/viewer/2022013001/61ca9d522dc2b770bc37e59e/html5/thumbnails/24.jpg)
DFS
BREADTH-FIRST-SEARCH -> DEPTH-FIRST-SEARCH
FIFO -> LIFO
![Page 25: Chapter 3: Solving Problems by Searching Uninformed Search](https://reader031.vdocument.in/reader031/viewer/2022013001/61ca9d522dc2b770bc37e59e/html5/thumbnails/25.jpg)
Depth‐First Properties
• Not guaranteed to be complete• Not guaranteed optimal• Time complexity in worst case is still O(b^d) • Space complexity is only O(bm) where m is maximum depth of the tree.
![Page 26: Chapter 3: Solving Problems by Searching Uninformed Search](https://reader031.vdocument.in/reader031/viewer/2022013001/61ca9d522dc2b770bc37e59e/html5/thumbnails/26.jpg)
Iterative Deepening
• Calls depth‐first search with increasing depth limits until a goal is found.
![Page 27: Chapter 3: Solving Problems by Searching Uninformed Search](https://reader031.vdocument.in/reader031/viewer/2022013001/61ca9d522dc2b770bc37e59e/html5/thumbnails/27.jpg)
Bidirectional Search
• We can run two simultaneous searches – one forward from the initial state and the other backward from the goal (hoping that the two searches meet in the middle).
• Rational?