Now would be a good time to kill your cell phone, and disconnect from the internet. For next time, print Heuristic Search.ppt slides.

Slides:



Advertisements
Similar presentations
Solving problems by searching Chapter 3. Outline Problem-solving agents Problem types Problem formulation Example problems Basic search algorithms.
Advertisements

Review: Search problem formulation
Uninformed search strategies
Classic AI Search Problems
Problem Solving by Searching Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 3 Spring 2007.
Farmer, Wolf, Goat, Cabbage Farmer, Fox, Chicken, Corn Farmer Dog, Rabbit, Lettuce The Farmer, Wolf, Duck, Corn Problem A farmer with his wolf, duck and.
January 26, 2003AI: Chapter 3: Solving Problems by Searching 1 Artificial Intelligence Chapter 3: Solving Problems by Searching Michael Scherger Department.
Comp 307 Problem Solving and Search Formalize a problem as State Space Search Blind search strategies Heuristic search.
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.
1 Lecture 3 Uninformed Search. 2 Uninformed search strategies Uninformed: While searching you have no clue whether one non-goal state is better than any.
Solving Problems by Searching Currently at Chapter 3 in the book Will finish today/Monday, Chapter 4 next.
CS 480 Lec 3 Sept 11, 09 Goals: Chapter 3 (uninformed search) project # 1 and # 2 Chapter 4 (heuristic search)
Blind Search1 Solving problems by searching Chapter 3.
May 12, 2013Problem Solving - Search Symbolic AI: Problem Solving E. Trentin, DIISM.
1 Chapter 3 Solving Problems by Searching. 2 Outline Problem-solving agentsProblem-solving agents Problem typesProblem types Problem formulationProblem.
Solving Problem by Searching Chapter 3. Outline Problem-solving agents Problem formulation Example problems Basic search algorithms – blind search Heuristic.
Search Search plays a key role in many parts of AI. These algorithms provide the conceptual backbone of almost every approach to the systematic exploration.
Touring problems Start from Arad, visit each city at least once. What is the state-space formulation? Start from Arad, visit each city exactly once. What.
Artificial Intelligence (CS 461D)
Feng Zhiyong Tianjin University Fall  datatype PROBLEM ◦ components: INITIAL-STATE, OPERATORS, GOAL- TEST, PATH-COST-FUNCTION  Measuring problem-solving.
14 Jan 2004CS Blind Search1 Solving problems by searching Chapter 3.
An Introduction to Artificial Intelligence Lecture 3: Solving Problems by Sorting Ramin Halavati In which we look at how an agent.
CS 380: Artificial Intelligence Lecture #3 William Regli.
Review: Search problem formulation
Problem Solving by Searching Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 3 Spring 2004.
Artificial Intelligence Problem solving by searching CSC 361
Search I Tuomas Sandholm Carnegie Mellon University Computer Science Department [Read Russell & Norvig Chapter 3]
Artificial Intelligence Chapter 3: Solving Problems by Searching
1 Lecture 3 Uninformed Search. 2 Complexity Recap (app.A) We often want to characterize algorithms independent of their implementation. “This algorithm.
Artificial Intelligence Methods Rao Vemuri Searching - 2.
1 Lecture 3 Uninformed Search
Problem-solving agents
Artificial Intelligence Problem solving by searching CSC 361 Prof. Mohamed Batouche Computer Science Department CCIS – King Saud University Riyadh, Saudi.
Artificial Intelligence Problem solving by searching CSC 361
Lecture 3 Uninformed Search.
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.
AI in game (II) 권태경 Fall, outline Problem-solving agent Search.
For Friday Finish reading chapter 4 Homework: –Lisp handout 4.
For Monday Read chapter 4, section 1 No homework..
Lecture 3: Uninformed Search
G5BAIM Artificial Intelligence Methods Graham Kendall Searching.
An Introduction to Artificial Intelligence Lecture 3: Solving Problems by Sorting Ramin Halavati In which we look at how an agent.
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.
For Friday Read chapter 4, sections 1 and 2 Homework –Chapter 3, exercise 7 –May be done in groups.
1 Solving problems by searching Chapter 3. Depth First Search Expand deepest unexpanded node The root is examined first; then the left child of the root;
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.
Uninformed search strategies A search strategy is defined by picking the order of node expansion Uninformed search strategies use only the information.
Introduction to Artificial Intelligence (G51IAI) Dr Rong Qu Blind Searches - Introduction.
Now would be a good time to kill your cell phone, and disconnect from the internet. For next time, print Heuristic Search.ppt slides.
Chapter 3 Solving problems by searching. Search We will consider the problem of designing goal-based agents in observable, deterministic, discrete, known.
Artificial Intelligence Solving problems by searching.
Lecture 3: Uninformed Search
Now would be a good time to kill your cell phone, and disconnect from the internet. For next time, print Heuristic Search.ppt slides.
General (Generic) Search Algorithm
Introduction to Artificial Intelligence
Uninformed Search Chapter 3.4.
Problem Solving by Searching
Artificial Intelligence (CS 370D)
Solving problems by searching
Problem Solving and Searching
Searching for Solutions
Problem Solving and Searching
Search Strategies CMPT 420 / CMPG 720.
Solving Problems by Searching
Presentation transcript:

