Search I: Chapter 3 Aim: achieving generality Q: how to formulate a problem as a search problem?

Slides:



Advertisements
Similar presentations
Constraint Satisfaction Problems
Advertisements

Informed search algorithms
Artificial Intelligence Presentation
An Introduction to Artificial Intelligence
State Space Representation and Search
Local Search Algorithms Chapter 4. Outline Hill-climbing search Simulated annealing search Local beam search Genetic algorithms Ant Colony Optimization.
Ch 4. Heuristic Search 4.0 Introduction(Heuristic)
ICS-271:Notes 5: 1 Lecture 5: Constraint Satisfaction Problems ICS 271 Fall 2008.
Iterative Deepening A* & Constraint Satisfaction Problems Lecture Module 6.
Optimality of A*(standard proof) Suppose suboptimal goal G 2 in the queue. Let n be an unexpanded node on a shortest path to optimal goal G. f(G 2 ) =
CS 480 Lec 3 Sept 11, 09 Goals: Chapter 3 (uninformed search) project # 1 and # 2 Chapter 4 (heuristic search)
CPSC 322, Lecture 10Slide 1 Finish Search Computer Science cpsc322, Lecture 10 (Textbook Chpt 3.6) January, 28, 2008.
4 Feb 2004CS Constraint Satisfaction1 Constraint Satisfaction Problems Chapter 5 Section 1 – 3.
1 Chapter 5 Advanced Search. 2 Chapter 5 Contents l Constraint satisfaction problems l Heuristic repair l The eight queens problem l Combinatorial optimization.
Constraint Satisfaction CSE 473 University of Washington.
Problem Spaces & Search CSE 473. © Daniel S. Weld Topics Agents & Environments Problem Spaces Search & Constraint Satisfaction Knowledge Repr’n.
Informed Search CSE 473 University of Washington.
Outline Introduction & Logistics Textbook: Russell and Norvig chapters 3, 4 and 5. Notion of a Problem Space Search Techniques Constraint Satisfaction.
CS121 Heuristic Search Planning CSPs Adversarial Search Probabilistic Reasoning Probabilistic Belief Learning.
Uninformed Search (cont.)
Heuristics CSE 473 University of Washington. © Daniel S. Weld Topics Agency Problem Spaces SearchKnowledge Representation Planning PerceptionNLPMulti-agentRobotics.
Brute Force Search Depth-first or Breadth-first search
Copyright R. Weber Search in Problem Solving Search in Problem Solving INFO 629 Dr. R. Weber.
Heuristic Search In addition to depth-first search, breadth-first search, bound depth-first search, and iterative deepening, we can also use informed or.
CPS 270: Artificial Intelligence More search: When the path to the solution doesn’t matter Instructor: Vincent.
1 Chapter 5 Advanced Search. 2 Chapter 5 Contents l Constraint satisfaction problems l Heuristic repair l The eight queens problem l Combinatorial optimization.
Chapter 3. Problem Solving Agents Looking to satisfy some goal Wants environment to be in particular state Have a number of possible actions An action.
Constraint Satisfaction CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Searching by Constraint CMSC Artificial Intelligence January 24, 2008.
Hande ÇAKIN IES 503 TERM PROJECT CONSTRAINT SATISFACTION PROBLEMS.
Outline for 4/2 Introduction & Logistics Notion of a Problem Space Search Techniques Video: Kasparov vs. Deep Blue Constraint Satisfaction Techniques.
Lecture 3: Uninformed Search
Problem Spaces & Search CSE 573. © Daniel S. Weld 2 Logistics Mailing list Reading Ch 4.2, Ch 6 Mini-Project I Partners Game Playing?
Chapter 5 Constraint Satisfaction Problems
Artificial Intelligence for Games Informed Search (2) Patrick Olivier
Review Test1. Robotics & Future Technology Future of Intelligent Systems / Ray Kurzweil futurist Ray Kurzweil / A Long Bet A Long Bet / Robot Soccer.
Outline for 3/28 Introduction & Logistics Textbook: chapters 3, 4 and 5. Notion of a Problem Space Search Techniques Constraint Satisfaction Techniques.
CHAPTER 5 SECTION 1 – 3 4 Feb 2004 CS Constraint Satisfaction 1 Constraint Satisfaction Problems.
1 Solving Problems by Searching. 2 Terminology State State Space Goal Action Cost State Change Function Problem-Solving Agent State-Space Search.
Problem Spaces & Search Dan Weld CSE 573. © Daniel S. Weld 2 Logistics Read rest of R&N chapter 4 Also read chapter 5 PS 1 will arrive by , so be.
CPSC 322, Lecture 6Slide 1 Uniformed Search (cont.) Computer Science cpsc322, Lecture 6 (Textbook finish 3.5) Sept, 17, 2012.
1. 2 Outline of Ch 4 Best-first search Greedy best-first search A * search Heuristics Functions Local search algorithms Hill-climbing search Simulated.
CHAPTER 2 SEARCH HEURISTIC. QUESTION ???? What is Artificial Intelligence? The study of systems that act rationally What does rational mean? Given its.
Constraint Propagation Artificial Intelligence CMSC January 22, 2002.
3.5 Informed (Heuristic) Searches This section show how an informed search strategy can find solution more efficiently than uninformed strategy. Best-first.
Biointelligence Lab School of Computer Sci. & Eng. Seoul National University Artificial Intelligence Chapter 8 Uninformed Search.
CMPT 463. What will be covered A* search Local search Game tree Constraint satisfaction problems (CSP)
Artificial Intelligence Chapter 11 Alternative Search Formulations and Applications.
Alternative Search Formulations and Applications
CS 460 Spring 2011 Lecture 4.
Logistics Problem Set 1 Mailing List Due 10/13 at start of class
CSE 473 Artificial Intelligence Oren Etzioni
Instructor: Vincent Conitzer
Biointelligence Lab School of Computer Sci. & Eng.
CSE 4705 Artificial Intelligence
Problem Spaces & Search
Problem Spaces & Search
Artificial Intelligence Chapter 8 Uninformed Search
Biointelligence Lab School of Computer Sci. & Eng.
Approaches to search Simple search Heuristic search Genetic search
Problem Spaces & Search
Constraint Satisfaction
CS 8520: Artificial Intelligence
Search.
SEG 4560 Midterm Review.
Search.
Midterm Review.
Constraint Satisfaction Problems
Presentation transcript:

