CSE 415 -- (c) S. Tanimoto, 2007 Search 1: State Spaces 1 State-Space Search Outline: Demonstration with T* State spaces, operators, moves A Puzzle: The.

Slides:



Advertisements
Similar presentations
Solving problems by searching
Advertisements

Informed search algorithms
Informed search algorithms
A* Search. 2 Tree search algorithms Basic idea: Exploration of state space by generating successors of already-explored states (a.k.a.~expanding states).
CSE 373, Copyright S. Tanimoto, 2001 Graphs Graphs 2 Incidence and Adjacency Representing a graph with an adjacency matrix, an incidence matrix,
Part2 AI as Representation and Search
Search Techniques MSc AI module. Search In order to build a system to solve a problem we need to: Define and analyse the problem Acquire the knowledge.
May 12, 2013Problem Solving - Search Symbolic AI: Problem Solving E. Trentin, DIISM.
1 Tree Searching Strategies Updated: 2010/12/27. 2 The procedure of solving many problems may be represented by trees. Therefore the solving of these.
Biointelligence Lab School of Computer Sci. & Eng. Seoul National University Artificial Intelligence Chapter 8 Uninformed Search.
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.
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.
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.
Feng Zhiyong Tianjin University Fall  datatype PROBLEM ◦ components: INITIAL-STATE, OPERATORS, GOAL- TEST, PATH-COST-FUNCTION  Measuring problem-solving.
1 State-Space representation and Production Systems Introduction: what is State-space representation? (E.Rich, Chapt.2) Basis search methods. (Winston,
B ACKTRACK SEARCH ALGORITHM. B ACKTRACKING Suppose you have to make a series of decisions, among various choices, where You don’t have enough information.
Best-First Search: Agendas
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.
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.
CS 380: Artificial Intelligence Lecture #3 William Regli.
Review: Search problem formulation
Search I Tuomas Sandholm Carnegie Mellon University Computer Science Department [Read Russell & Norvig Chapter 3]
Using Search in Problem Solving
CSE (c) S. Tanimoto, 2008 State-Space Search 1 State-Space Search Motivation: Understanding “dynamics” in AI Statics versus Dynamics of AI Statics:
Intelligence for Games and Puzzles1 Solitaire Puzzle The solitaire puzzle is played with 32 pegs.
2/10/03Tucker, Sec Tucker, Applied Combinatorics, Sec. 3.2, Important Definitions Enumeration: Finding all of the possible paths in a rooted tree.
Solving problems by searching
Backtracking.
Solving Problems by Searching
Artificial Intelligence Course outline Introduction Problem solving Generic algorithms Knowledge Representation and Reasoning Expert Systems Uncertainty.
Review: Search problem formulation Initial state Actions Transition model Goal state (or goal test) Path cost What is the optimal solution? What is the.
Solving Problems by Searching CPS Outline Problem-solving agents Example problems Basic search algorithms.
Artificial Intelligence Lecture 9. Outline Search in State Space State Space Graphs Decision Trees Backtracking in Decision Trees.
WAES 3308 Numerical Methods for AI
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.
Introduction to search Chapter 3. Why study search? §Search is a basis for all AI l search proposed as the basis of intelligence l all learning algorithms,
Dr.Abeer Mahmoud ARTIFICIAL INTELLIGENCE (CS 461D) Dr. Abeer Mahmoud Computer science Department Princess Nora University Faculty of Computer & Information.
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.
AI in game (II) 권태경 Fall, outline Problem-solving agent Search.
1 Solving problems by searching 171, Class 2 Chapter 3.
Search CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
SOLVING PROBLEMS BY SEARCHING Chapter 3 August 2008 Blind Search 1.
Problem solving by search Department of Computer Science & Engineering Indian Institute of Technology Kharagpur.
Basic Problem Solving Search strategy  Problem can be solved by searching for a solution. An attempt is to transform initial state of a problem into some.
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.
Introduction to State Space Search
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.
Ch. 3 – Search Supplemental slides for CSE 327 Prof. Jeff Heflin.
Analysis & Design of Algorithms (CSCE 321)
Solving problems by searching A I C h a p t e r 3.
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
Search Part I Introduction Solutions and Performance Uninformed Search Strategies Avoiding Repeated States Partial Information Summary.
Lecture 2: Problem Solving using State Space Representation CS 271: Fall, 2008.
Biointelligence Lab School of Computer Sci. & Eng. Seoul National University Artificial Intelligence Chapter 8 Uninformed Search.
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.
Solving problems by searching
CSE 373, Copyright S. Tanimoto, 2002 Graphs 2 -
Breadth First and Depth First
CSE (c) S. Tanimoto, 2002 Search Algorithms
CSE (c) S. Tanimoto, 2001 Search-Introduction
Haskell Tips You can turn any function that takes two inputs into an infix operator: mod 7 3 is the same as 7 `mod` 3 takeWhile returns all initial.
CSE (c) S. Tanimoto, 2002 State-Space Search
CSE (c) S. Tanimoto, 2004 State-Space Search
CSE (c) S. Tanimoto, 2004 Search Algorithms
Solving Problems by Searching
Presentation transcript:

CSE (c) S. Tanimoto, 2007 Search 1: State Spaces 1 State-Space Search Outline: Demonstration with T* State spaces, operators, moves A Puzzle: The “Painted Squares” Combinatorics of the Puzzle Representations for pieces, boards, and states. Recursive depth-first search Iterative depth-first search

CSE (c) S. Tanimoto, 2007 Search 1: State Spaces 2 Introductory Demo T* = T-STAR = Transparent STate-space search ARchitecture Missionaries and Cannibals puzzle Image processing operator sequences Blocks-World problem (robot motion planning)

CSE (c) S. Tanimoto, 2007 Search 1: State Spaces 3 States A state consists of a complete description or snapshot of a situation arrived at during the solution of a problem. Initial state: the starting position or arrangement, prior to any problem-solving actions being taken. Goal state: the final arrangement of elements or pieces that satisfies the requirements for a solution to the problem.

CSE (c) S. Tanimoto, 2007 Search 1: State Spaces 4 State Space The set of all possible states 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.

CSE (c) S. Tanimoto, 2007 Search 1: State Spaces 5 Moves A move is a transition from one state to another. An operator is a partial function (from states to states) that can be applied to a state to produce a new state, and also, implicitly, a move. A sequence of moves that leads from the initial state to a goal state constitutes a solution.

CSE (c) S. Tanimoto, 2007 Search 1: State Spaces 6 Operator Preconditions Precondition: A necessary property of a state in which a particular operator can be applied. Example: In checkers, a piece may only move into a square that is vacant. Vacant(place) is a precondition on moving a piece into place. Example: In Chess, a precondition for moving a rook from square A to square B is that all squares between A and B be vacant. (A and B must also be either in the same row or the same column.)

CSE (c) S. Tanimoto, 2007 Search 1: State Spaces 7 Painted Squares How many possible arrangements? Could we simply make a list of all the possible arrangements of pieces, and then select those that are solutions? It depends on how many there are and how much time we can afford to spend.

CSE (c) S. Tanimoto, 2007 Search 1: State Spaces 8 The Painted Squares Puzzle(s) A Painted Squares Puzzle consists of 1. a board (typically of size 2 by 2), and 2. a set of painted squares. Each square has its sides painted with a texture that is one of: striped, hashed, gray, or boxed. The objective is to fill the board with the square pieces in such a way that adjacent squares have matching textures where their sides abut one another.

CSE (c) S. Tanimoto, 2007 Search 1: State Spaces 9 Painted Squares How many possible arrangements? Factors to consider: 1.Number of places on the board 2.Number of possible textures in the patterns 3.Number of rotations of a square (usually 4) 4.Whether flipping squares is allowed 5.Symmetries of pieces 6.Symmetries of the board 7.All possible board shapes for a given side (e.g. the possible “quadraminos”) 8.Full boards only, or partially filled boards, too?

CSE (c) S. Tanimoto, 2007 Search 1: State Spaces 10 Painted Squares How many possible arrangements? The number can be reduced by enforcing constraints: 1.Do not permit violations of the matching-sides criterion. 2.Require that filled positions on the board be contiguous and always the first k in some ordering.

CSE (c) S. Tanimoto, 2007 Search 1: State Spaces 11 A Solution Approach for the Painted Squares Puzzle state: partially filled board. Initial state: empty board. Goal state: filled board, in which pieces satisfy all constraints. Operator: for a given remaining piece, given vacancy on the board, and given orientation, try placing that piece at that position in that orientation.

CSE (c) S. Tanimoto, 2007 Search 1: State Spaces 12 Recursive Depth-First Method Current board B  empty board. Remaining pieces Q  all pieces. Call Solve(B, Q). Procedure Solve(board B, set of pieces Q) For each piece P in Q, { For each orientation A { Place P in the first available position of B in orientation A, obtaining B’. If B’ is full and meets all constraints, output B’. If B’ is full and does not meet all constraints, return. Call Solve(B’, Q - {P}). } Return.

CSE (c) S. Tanimoto, 2007 Search 1: State Spaces 13 The Combinatorial Explosion Suppose a search process begins with the initial state. Then it considers each of k possible moves. Each of those may have k possible subsequent moves. In order to look n steps ahead, the number of states that must be considered is 1 + k + k k n. For k > 1, this expression grows rapidly as n increases. (The growth is exponential.) This is known as the combinatorial explosion.

CSE (c) S. Tanimoto, 2007 Search 1: State Spaces 14 Search Trees By applying operators from a given state we generate its children or successors. Successors are descendants as are successors of descendants. If we ignore possible equivalent states among descendants, we get a tree structure. Depth-First Search: Examine the nodes of the tree by fully exploring the descendants of a node before trying any siblings of a node.

CSE (c) S. Tanimoto, 2007 Search 1: State Spaces 15 Graph Search When descendant nodes can be reached with moves via two or more paths, we are really searching a more general graph than a tree. Depth-First Search: Examine the nodes of the graph by fully exploring the “descendants” of a node before trying any “siblings” of a node.

CSE (c) S. Tanimoto, 2007 Search 1: State Spaces 16 Depth-First Search: Iterative Formulation 1. Put the start state on a list OPEN 2. If OPEN is empty, output “DONE” and stop. 3. Select the first state on OPEN and call it S. Delete S from OPEN. Put S on CLOSED. If S is a goal state, output its description 4. Generate the list L of successors of S and delete from L those states already appearing on CLOSED. 5. Delete any members of OPEN that occur on L. Insert all members of L at the front of OPEN. 6. Go to Step 2.

CSE (c) S. Tanimoto, 2007 Search 1: State Spaces 17 Breadth-First Search: Iterative Formulation 1. Put the start state on a list OPEN 2. If OPEN is empty, output “DONE” and stop. 3. Select the first state on OPEN and call it S. Delete S from OPEN. Put S on CLOSED. If S is a goal state, output its description 4. Generate the list L of successors of S and delete from L those states already appearing on CLOSED. 5. Delete any members of OPEN that occur on L. Insert all members of L at the end of OPEN. 6. Go to Step 2.