Now would be a good time to kill your cell phone, and disconnect from the internet. For next time, print Heuristic Search.ppt slides

Due to the graphic nature of the following slides, user discretion is advised.

All grads are considered guilty until proven innocent in a court of law.

FWDC WDC F DC FW WC FD WD FC FWC D FWDC W FDC FWC D WC FD C FWD FC WD FDC W D FWC FWD C FW DC FWC D WD FC W FDC C FWD DC FW D FWC FDC W FWD C FD WC FWDC D FWC Goal StateRepeated StateIllegal State Search Tree for “Farmer, Wolf, Duck, Corn” Last time we saw

A farm hand was sent to a nearby pond to fetch 8 gallons of water. He was given two pails - one 11, the other 6 gallons. How can he measure the requested amount of water? Sliding Tile Puzzle You can slide any of the numbered tiles into the blank space. Can you arrange the numbers into order? Can you place 8 queens on a chessboard such that no piece is attacking another? Find a route from LAX to the Golden Gate bridge that minimizes the driving time,...that minimizes the mileage,...that minimizes the number of Taco Bells you must pass. Which tree shows the correct relationship between gorilla, chimp and man? When you have just 3 animals, there are only three possible trees... Last time we saw…

Problem Solving using Search A Problem Space consists of The current state of the world (initial state) A description of the actions we can take to transform one state of the world into another (operators). A description of the desired state of the world (goal state), this could be implicit or explicit. A solution consists of the goal state*, or a path to the goal state. * Problems were the path does not matter are known as “constraint satisfaction” problems.

Initial StateGoal StateOperators Slide blank square left. Slide blank square right. …. FWDC Move F Move F with W …. Distributive property Associative property... Add a queen such that it does not attack other, previously placed queens. A 4 by 4 chessboard with 4 queens placed on it such that none are attacking each other Queens

Representing the states A state space should describe Everything that is needed to solve the problem. Nothing that is not needed to solve the problem. In general, many possible representations are possible, choosing a good representation will make solving the problem much easier. For the 8-puzzle 3 by 3 array 5, 6, 7 8, 4, BLANK 3, 1, 2 A vector of length nine 5,6,7,8,4, BLANK,3,1,2 A list of facts Upper_left = 5 Upper_middle = 6 Upper_right = 7 Middle_left = 8 …. Choose the representation that make the operators easiest to implement.

Operators I Single atomic actions that can transform one state into another. You must specify an exhaustive list of operators, otherwise the problem may be unsolvable. Operators consist of Precondition: Description of any conditions that must be true before using the operator. Instruction on how the operator changes the state. In general, for any given state, not all operators are possible. Examples: In FWDC, the operator Move_Farmer_Left is not possible if the farmer is already on the left bank. In this 8-puzzle, The operator Move_6_down is possible But the operator Move_7_down is not

Operators II Example: For the eight puzzle we could have... Move 1 left Move 1 right Move 1 up Move 1 down Move 2 left Move 2 right Move 2 up Move 2 down Move 3 left Move 3 right Move 3 up Move 3 down Move 4 left … There are often many ways to specify the operators, some will be much easier to implement... Move Blank left Move Blank right Move Blank up Move Blank down Or

A complete example: The Water Jug Problem  Two jugs of capacity 4 and 3 units.  It is possible to empty a jug, fill a jug, transfer the content of a jug to the other jug until the former empties or the latter fills.  Task: Produce a jug with 2 units. A farm hand was sent to a nearby pond to fetch 2 gallons of water. He was given two pails - one 4, the other 3 gallons. How can he measure the requested amount of water? Abstract away unimportant details State representation (X, Y) X is the content of the 4 unit jug. Y is the content of the 3 unit jug. Initial State (0, 0) Goal State (2, n) Operators Fill 3-jug from faucet (a, b)  (a, 3) Fill 4-jug from faucet (a, b)  (4, b) Fill 4-jug from 3-jug (a, b)  (a + b, 0)... Define a state representation Define an initial state Define an goal state(s) May be a description rather than explicit state Define all operators

