Download presentation
Presentation is loading. Please wait.
Published byEdmund Walton Modified over 9 years ago
1
Chapter 3 Solving Problems by Searching
2
Abstraction Representing the Real World Want to buy a full-scale model of the Real WorldWant to buy a full-scale model of the Real World Way too complex!Way too complex! Simplify the Problem Throw-out unnecessary information This is where much of the real intelligence happensThis is where much of the real intelligence happens
3
Problem Solving Agents Goal Formulation What does the agent need to accomplish right now.What does the agent need to accomplish right now. Problem Formulation What States and Actions to considerWhat States and Actions to consider This is where we need abstractionThis is where we need abstraction Search for Solution Given states and actionsGiven states and actions What actions should be taken to achieve goalWhat actions should be taken to achieve goal
4
Well-defined Problems and Solutions Well-defined Problems Initial StateInitial State ActionsActions Successor Function Goal TestGoal Test Path CostPath Cost Step Cost Well-defined Solution Sequence of ActionsSequence of Actions
5
How do I get to Bucharest? Problem Formulation State SpaceState Space Map of Romania
6
Road Map of Romania
7
How do I get to Bucharest? Problem Formulation State SpaceState Space Map of Romania Initial StateInitial State At(Arad) ActionsActions Go(Arad,Zerind), Go(Iasi,Vaslui), … Goal TestGoal Test At(Bucharest) Path CostPath Cost Sum of individual step costs Well-defined Solution Sequence of ActionsSequence of Actions
8
8-Puzzle Problem
9
How do I solve an 8-puzzle? Problem Formulation StatesStates Position of each tile Initial StateInitial State Random Position ActionsActions Move tiles Move empty tile Goal TestGoal Test Are all of the tiles in the correct position Path CostPath Cost step cost is 1 Well-defined Solution Sequence of ActionsSequence of Actions
10
8-Queens
11
How do I Solve an n-Queens Problem? Problem Formulation StatesStates Position of each queen Initial StateInitial State Random Position Empty Board ActionsActions Move(Queen,Square) Place(Queen,Square) Goal TestGoal Test No Queen Attacks another Path CostPath Cost None Well-defined Solution Placement of each QueenPlacement of each Queen
12
Real-World Problems Robot Navigation VLSI Layout Internet Searching
13
Search Algorithms Simulated Exploration of State Space Off-line Create Search Tree Simple Search Algorithm 1. Start with initial state1. Start with initial state 2. Expand state by applying appropriate actions2. Expand state by applying appropriate actions 3. Check Goal Test3. Check Goal Test If False: Goto 2 4. Return Path From Initial State To Goal4. Return Path From Initial State To Goal
14
States vs. Nodes State Physical ConfigurationPhysical Configuration Node IncludesIncludes DepthDepth Parent NodeParent Node Etc.Etc.
15
Road Map of Romania
17
Representation One possible node representation StateState Parent pointerParent pointer ActionAction Path-CostPath-Cost DepthDepth Child ListChild List
18
Measuring Performance Completeness Guaranteed to find a solution?Guaranteed to find a solution? Optimality Find an optimal solution?Find an optimal solution? Space complexity How much memory to find a solutionHow much memory to find a solution Time complexity How long to find a solutionHow long to find a solution
19
Uninformed Search Strategies Breadth-first Search Uniform-cost Search Depth-first Search Depth-limited Search Iterative-deepening Search Bidirectional Search
20
Breadth-first Search Expand according to tree-depth Complete Non-optimal (optimal if cost related to depth)(optimal if cost related to depth) Space!! All nodes remain in memoryAll nodes remain in memory b d nodes per levelb d nodes per level
21
Breadth-first Search Time & Memory Requirements DepthNodesTimeMemory 21100.11 sec 1 meg 4111,100 11 sec 106 meg 6 10 7 19 min 10 gig 8 10 9 31 hrs 1 T 10 10 11 129 days 101 T
22
Uniform-cost Search Expand node with lowest path cost Complete Optimal Space Complexity Similar to BFSSimilar to BFS O(b C*/e )O(b C*/e ) C* is memory cost of optimal solution e is the minimal cost of each action If all costs are the sameIf all costs are the same O(b C*/e ) = b d
23
Depth-first Search Expand deepest node first Implemented with stack Space Complexity Only need a single pathOnly need a single path O(bd)O(bd) Time Complexity O(b d )O(b d ) Not Complete Not Optimal
24
Depth-limited Search DFS with a predetermined depth limit – ‘L’ Better space and time complexities Space O(bL)Space O(bL) Time O(b L )Time O(b L ) Not Complete Not Optimal
25
Iterative Deepening DLS with modification Gradually increase depth limit Complete Optimal Space O(bd)O(bd) Time O(b d )O(b d )
26
Bi-directional Search Both directions From Start and GoalFrom Start and Goal Both Searches use BFS why?why? Complete Optimal Space O(b d/2 )O(b d/2 ) Time O(b d/2 )O(b d/2 ) Requires Predecessor Information
27
Avoiding Repeated States Issue in all problems with reversible actions Must somehow mark nodes as visited Check expanded nodes in queueCheck expanded nodes in queue Create memory of visited statesCreate memory of visited states Must also check to see if new path to repeated state has lower cost of previous path
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.