Search Tuomas Sandholm Read Russell & Norvig Sections

Slides:



Advertisements
Similar presentations
Artificial Intelligent
Advertisements

Solving problems by searching Chapter 3. Outline Problem-solving agents Problem types Problem formulation Example problems Basic search algorithms.
Additional Topics ARTIFICIAL INTELLIGENCE
Solving problems by searching
Review: Search problem formulation
Announcements Course TA: Danny Kumar
Problem Solving by Searching Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 3 Spring 2007.
Problem Solving Agents A problem solving agent is one which decides what actions and states to consider in completing a goal Examples: Finding the shortest.
Solving Problems by Searching Currently at Chapter 3 in the book Will finish today/Monday, Chapter 4 next.
Solving Problem by Searching Chapter 3. Outline Problem-solving agents Problem formulation Example problems Basic search algorithms – blind search Heuristic.
Lets remember about Goal formulation, Problem formulation and Types of Problem. OBJECTIVE OF TODAY’S LECTURE Today we will discus how to find a solution.
Feng Zhiyong Tianjin University Fall  datatype PROBLEM ◦ components: INITIAL-STATE, OPERATORS, GOAL- TEST, PATH-COST-FUNCTION  Measuring problem-solving.
UNINFORMED SEARCH Problem - solving agents Example : Romania  On holiday in Romania ; currently in Arad.  Flight leaves tomorrow from Bucharest.
FOL resolution strategies Tuomas Sandholm Carnegie Mellon University Computer Science Department [Finish reading Russell & Norvig Chapter 9 if you haven’t.
14 Jan 2004CS Blind Search1 Solving problems by searching Chapter 3.
CS 380: Artificial Intelligence Lecture #3 William Regli.
Problem Solving by Searching Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 3 Spring 2004.
Search I Tuomas Sandholm Carnegie Mellon University Computer Science Department [Read Russell & Norvig Chapter 3]
Artificial Intelligence Chapter 3: Solving Problems by Searching
Solving problems by searching
Review: Search problem formulation Initial state Actions Transition model Goal state (or goal test) Path cost What is the optimal solution? What is the.
1 Problem Solving and Searching CS 171/271 (Chapter 3) Some text and images in these slides were drawn from Russel & Norvig’s published material.
Search I Tuomas Sandholm Carnegie Mellon University Computer Science Department Read Russell & Norvig Sections (Also read Chapters 1 and 2 if.
Dr.Abeer Mahmoud ARTIFICIAL INTELLIGENCE (CS 461D) Dr. Abeer Mahmoud Computer science Department Princess Nora University Faculty of Computer & Information.
Lecture 3: Uninformed Search
Advanced Artificial Intelligence Lecture 2: Search.
SOLVING PROBLEMS BY SEARCHING Chapter 3 August 2008 Blind Search 1.
A General Introduction to Artificial Intelligence.
Problem solving by search Department of Computer Science & Engineering Indian Institute of Technology Kharagpur.
Uninformed Search ECE457 Applied Artificial Intelligence Spring 2007 Lecture #2.
Goal-based Problem Solving Goal formation Based upon the current situation and performance measures. Result is moving into a desirable state (goal state).
Solving problems by searching 1. Outline Problem formulation Example problems Basic search algorithms 2.
Solving problems by searching A I C h a p t e r 3.
Blind Search Russell and Norvig: Chapter 3, Sections 3.4 – 3.6 CS121 – Winter 2003.
Search Part I Introduction Solutions and Performance Uninformed Search Strategies Avoiding Repeated States Partial Information Summary.
Search I Tuomas Sandholm Read Russell & Norvig Sections (Also read Chapters 1 and 2 if you haven’t already.) Next time we’ll cover topics related.
Chapter 3 Solving problems by searching. Search We will consider the problem of designing goal-based agents in observable, deterministic, discrete, known.
Lecture 3: Uninformed Search
Solving problems by searching
Problem Solving Agents
EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS
ECE 448 Lecture 4: Search Intro
Introduction to Artificial Intelligence
Uninformed Search Chapter 3.4.
Problem Solving by Searching
Problem Solving as Search
Artificial Intelligence (CS 370D)
Search Tuomas Sandholm Read Russell & Norvig Sections
Artificial Intelligence
Russell and Norvig: Chapter 3, Sections 3.4 – 3.6
Solving problems by searching
CS 188: Artificial Intelligence Spring 2007
CS 188: Artificial Intelligence Fall 2008
Lecture 1B: Search.
Problem Solving and Searching
What to do when you don’t know anything know nothing
EA C461 – Artificial Intelligence
Searching for Solutions
Problem Solving and Searching
Artificial Intelligence
Solving problems by searching
Solving problems by searching
ECE457 Applied Artificial Intelligence Fall 2007 Lecture #2
Solving problems by searching
CMSC 471 Fall 2011 Class #4 Tue 9/13/11 Uninformed Search
Solving Problems by Searching
Solving Problems by Searching
Solving problems by searching
Presentation transcript:

Search Tuomas Sandholm Read Russell & Norvig Sections 3.1-3.4. (Also read Chapters 1 and 2 if you haven’t already.) Next time we’ll cover topics related to Section 6.

Search No map vs. Map Goal-based agent In some applications we are interested in finding a goal node, in other applications we are interested in finding a path to a goal No map vs. Map physical deliberative search search

Search setting “Formulate, Search, Execute” (sometimes interleave search & execution) For now we assume: Full observability, i.e., known state Known effects of actions Data type problem Initial state (perhaps an abstract characterization) vs. partial observability (set) Operators Goal-test (maybe many goals) Path-cost-function Problem formulation can make huge difference in computational efficiency. Things to consider: Actions and states at the right level of detail, i.e., right level of abstraction E.g., in navigating from Arad to Bucharest, not “move leg 2 degrees right” Generally want to avoid symmetries (e.g., in CSPs & MIP discussed later) Some formulations allow tighter bounding (as will be discussed in MIPs later) E.g., edge versus cycle formulation in kidney exchange

Example search problem: 8-puzzle How to model operators? (moving tiles vs. blank) Path cost = 1 (Aside: for n-puzzle, finding a solution is easy, but finding shortest solution is NP-hard)

Example search problem: 8-queens (or n-queens) path cost = 0: in this application we’re interested in a node, not a path Incremental formulation: (constructive search) States: any arrangement of 0 to 8 queens on board Ops: add a queen to any square # sequences = 648 Complete State formulation: (iterative improvement) States: arrangement of 8 queens, 1 in each column Ops: move any attacked queen to another square in the same column Almost a solution to the 8-queen problem: Improved incremental formulation: States: any arrangement of 0 to 8 queens on board with none attacked Ops: place a queen in the left-most empty column such that it is not attacked by any other queen # sequences = 2057 Complexity of the n-queens problem: The decision problem is solvable in constant time since there is a solution for all n > 3. A witnessing solution can be constructed easily (Bell & Stevens, 2009) but note that the witness (a set of n queens) requires n log n bits to specify but this is not polynomial in the size of the input, which is only log n bits. (The n-queens problem has often been incorrectly called NP-hard.) If some of the queens are already in fixed locations, the problem is NP-complete and #P-complete. (Incidentally, even the general class with n queens has an efficient solution, so search would not be the method of choice.)

Other examples of search problems Rubik’s cube ~ 1019 states Cryptarithmetic FORTY 29786 + TEN + 850 + TEN + 850 SIXTY 31486 Real world problems 1. Routing (robots, vehicles, salesman) 2. Scheduling & sequencing 3. Layout (VLSI, Advertisement, Mobile phone link stations) 4. Winner determination in combinatorial auctions 5. Which combination of cycles to accept in kidney exchange? …

Example: Protein folding

Data type node State Parent-node Operator Depth Path-cost Fringe = frontier = open list (as queue)

Partial search tree for route finding from Arad to Bucharest

The general search algorithm (Note that QUEUEING-FN is a variable whose value will be a function)

Measures of performance Completeness Optimality Time Space Guaranteed to find a solution when there is one? Finds an optimal solution? How long does it take to find a solution? How much memory is needed to conduct the search? An aside: A bounded rationality perspective Search cost is about time cost and space cost. Domain cost = path cost Total cost = domain cost + search cost

Uninformed vs. informed search Can only generate successors and distinguish goals from non-goals Strategies that know whether one non-goal is more promising than another

Breadth-First Search function BREADTH-FIRST-SEARCH (problem) returns a solution or failure return GENERAL-SEARCH (problem, ENQUEUE-AT-END) Breadth-first search tree after 0,1,2 and 3 node expansions Head node of open list is circled in green

Breadth-First Search … Max 1 + b + b2 + … + bd nodes (d is the depth of the shallowest goal) Complete Exponential time & memory Θ(bd) Finds optimum if path-cost is a non-decreasing function of the depth of the node

Uniform-Cost Search Insert nodes onto open list in ascending order of g(n). Progression of the search Each node is labeled with g(n) State space G inserted into open list although it is a goal state. Otherwise cheapest path to a goal may not be found. At the next step, the goal node with g=10 will be selected. Finds optimum if the cost of a path never decreases as we go along the path. g(SUCCESSORS(n))  g(n)  (Operator costs  0) If this does not hold, nothing but an exhaustive search is guaranteed to find an optimal solution.

Depth-First Search function DEPTH-FIRST-SEARCH (problem) returns a solution or failure GENERAL-SEARCH (problem, ENQUEUE-AT-FRONT) Nodes currently on the open list are circled in red. Alternatively can use a recursive implementation. Time Θ(bm) (m is the max depth in the space) Space Θ(bm) ! Not complete: m may be  E.g. grid search in one direction Not optimal

Depth-Limited Search Like depth-first search, except: Depth limit in the algorithm, or Operators that incorporate a depth limit L = depth limit Complete if L  d (d is the depth of the shallowest goal) Not optimal (even if one continues the search after the first solution has been found, because an optimal solution may not be within the depth limit L) Θ(bL) time Θ(bL) space “Diameter” of a search space

Iterative Deepening Search

Iterative Deepening Search Complete, optimal, Θ(bd) space What about run time? Breadth first search: 1 + b + b2 + … + bd-1 + bd E.g. b=10, d=5: 1+10+100+1,000+10,000+100,000 = 111,111 Iterative deepening search: (d+1)*1 + (d)*b + (d-1)*b2 + … + 2bd-1 + 1bd E.g. 6+50+400+3000+20,000+100,000 = 123,456 Run time is asymptotically optimal: Θ(bd). We prove this next…

Question Is iterative deepening preferred when branching factor is small or large?

Iterative Deepening Search… If branching factor is large, most of the work is done at the deepest level of search, so iterative deepening does not cost much relatively to breadth-first search. Conclusion: Iterative deepening is preferred when search space is large and depth of (optimal) solution is unknown Not preferred if branching factor is tiny (near 1)

Bi-Directional Search Time Θ(bd/2)

Bi-Directional Search … Need to have operators that calculate predecessors. What if there are multiple goals? If there is an explicit list of goal states, then we can apply a predecessor function to the state set just as we apply the successors function in multiple-state forward search. If there is only a description of the goal set, it MAY be possible to figure out the possible descriptions of “sets of states that would generate the goal set”… Efficient way to check when searches meet: hash table 1-2 step issue if only one side stored in the table Decide what kind of search (e.g., breadth-first) to use in each half. Optimal, complete, Θ(bd/2) time Θ(bd/2) space (even with iterative deepening) because the nodes of at least one of the searches have to be stored to check matches

Summary

Avoiding repeated states More effective & more computational overhead With loops, the search tree may even become infinite

A detail about Option 3 of the previous slide Once a better path to a node is found, all the old descendants (not just children) of that node need to be updated for the new g value This can be done by having both parent and child pointers at each node This can still be a win in overall time because that tree that needs to be updated can still grow later, so we don’t want to replicate it