320 likes | 530 Views
Problem-Solving by Searching. Uninformed (Blind) Search Algorithms. Project 1 is out, check class homepage Due in two weeks 9/27/2010 Monday before class Projects for students in different groups (480/580/796) could be different later on. Problem-solving steps. Problem. Formulate.
E N D
Problem-Solving by Searching Uninformed (Blind) Search Algorithms
Project 1 is out, check class homepageDue in two weeks 9/27/2010 Monday before classProjects for students in different groups (480/580/796) could be different later on
Problem-solving steps Problem Formulate Search/Planning Execute
Example: Romania Find a route from one city (Arad) to the other (Bucharest)
Problem formulation Also called child-generator (Zerind, Sibiu, Timisoara)
Tree search algorithms • Breadth-first search • Uniform-cost search • Depth-first search • A* search Goal test expand fail key
Implementation of search algorithms • FIFO • LIFO • Priority Search algorithms differ based on the specific queuing function they use All search algorithms must do goal-test only when the node is picked up for expansion
Flowchart of search algorithms Initialize queue with the initial state Yes Is the queue empty? Return fail No Remove the first node from the queue Yes Is this node a goal? Return node No Generate children and add them into the queue according to some strategy
Initialize • Is empty? • Remove first • Is goal? • Expand & add Arad Timisoara Sibiu Zerind ??? Fagaras Arad Oradea R.V.
Uninformed vs. informed search • No problem-specific knowledge about states • Can only distinguish a goal state from a non-goal state • Strategies that know whether one non-goal state is “more promising” than another are called informed (heuristic) search
Uninformed search strategies • Also called blind search • Can only distinguish goal state and non-goal state • Do not know which state is more “promising” • Breadth-first search • Uniform-cost search • Depth-first search • Depth-limited search • Iterative deepening depth-first search
Breadth-first search Expand node with the smallest depth first
Initialize queue with the initial state Yes Is the queue empty? Return fail No Remove the first node from the queue Yes Is this node a goal? Return node No Generate children and add them into the queue according to some strategy Where should the new nodes be added in BFS?
Example of breadth-first search • Memory requirements are a bigger problem than is the time • Exponential-complexity search problems cannot be solved by uninformed methods for any but the smallest instances