Search I: Chapter 3 Aim: achieving generality Q: how to formulate a problem as a search problem?

Search (one solution) Brute force –DFS, BFS, iterative deepening, iterative broadening Heuristic –Best first, beam, hill climbing, simulated annealing, limited discrepancy Optimizing –Branch & bound, A*, IDA*, SMA* Adversary Search –Minimax, alpha-beta, conspiracy search Constraint Satisfaction –As search, preprocessing, backjumping, forward checking, dynamic variable ordering

Search (Internet and Databases) Look for all solutions Must be efficient Often uses indexing Also uses heuristics (e.g., Google ) More than search itself –NLP can be important –Scale up to thousands of users –Caching is often used

Outline Defining a Search Space Types of Search –Blind –Heuristic –Optimization –Adversary Search –Constraint Satisfaction Analysis –Completeness –Time & Space Complexity

5 Specifying a search problem? What are states (nodes in graph)? What are the operators (arcs between nodes)? Initial state? Goal test? [Cost?, Heuristics?, Constraints?] E.g., Eight Puzzle

Example: Fragment of 8-Puzzle Problem Space

Recap: Search thru a –Set of states –Operators [and costs] –Start state –Goal state [test] –Path: start  a state satisfying goal test –[May require shortest path] Input: Output: Problem Space / State Space

Cryptarithmetic SEND + MORE MONEY Input: –Set of states –Operators [and costs] –Start state –Goal state (test) Constraints: –Assign only integers to letters –no two letters share same digits Output:

Concept Learning Labeled Training Examples <p4,… Output: f:  {ok, ter} Input: –Set of states –Operators [and costs] –Start state –Goal state (test) Output:

Symbolic Integration E.g. x 2 e x dx = e x (x 2 -2x+2) + C  Operators: Integration by parts Integration by substitution …

11 Towers of Hanoi What are states (nodes in graph)? What are the operators (arcs between nodes)? Initial state? Goal test? a bc

Towers of Hanoi: Domain (define (domain hanoi) (:predicates (on ?disk1 ?disk2) (smaller ?disk1 ?disk2) (clear ?disk)) (:action MOVE :parameters(?disk ?source ?dest) :precondition (and (clear ?disk) (on ?disk ?source) (clear ?dest) (smaller ?disk ?dest)) :effect (and (on ?disk ?dest) (not (on ?disk ?source)) (not (clear ?dest)) (clear ?source))))

