1 Solving Problems by Searching. 2 Terminology State State Space Goal Action Cost State Change Function Problem-Solving Agent State-Space Search.

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.
Cooperating Intelligent Systems
Uninformed search strategies
Problem Solving and Search Andrea Danyluk September 9, 2013.
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.
Search Strategies Reading: Russell’s Chapter 3 1.
May 12, 2013Problem Solving - Search Symbolic AI: Problem Solving E. Trentin, DIISM.
1 Blind (Uninformed) Search (Where we systematically explore alternatives) R&N: Chap. 3, Sect. 3.3–5.
Solving Problem by Searching Chapter 3. Outline Problem-solving agents Problem formulation Example problems Basic search algorithms – blind search Heuristic.
Implementation and Evaluation of Search Methods. Use a stack data structure. 1. Push root node of tree on the stack. 2. Pop the top node off the stack.
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.
14 Jan 2004CS Blind Search1 Solving problems by searching Chapter 3.
Artificial Intelligence (CS 461D)
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.
Artificial Intelligence Lecture No. 7 Dr. Asad Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
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.
Problem Solving by Searching Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 3 Spring 2004.
Artificial Intelligence
Toy Problem: Missionaries and Cannibals
UnInformed Search What to do when you don’t know anything.
Search I Tuomas Sandholm Carnegie Mellon University Computer Science Department [Read Russell & Norvig Chapter 3]
Artificial Intelligence Chapter 3: Solving Problems by Searching
Introduction to Artificial Intelligence Blind Search Ruth Bergman Fall 2004.
1 Solving Problems by Searching. 2 Terminology State State Space Initial State Goal Test Action Step Cost Path Cost State Change Function State-Space.
Problem Spaces & Search CSE 473. © Daniel S. Weld Topics Agents & Environments Problem Spaces Search & Constraint Satisfaction Knowledge Repr’n.
Blind Search-Part 2 Ref: Chapter 2. Search Trees The search for a solution can be described by a tree - each node represents one state. The path from.
State-Space Searches. 2 State spaces A state space consists of –A (possibly infinite) set of states The start state represents the initial problem Each.
Solving Problems by Searching
Copyright R. Weber Search in Problem Solving Search in Problem Solving INFO 629 Dr. R. Weber.
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.
Lecture 2-2CS250: Intro to AI/Lisp Implementing Search Lecture 2-2 January 14 th /19 th, 1999 CS250.
State-Space Searches. 2 State spaces A state space consists of A (possibly infinite) set of states The start state represents the initial problem Each.
CS.462 Artificial Intelligence SOMCHAI THANGSATHITYANGKUL Lecture 02 : Search.
Artificial Intelligence
AI in game (II) 권태경 Fall, outline Problem-solving agent Search.
For Friday Finish reading chapter 4 Homework: –Lisp handout 4.
Lecture 3: Uninformed Search
1 Solving problems by searching 171, Class 2 Chapter 3.
Problem Spaces & Search CSE 573. © Daniel S. Weld 2 Logistics Mailing list Reading Ch 4.2, Ch 6 Mini-Project I Partners Game Playing?
Search CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
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 strategies A search strategy is defined by picking the order of node expansion Uninformed search strategies use only the information.
Problem Solving as Search. Problem Types Deterministic, fully observable  single-state problem Non-observable  conformant problem Nondeterministic and/or.
Implementation: General Tree Search
Solving problems by searching A I C h a p t e r 3.
1 CS B551: Elements of Artificial Intelligence Instructor: Kris Hauser
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.
Problem Solving Agents
CSE 473 Artificial Intelligence Oren Etzioni
Uninformed Search Strategies
Problem Solving as Search
What to do when you don’t know anything know nothing
CS 2710, ISSP 2160 Foundations of Artificial Intelligence
Problem Spaces & Search
Problem Spaces & Search
Problem Spaces & Search
Presentation transcript:

1 Solving Problems by Searching

2 Terminology State State Space Goal Action Cost State Change Function Problem-Solving Agent State-Space Search

3 Formal State-Space Model Problem = (S, s, A, f, g, c) S = state space s = initial state A = actions f = state change function f: S x A -> S g = goal test function g: S -> {true,false} c = cost function c: S x A x S -> R xy a How do we define a solution? How about an optimal solution?

4 3 Coins Problem A Very Small State Space Problem There are 3 (distinct) coins: coin1, coin2, coin3. The initial state is H H T The legal operations are to turn over exactly one coin. –1 (flip coin1), 2 (flip coin2), 3 (flip coin3) There are two goal states: H H H T T T What are S, s, A, f, g, c ?

5 State-Space Graph HTT TTT THH HHH HHTTHT TTH HTH What are some solutions? What if the problem is changed to allow only 3 actions?

6 Modified State-Space Problem How would you define a state for the new problem? How do you define the operations (1, 2, 3) with this new state definition? What do the paths to the goal states look like now?

7 How do we build a search tree for the modified 3 coins problem? initial state 1 2 3

8 The 8-Puzzle Problem B B one initial state goal state B=blank 1.Formalize a state as a data structure 2.Show how start and goal states are represented. 3.How many possible states are there? 4.How would you specify the state-change function? 5.What is the goal test? 6.What is the path cost function? 7.What is the complexity of the search?

9 Search Tree Example: Fragment of 8-Puzzle Problem Space

10 Another Example: N Queens Input: –Set of states –Operators [and costs] –Start state –Goal state (test) Output Q Q Q Q

11 Example: Route Planning Input: –Set of states –Operators [and costs] –Start state –Goal state (test) Output:

12 Search Strategies Blind Search (Ch 3) Informed Search (Ch 4) Constraint Satisfaction (Ch 5) –Depth first search –Breadth first search –Depth limited search –Iterative deepening search

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

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

15 The Missionaries and Cannibals Problem (from text problem 3.9) Three missionaries and three cannibals are on one side of a river, along with a boat that can hold one or two people. If there are ever more cannibals than missionaries on one side of the river, the cannibals will eat the missionaries. (We call this a “dead” state.) Find a way to get everyone to the other side, without anyone getting eaten.

16 Missionaries and Cannibals Problem

17 Missionaries and Cannibals Problem Left Bank Right Bank River

18 Missionary and Cannibals Notes Define your state as (M,C,S) –M: number of missionaries on left bank –C: number of cannibals on left bank –S: side of the river that the boat is on When the boat is moving, we are in between states. When it arrives, everyone gets out.

19 When is a state considered “DEAD”? 1.There are more cannibals than missionaries on the left bank. (Bunga-Bunga) 2.There are more cannibals than missionaries on the right bank. (Bunga-Bunga) 3.There is an ancestor state of this state that is exactly the same as this state. (Why?)

20 Assignment (problem 3.9b, which is part of the first homework set) Implement and solve the problem –First with a blind depth-first search using a stack and/or recursion. –Second with a blind breadth-first search. –Definitely avoid repeated states. –Keep track of how many states are searched in each. Use the computer language of your choice for this assignment. –Java –C++ –Lisp or Lisp variant

21 Is memory a limitation in search? Suppose: 2 GHz CPU 1 GB main memory 100 instructions / expansion 5 bytes / node 200,000 expansions / sec Memory filled in 100 sec … < 2 minutes

22 Iterative Deepening Search a b c d e f gh DFS with limit; incrementally grow limit Evaluation –Complete? –Time Complexity? –Space Complexity? Yes O(b^d) O(d) j i k L

23 Cost of Iterative Deepening bratio ID to DFS

24 Forwards vs. Backwards start end

25 vs. Bidirectional

26 Problem All these methods are too slow for real applications (blind) Solution  add guidance  “informed search”