Introduction to State Space Search

Slides:



Advertisements
Similar presentations
Solving problems by searching
Advertisements

Announcements Course TA: Danny Kumar
Artificial Intelligence Solving problems by searching
Problem Solving by Searching Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 3 Spring 2007.
And-Or Graphs CSCE 580 Spr03 Instructor: Marco Valtorta Hrishikesh J. Goradia Seang-Chan Ryu.
Part2 AI as Representation and Search
Solving Problem by Searching Chapter 3. Outline Problem-solving agents Problem formulation Example problems Basic search algorithms – blind search Heuristic.
Graphs Graphs are the most general data structures we will study in this course. A graph is a more general version of connected nodes than the tree. Both.
1 State-Space representation and Production Systems Introduction: what is State-space representation? (E.Rich, Chapt.2) Basis search methods. (Winston,
Best-First Search: Agendas
1 Solving problems by searching Chapter 3. 2 Why Search? To achieve goals or to maximize our utility we need to predict what the result of our actions.
Search: Representation and General Search Procedure Jim Little UBC CS 322 – Search 1 September 10, 2014 Textbook § 3.0 –
Problem Solving and Search in AI Part I Search and Intelligence Search is one of the most powerful approaches to problem solving in AI Search is a universal.
Problem Solving by Searching
Search: Representation and General Search Procedure CPSC 322 – Search 1 January 12, 2011 Textbook § 3.0 –
1 Solving problems by searching Chapter 3. 2 Why Search? To achieve goals or to maximize our utility we need to predict what the result of our actions.
Problem Solving by Searching Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 3 Spring 2004.
1 Search Problems (Where reasoning consists of exploring alternatives) R&N: Chap. 3, Sect. 3.1–
November 10, 2009Introduction to Cognitive Science Lecture 17: Game-Playing Algorithms 1 Decision Trees Many classes of problems can be formalized as search.
Search I Tuomas Sandholm Carnegie Mellon University Computer Science Department [Read Russell & Norvig Chapter 3]
Introduction to Artificial Intelligence Problem Solving Ruth Bergman Fall 2002.
Solving problems by searching
CSE (c) S. Tanimoto, 2007 Search 1: State Spaces 1 State-Space Search Outline: Demonstration with T* State spaces, operators, moves A Puzzle: The.
Problem-solving agents
1 Solving problems by searching Chapter 3. 2 Why Search? To achieve goals or to maximize our utility we need to predict what the result of our actions.
Solving problems by searching This Lecture Read Chapters 3.1 to 3.4 Next Lecture Read Chapter 3.5 to 3.7 (Please read lecture topic material before and.
Data Structures Using C++ 2E Chapter 6 Recursion.
3.0 State Space Representation of Problems 3.1 Graphs 3.2 Formulating Search Problems 3.3 The 8-Puzzle as an example 3.4 State Space Representation using.
Solving Problems by Searching CPS Outline Problem-solving agents Example problems Basic search algorithms.
Data Structures Using C++ 2E Chapter 6 Recursion.
Lecture 5: Backtracking Depth-First Search N-Queens Problem Hamiltonian Circuits.
1 Solving problems by searching This Lecture Chapters 3.1 to 3.4 Next Lecture Chapter 3.5 to 3.7 (Please read lecture topic material before and after each.
HISTORY The problem was originally proposed in 1848 by the chess player Max Bezzel, and over the years, many mathematicians, including Gauss have worked.
Dr.Abeer Mahmoud ARTIFICIAL INTELLIGENCE (CS 461D) Dr. Abeer Mahmoud Computer science Department Princess Nora University Faculty of Computer & Information.
Problems, Problem Spaces and Search
AI in game (II) 권태경 Fall, outline Problem-solving agent Search.
1 Solving problems by searching 171, Class 2 Chapter 3.
Problem solving by search Department of Computer Science & Engineering Indian Institute of Technology Kharagpur.
Solving problems by searching 1. Outline Problem formulation Example problems Basic search algorithms 2.
Problem Reduction So far we have considered search strategies for OR graph. In OR graph, several arcs indicate a variety of ways in which the original.
Artificial Intelligence Lecture No. 6 Dr. Asad Ali Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
Introduction to Artificial Intelligence (G51IAI) Dr Rong Qu Blind Searches - Introduction.
Search in State Spaces Problem solving as search Search consists of –state space –operators –start state –goal states A Search Tree is an efficient way.
Chapter 13 Backtracking Introduction The 3-coloring problem
Solving problems by searching
February 11, 2016Introduction to Artificial Intelligence Lecture 6: Search in State Spaces II 1 State-Space Graphs There are various methods for searching.
G5AIAI Introduction to AI
Lecture 2: Problem Solving using State Space Representation CS 271: Fall, 2008.
Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3 CS121 – Winter 2003.
Solving problems by searching Chapter 3. Types of agents Reflex agent Consider how the world IS Choose action based on current percept Do not consider.
ARTIFICIAL INTELLIGENCE
Solving problems by searching
ECE 448 Lecture 4: Search Intro
Introduction to Artificial Intelligence
Artificial Intelligence Lecture No. 6
Problem Solving by Searching
Lecture 13: Tree Traversals Algorithms on Trees.
CSE (c) S. Tanimoto, 2001 Search-Introduction
Russell and Norvig: Chapter 3, Sections 3.1 – 3.3
Solving problems by searching
Solving problems by searching
CSE (c) S. Tanimoto, 2002 State-Space Search
Two – One Problem Legal Moves: Slide Rules: 1s’ move right Hop
Two – One Problem Legal Moves: Slide Rules: 1s’ move right Hop
CSE (c) S. Tanimoto, 2004 State-Space Search
Solving problems by searching
Solving Problems by Searching
Unit II Game Playing.
Solving problems by searching
Presentation transcript:

Introduction to State Space Search Lecture 3: Introduction to State Space Search

State Space Search The set of all possible states – the arrangements of the elements or components to be used in solving a problem – forms the space of states for the problem. This is known as the state space.

Goal Directed Agent A goal directed agent needs to achieve certain goals. Such an agent selects its actions based on the goal it has. Many problems can be represented as a set of states and a set of rules of how one state is transformed to another.

State space Each state is an abstract representation of the agent's environment. It is an abstraction that denotes a configuration of the agent. Initial state : The description of the starting configuration of the agent An action/ operator takes the agent from one state to another state. A state can have a number of successor states. A plan is a sequence of actions.

State space A goal is a description of a set of desirable states of the world. Goal states are often specified by a goal test which any goal state must satisfy. Path cost Sum of the costs at each step

Problem Formulation Problem formulation means choosing a relevant set of states to consider, and a feasible set of operators for moving from one state to another. Search is the process of considering various possible sequences of operators applied to the initial state, and finding out a sequence which culminates in a goal state.

Search Problem A search problem consists of the following: S: the full set of states s0 : the initial state A:S→S is a set of operators G is the set of final states. Note that G ⊆S

Search Problem The search problem is to find a sequence of actions which transforms the agent from the initial state to a goal state g∈G

Search Problem S: the full set of states • s0 : the initial state • A:S→S is a set of operators • G is the set of final states. Note that G ⊆S The search problem is to find a sequence of actions which transforms the agent from the initial state to a goal state g∈G. A search problem is represented by a 4-tuple {S, s0, A, G}.

Representation of search problems A search problem is represented using a directed graph. • The states are represented as nodes. • The allowed actions are represented as arcs.

Plan & path Plan: The sequence of actions is called a solution plan. It is a path from the initial state to a goal state. A plan P is a sequence of actions P = {a0, a1, … , aN} which leads to traversing a number of states {s0, s1, … , sN+1∈G}. Path: A sequence of states is called a path. The cost of a path is a positive number. In many cases the path cost is computed by taking the sum of the costs of each action.

Searching process The generic searching process can be very simply described in terms of the following steps: Do until a solution is found or the state space is exhausted. Check the current state Execute allowable actions to find the successor states. Pick one of the new states. Check if the new state is a solution state If it is not, the new state becomes the current state and the process is repeated

Illustration of a search process

Examples

Illustration of a search process The grey nodes define the search tree. Usually the search tree is extended one node at a time. The order in which the search tree is extended depends on the search strategy. We can start from a given state and follow the successors, and be able to find solution paths that lead to a goal state.

Example problem: Pegs and Disks problem Consider the following problem. We have 3 pegs and 3 disks. Operators: one may move the topmost disk on any needle to the topmost position to any other needle.

Initial state

Goal state

Sequence of actions

Pegs and Disks problem

Initial State

Step 1: Move A → C

Step 2: Move A → B

Step 3: Move A → C

Step 4: Move B→ A

Step 5: Move C → B

Step 6: Move A → B

Step 7: Move C→ B

8 queens problem The problem is to place 8 queens on a chessboard so that no two queens are in the same row, column or diagonal The picture on the left shows a solution of the 8-queens problem. The picture on the right is not a correct solution, because some of the queens are attacking each other.

Problem Reduction Space In a problem reduction space, the nodes represent problems to be solved or goals to be achieved, and the edges represent the decomposition of the problem into subproblems. This is best illustrated by the example of the Towers of Hanoi problem. C A B

Problem Reduction Space The root node, labeled “3AC” represents the original problem of transferring all 3 disks from peg A to peg C. The goal can be decomposed into three subgoals: 2AB, 1AC, 2BC. In order to achieve the goal, all 3 subgoals must be achieved. 2AB 3AC 1AC 2BC 1AB 1CB 1BA 1BC

Problem Reduction Space

Problem Reduction Space 2AB 1AC

Problem Reduction Space 2AB 1AC 1AB

Problem Reduction Space 2AB 1AC 1AB 1CB

Problem Reduction Space 2AB 1AC 1AB 1CB

Problem Reduction Space 2AB 1AC 1AB 1CB 2BC 1BA

Problem Reduction Space 2AB 1AC 1AB 1CB 2BC 1BA 1BC

Problem Reduction Space 2AB 1AC 1AB 1CB 2BC 1BA 1BC

8 queens problem

N queens problem formulation Deciding the representation of the states Selecting the initial state representation The description of the operators, and the successor states We can formulate the search problem in several different ways for this problem.

N queens problem formulation States: Any arrangement of 0 to 8 queens on the board Initial state: 0 queens on the board Successor function: Add a queen in any square Goal test: 8 queens on the board, none are attacked

N queens problem formulation 1 The initial state has 64 successors. Each of the states at the next level have 63 successors, and so on. We can restrict the search tree somewhat by considering only those successors where no queen is attacking each other. To do that we have to check the new queen against all existing queens on the board.

N queens problem formulation 1

N queens problem formulation 2 States: Any arrangement of 8 queens on the board Initial state: All queens are at column 1 Successor function: Change the position of any one queen Goal test: 8 queens on the board, none are attacked If we consider moving the queen at column 1, it may move to any of the seven remaining columns.

N queens problem formulation 2

N queens problem formulation 3 States: Any arrangement of k queens in the first k rows such that none are attacked Initial state: 0 queens on the board Successor function: Add a queen to the (k+1)th row so that none are attacked. Goal test : 8 queens on the board, none are attacked

N queens problem formulation 3

Example: 8 puzzle

Example: 8-puzzle states? locations of tiles initial state? given actions? move blank left, right, up, down goal test? goal state (given) path cost? 1 per move

Partial state space of 8-puzzle

Example: tic-tac-toe Another example we will consider now is the game of tic-tac-toe. This is a game that involves two players who play alternately. Player one puts a X in an empty position. Player 2 places an O in an unoccupied position. The player who can first get three of his symbols in the same row, column or diagonal wins.

A portion of the state space of tic-tac- toe

Explicit vs Implicit state space The state space may be explicitly represented by a graph. More typically the state space can be implicitly represented and generated when required. To generate the state space implicitly, the agent needs to know the initial state the operators and a description of the effects of the operators An operator is a function which "expands" a node. Computes the successor node(s).