Once we have defined the problem space (state representation, the initial state, the goal state and operators) are we are done? We start with the initial state and keep using the operators to expand the parent nodes till we find a goal state. …but the search space might be large… …really large… So we need some systematic way to search.

The average number of new nodes we create when expanding a new node is the (effective) branching factor b. The length of a path to a goal is the depth d. A Generic Search Tree b b2b2 bdbd So visiting every the every node in the search tree to depth d will take O(b d ) time. Not necessarily O(b d ) space. Fringe (Frontier) Set of nonterminal nodes without children I.e nodes waiting to be expanded.

Branching factors for some problems The eight puzzle has a branching factor of 2.13, so a search tree at depth 20 has about 3.7 million nodes. (note that there only 181,400 different states). Rubik’s cube has a branching factor of There are 901,083,404,981,813,616 different states. The average depth of a solution is about 18. The best time for solving the cube in an official championship was sec, achieved by Robert Pergl in the 1983 Czechoslovakian Championship. Chess has a branching factor of about 35, there are about states (there are about electrons in the universe)

Detecting repeated states is hard….

We are going to consider different techniques to search the problem space, we need to consider what criteria we will use to compare them. Completeness: Is the technique guaranteed to find an answer (if there is one). Optimality: Is the technique guaranteed to find the best answer (if there is more than one). (operators can have different costs) Time Complexity: How long does it take to find a solution. Space Complexity: How much memory does it take to find a solution.

General (Generic) Search Algorithm function general-search(problem, QUEUEING-FUNCTION) nodes = MAKE-QUEUE(MAKE-NODE(problem.INITIAL-STATE)) loop do if EMPTY(nodes) then return "failure" node = REMOVE-FRONT(nodes) if problem.GOAL-TEST(node.STATE) succeeds then return node nodes = QUEUEING-FUNCTION(nodes, EXPAND(node, problem.OPERATORS)) end A nice fact about this search algorithm is that we can use a single algorithm to do many kinds of search. The only difference is in how the nodes are placed in the queue.

Breadth First Search Enqueue nodes in FIFO (first-in, first-out) order. Complete? Yes. Optimal? Yes. Time Complexity: O(b d ) Space Complexity: O(b d ), note that every node in the fringe is kept in the queue. Intuition: Expand all nodes at depth i before expanding nodes at depth i + 1

Uniform Cost Search Enqueue nodes in order of cost Complete? Yes. Optimal? Yes, if path cost is nondecreasing function of depth Time Complexity: O(b d ) Space Complexity: O(b d ), note that every node in the fringe keep in the queue. Intuition: Expand the cheapest node. Where the cost is the path cost g(n) Note that Breadth First search can be seen as a special case of Uniform Cost Search, where the path cost is just the depth.

Depth First Search Enqueue nodes in LIFO (last-in, first-out) order. Complete? No (Yes on finite trees, with no loops). Optimal? No Time Complexity: O(b m ), where m is the maximum depth. Space Complexity: O(bm), where m is the maximum depth. Intuition: Expand node at the deepest level (breaking ties left to right)

Depth-Limited Search Enqueue nodes in LIFO (last-in, first-out) order. But limit depth to L Complete? Yes if there is a goal state at a depth less than L Optimal? No Time Complexity: O(b L ), where L is the cutoff. Space Complexity: O(bL), where L is the cutoff. Intuition: Expand node at the deepest level, but limit depth to L L is 2 in this example Picking the right value for L is a difficult, Suppose we chose 7 for FWDC, we will fail to find a solution...

Iterative Deepening Search I Do depth limited search starting a L = 0, keep incrementing L by 1. Complete? Yes Optimal? Yes Time Complexity: O(b d ), where d is the depth of the solution. Space Complexity: O(bd), where d is the depth of the solution. Intuition: Combine the Optimality and completeness of Breadth first search, with the low space complexity of Depth first search

Iterative Deepening Search II , ,000 = 111, , , ,000 = 123,456 Consider a problem with a branching factor of 10 and a solution at depth 5... Iterative deepening looks wasteful because we reexplore parts of the search space many times...

Bi-directional Search Intuition: Start searching from both the initial state and the goal state, meet in the middle. Complete? Yes Optimal? Yes Time Complexity: O(b d/2 ), where d is the depth of the solution. Space Complexity: O(b d/2 ), where d is the depth of the solution. Notes Not always possible to search backwards How do we know when the trees meet? At least one search tree must be retained in memory.

A BC ED HI JKLMNO GF