Problem Instance: 4 Disks (define (problem hanoi4) (:domain hanoi) (:length (:parallel 15)) (:objects D1 D2 D3 D4 P1 P2 P3) (:init (on D1 D2) (on D2 D3) (on D3 D4) (on D4 P1) (clear D1) (clear P2) (clear P3) (smaller D1 D2) (smaller D1 D3) (smaller D1 D4) (smaller D1 P1) etc. (:goal (and (on D1 D2) (on D2 D3) (on D3 D4) (on D4 P3))))

Water Jug You are given two jugs, a 4-gallon one and a 3-gallon one. Neither has any measure markers on it. There is a pump that can be used to fill the jugs with water. How can you get exactly 2 gallons of water into the 4-gallon jug?

Waterjug (x, y) (2, 0) ->(…) In one step? –(3, 0) –(0, 0) –(2, 4) –? Fillx: (x, y) –precond: (x<3) –Postcond: (3, y) Pour all of y into x: –Precond: x+y<3 –Postcond (x+y, 0)

16 Planning What is Search Space? –What are states? –What are arcs? What is Initial State? What is Goal? Path Cost? Heuristic? a c b c b a PickUp(Block) PutDown(Block)

Blocks World Standard benchmark domain for search algorithms Robot arm(s) can pick up blocks and stack them on other blocks Straight stack constraint: at most one block can be on a block; any number can be on the table Multiple arms operate synchronously in parallel

Blocks World in PDDL (:predicates (on ?x ?y) (on-table ?x) (clear ?x) (arm-empty ?a) (holding ?a ?x)) (:action pick-up :parameters (?a ?obj) :precondition (and (clear ?obj) (on-table ?obj) (arm-empty ?a)) :effect (and (not (on-table ?obj)) (not (clear ?obj)) (not (arm-empty ?a)) (holding ?a ?obj)))

Blocks World in PDDL (:action put-down :parameters (?a ?obj) :precondition (holding ?a ?obj) :effect (and (not (holding ?a ?obj) (clear ?ob) (arm-empty ?a) (on-table ?obj)))

Blocks World in PDDL (:action stack :parameters (?a ?obj ?underobj) :precondition (and (holding ?a ?obj) (clear ?underobj)) :effect (and (not (holding ?a ?obj)) (not (clear ?underobj)) (clear ?obj) (arm-empty ?a) (on ?obj ?underobj)))

Blocks World in PDDL (:action unstack :parameters (?a ?sob ?underobj) :precondition (and (on ?obj ?underobj) (clear ?obj) (arm-empty ?a)) :effect (and (holding ?a ?obj) (clear ?underobj) (not (clear ?obj)) (not (arm-empty ?a)) (not (on ?obj ?underobj)))))

Problems in PDDL ;;; bw-large-a ;;; ;;; Initial: 3/2/1 5/4 9/8/7/6 ;;; Goal: 1/5 8/9/4 2/3/7/6 (define (problem bw-large-a) (:domain prodigy-bw) (:objects a1 a2) (:init (arm-empty a1) (arm-empty a2) (on 3 2) (on 2 1) etc

23 Missionaries and Cannibals m m m c c c. What are states (nodes in graph)? What are the operators (arcs between nodes)? Initial state? Goal test? Try at least 2 Representations

24 Search Strategies Blind Search –Depth first search –Breadth first search –Iterative deepening search –Iterative broadening search Heuristic Search Optimizing Search Constraint Satisfaction

Tree-Search (problem, fringe) returns a solution, or failure Page 72 of R&N fringe <- Insert (Make-Node (Initial-State (problem))); Loop do –If fringe is empty then return failure; –node <- Remove-First (fringe); –If Goal-Test(problem) applied to State(node) succeeds then return Solution (node); –fringe = Insert-All (Expand (node, problem), fringe); End Loop (solution returns the sequence of actions obtained by following parent pointers back to the root)

What is in a node? State = m(i, j) (in 8-puzzle) Action=the last action taken to get to state Depth from root of tree Path-Cost from root of tree (assume we know step cost). Parent node pointer

Expand(node, problem) returns a set of nodes Page 72 of R&N Successors = empty set; For each in ; result = after applying action Successor-FN[problem](State[node]) do –S = a new node –State[S]=result; parent-node[S]=node; action[S]=action –Path-cost[S]=path-cost[node]+step-cost[node, action, S]; –Depth=depth[node]+1; –add S to Successors Return Successors

Search with Trees Consider an example Page 76 of text Initially: fringe = [A] Look for goal: M

Heuristic Search A heuristic function is: –Function from a state to a real number Low number means state is close to goal High number means state is far from the goal –Every node has a function f(node)! Designing a good heuristic is very important! (And hard) More on this in a bit...

Depth First Search a b de c f gh Maintain stack of nodes to visit for fringe Evaluation –Complete? –Time Complexity? –Space Complexity? Not for infinite spaces O(b^d) O(d)

Breadth First Search a b c def gh Maintain queue of nodes to visit for fringe Evaluation –Complete? –Time Complexity? –Space Complexity? Yes O(b^d)

Iterative Deepening Search DFS with limit; incrementally grow limit (page78) a b c

Iterative Deepening Search DFS with limit; incrementally grow limit Evaluation –Complete? –Time Complexity? –Space Complexity? Yes O(b^d) O(d) b de c f gh a

Iterative Deepening DFS For depth = 0 to infinity do –result = Depth-Limited-Search (problem, depth); –If result != cutoff, then, return result;

Complexity of IDS? Space? Best Time? Worst Time? Avg Time?