State Space Representation and Search

Slides:



Advertisements
Similar presentations
Uninformed Search in Prolog
Advertisements

Problems and Search Chapter 2.
Lecture Notes on AI-NN Chapter 5 Information Processing & Utilization.
Informed search algorithms
Solving problems by searching Chapter 3. Outline Problem-solving agents Problem types Problem formulation Example problems Basic search algorithms.
Heuristic Searches. Feedback: Tutorial 1 Describing a state. Entire state space vs. incremental development. Elimination of children. Closed and the solution.
Informed search algorithms
Artificial Intelligence By Mr. Ejaz CIIT Sahiwal.
An Introduction to Artificial Intelligence
Artificial Intelligence Solving problems by searching
Search I: Chapter 3 Aim: achieving generality Q: how to formulate a problem as a search problem?
PROBLEM SOLVING AND SEARCH
Problem Solving by Searching Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 3 Spring 2007.
Solving Problem by Searching
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 and Search Andrea Danyluk September 9, 2013.
Part2 AI as Representation and 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.
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)
CPSC 322, Lecture 5Slide 1 Uninformed Search Computer Science cpsc322, Lecture 5 (Textbook Chpt 3.4) January, 14, 2009.
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.
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.
Uninformed Search Jim Little UBC CS 322 – Search 2 September 12, 2014
UNINFORMED SEARCH Problem - solving agents Example : Romania  On holiday in Romania ; currently in Arad.  Flight leaves tomorrow from Bucharest.
Problem Solving by Searching Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 3 Spring 2004.
Structures and Strategies for State Space Search
Structures and Strategies for State Space Search
Uninformed Search Reading: Chapter 3 by today, Chapter by Wednesday, 9/12 Homework #2 will be given out on Wednesday DID YOU TURN IN YOUR SURVEY?
Using Search in Problem Solving
CSC344: AI for Games Lecture 4: Informed search
1 Structures and Strategies for State Space Search 3 3.0Introduction 3.1Graph Theory 3.2Strategies for State Space Search 3.3Using the State Space to Represent.
Problem-solving agents
For Friday Finish chapter 3 Homework: –Chapter 3, exercise 6 –May be done in groups. –Clarification on part d: an “action” must be running the program.
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.
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.
Copyright R. Weber Search in Problem Solving ISYS 370 Dr. R. Weber.
Introduction to search Chapter 3. Why study search? §Search is a basis for all AI l search proposed as the basis of intelligence l inference l all learning.
1 CO Games Development 1 Week 11 Search Methods Gareth Bellaby.
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.
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.
Informed search algorithms Chapter 4. Best-first search Idea: use an evaluation function f(n) for each node –estimate of "desirability"  Expand most.
For Friday Finish reading chapter 4 Homework: –Lisp handout 4.
For Monday Read chapter 4, section 1 No homework..
Lecture 3: Uninformed 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.
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).
A General Introduction to Artificial Intelligence.
Introduction to Artificial Intelligence (G51IAI) Dr Rong Qu Blind Searches - Introduction.
Solving problems by searching A I C h a p t e r 3.
Chapter 3.5 and 3.6 Heuristic Search Continued. Review:Learning Objectives Heuristic search strategies –Best-first search –A* algorithm Heuristic functions.
CPSC 322, Lecture 5Slide 1 Uninformed Search Computer Science cpsc322, Lecture 5 (Textbook Chpt 3.5) Sept, 13, 2013.
G5AIAI Introduction to AI
Lecture 2: Problem Solving using State Space Representation CS 271: Fall, 2008.
For Monday Read chapter 4 exercise 1 No homework.
Artificial Intelligence Solving problems by searching.
Problem Solving Agents
Introduction to Artificial Intelligence
Problem Solving by Searching
CSE 4705 Artificial Intelligence
Searching for Solutions
Blay Whitby 2003 Search Blay Whitby 2003
CO Games Development 1 Week 8 Depth-first search, Combinatorial Explosion, Heuristics, Hill-Climbing Gareth Bellaby.
ECE457 Applied Artificial Intelligence Fall 2007 Lecture #2
Presentation transcript:

State Space Representation and Search

Solving an AI Problem The problem is firstly represented as a state space. The state space is searched to find a solution to problem. Each state space takes the form of a tree or graph. Which search should be used? Type of problem How the problem can be represented

Components of a State Space Set of nodes representing each state of the problem. Arcs between nodes representing the legal moves from one state to another. An initial state. A goal state. .

Search Techniques Uninformed Informed/Heuristic Depth First Search Depth First Search with Iterative Deepening Breadth First Search Informed/Heuristic Best First Search Hill Climbing Branch and Bound Techniques A* Algorithm Simulated Annealing Tabu Search .

Classic AI Problems Traveling Salesman Problem Towers of Hanoi 8-Puzzle Problem .

The Travelling Salesman Problem A salesman has a list of cities, each of which he must visit exactly once. There are direct roads between each pair of cities on the list. Find the route that the salesman should follow for the shortest trip that both starts and finishes at any one of the cities. .

Towers of Hanoi In a monastery in the deepest Tibet there are three crystal columns and 64 golden rings. The rings are different sizes and rest over the columns. At the beginning of time all the rings rested on the leftmost column. All the rings must be moved to the last column without the smaller rings on top of larger rings. .

Towers of Hanoi In moving the rings a larger ring must not be placed on a smaller ring. Furthermore, only one ring at a time can be moved from one column to the next. A simplified version of this problem which will consider involves only 2 or 3 rings instead of 64. .

8-Puzzle Problem The 8-Puzzle involves moving the tiles on the board above into a particular configuration. The black square on the board represents a space. The player can move a tile into the space, freeing that position for another tile to be moved into and so on.

8-Puzzle Example 1 2 3 1 8 3 4 2 6 4 8 7 6 5 7 5 Initial State Goal State 1 2 3 1 8 3 4 2 6 4 8 7 6 5 7 5

Problem Representation What is the goal to be achieved? What are the legal moves or actions? What knowledge needs to be represented in the state description? Type of problem Best solution vs. good enough solution

Example: Towers of Hanoi

Example: 8-Puzzle Problem

State Space Summary A state space is a set of descriptions or states. Composition of each problem: One or more initial states A set of legal moves One or more goal states The number of operators are problem dependant and specific to a particular state space representation. The more operators the larger the branching factor of the state space. Why generate the state space at run-time, and not just have it built in advance? A search algorithm is applied to a state space representation to find a solution path. Each search algorithm applies a particular search strategy.

Graph vs. Tree If states in the solution space can be revisited more than once a directed graph is used to represent the solution space. In a graph more than one move sequence can be used to get from one state to another. Moves in a graph can be undone. In a graph there is more than one path to a goal whereas in a tree a path to a goal is more clearly distinguishable. A goal state may need to appear more than once in a tree. Search algorithms for graphs have to cater for possible loops and cycles in the graph. Trees may be more “efficient” for representing such problems as loops and cycles do not have to be catered for. The entire tree or graph will not be generated.

Example 1: Graph vs. Tree

Example 2: Graph vs. Tree Prove x + (y +z) = y + (z+x) given L+(M+N) = (L+M) + N ........(A) M+N = N+M........................(C)

Type of Problem Some problems only need a representation, e.g. crossword puzzles. Other problems require a yes or no response indicating whether a solution can be found or not. The last type problem are those that require a solution path as an output, e.g. mathematical theorems, Towers of Hanoi. In these cases we know the goal state and we need to know how to attain this state.

Depth-First Search Goal:R A B E K S L T F M C G N H O P U D I Q J R

Exercise: DFS A to B and C B to D and E C to F and G D to I and J I to K and L Start state: A Goal state: E , J

DFS with Iterative Deepening procedure DFID (intial_state, goal_states) begin search_depth=1 while (solution path is not found) dfs(initial_state, goals_states) with a depth bound of search_depth increment search_depth by 1 endwhile end

Exercise: DFID A to B and C B to D and E C to F and G D to I and J I to K and L Start state: A Goal state: E , J

Breadth-First Search Goal:U A B C D E F G H I J K L M N O P Q R S T U

Exercise: BFS A to B and C B to D and E C to F and G D to I and J I to K and L Start state: A Goal state: E , J

Difference Between Depth First and Breadth First Breadth first is guaranteed to find the shortest path from the start to the goal. DFS may get “lost” in search and hence a depth-bound may have to be imposed on a depth first search. BFS has a bad branching factor which can lead to combinatorial explosion. The solution path found by the DFS may be long and not optimal. DFS more efficient for search spaces with many branches, i.e. the branching factor is high.

Deciding on which Search to Use The importance of finding the shortest path to the goal. The branching of the state space. The available time and resources. The average length of paths to a goal node. All solutions or only the first solution.