STRUCTURES AND STRATEGIES FOR STATE SPACE SEARCH

Similar documents
Structures and Strategies For Space State Search

Artificial Intelligence (part 4a) Problem Solving Using Search: Structures and Strategies for State Space Search

State Space Search. Many problems can be represented as a set of states and a set of rules of how one state is transformed to another.

HEURISTIC SEARCH. 4.3 Using Heuristics in Games 4.4 Complexity Issues 4.5 Epilogue and References 4.6 Exercises

Solving Problems: Blind Search

STRUCTURES AND STRATEGIES FOR STATE SPACE SEARCH

HEURISTIC SEARCH. 4.3 Using Heuristics in Games 4.4 Complexity Issues 4.5 Epilogue and References 4.6 Exercises

Blind Search in Graphs. Dr. Asaad Sabah Hadi

Computer Science and Software Engineering University of Wisconsin - Platteville. 3. Search (Part 1) CS 3030 Lecture Notes Yan Shi UW-Platteville

Introduction HEURISTIC SEARCH. Introduction. Heuristics. Two main concerns of AI researchers. Two problems with the search process

Chapter 11: Graphs and Trees. March 23, 2008

Graph Theory CS/Math231 Discrete Mathematics Spring2015

6.2. Paths and Cycles

Trees : Part 1. Section 4.1. Theory and Terminology. A Tree? A Tree? Theory and Terminology. Theory and Terminology

Algorithm Design Techniques (III)

Data Structures and Algorithms

CMPSCI 250: Introduction to Computation. Lecture #24: General Search, DFS, and BFS David Mix Barrington 24 March 2014

Graph Theory. 1 Introduction to Graphs. Martin Stynes Department of Mathematics, UCC January 26, 2011

Foundations of Discrete Mathematics

Crossing bridges. Crossing bridges Great Ideas in Theoretical Computer Science. Lecture 12: Graphs I: The Basics. Königsberg (Prussia)

Artificial Intelligence (part 4d)

Artificial Intelligence (part 4d)

Search and Optimization

Chapter 3: Solving Problems by Searching

Launch problem: Lining streets

Artificial Intelligence (part 4c) Strategies for State Space Search. (Informed..Heuristic search)

Lecture 2 - Graph Theory Fundamentals - Reachability and Exploration 1

Artificial Intelligence

Graph Algorithms. A Brief Introduction. 高晓沨 (Xiaofeng Gao) Department of Computer Science Shanghai Jiao Tong Univ.

SCHOOL OF ENGINEERING & BUILT ENVIRONMENT. Mathematics. An Introduction to Graph Theory

11-5 Networks. Königsberg Bridge Problem

Lecture 14: March 9, 2015

Elements of Graph Theory

Parallel Programming. Parallel algorithms Combinatorial Search

University of Waterloo Department of Electrical and Computer Engineering ECE 457A: Cooperative and Adaptive Algorithms Midterm Examination

CHAPTER 10 GRAPHS AND TREES. Alessandro Artale UniBZ - artale/z

Chapter 14 Section 3 - Slide 1

Lecture 3: Graphs and flows

Discrete Mathematics and Probability Theory Fall 2013 Vazirani Note 7

Logic: The Big Picture. Axiomatizing Arithmetic. Tautologies and Valid Arguments. Graphs and Trees

CMPSCI 250: Introduction to Computation. Lecture #22: Graphs, Paths, and Trees David Mix Barrington 12 March 2014

Konigsberg Bridge Problem

EECS 203 Lecture 20. More Graphs

Solving problems by searching

Graph theory was invented by a mathematician named Euler in the 18th century. We will see some of the problems which motivated its study.

Graph Theory. 26 March Graph Theory 26 March /29

Foundations of Computer Science Spring Mathematical Preliminaries

Section Summary. Introduction to Trees Rooted Trees Trees as Models Properties of Trees

Discrete Mathematics for CS Spring 2008 David Wagner Note 13. An Introduction to Graphs

IE 102 Spring Routing Through Networks - 1

Monotonicity. Admissible Search: That finds the shortest path to the Goal. Monotonicity: local admissibility is called MONOTONICITY

Introduction to Networks

Material handling and Transportation in Logistics. Paolo Detti Dipartimento di Ingegneria dell Informazione e Scienze Matematiche Università di Siena

UNIT 4 Branch and Bound

implementing the breadth-first search algorithm implementing the depth-first search algorithm

7.1 Introduction. A (free) tree T is A simple graph such that for every pair of vertices v and w there is a unique path from v to w

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao,David Tse Note 8

Pre-Calculus. Slide 1 / 192. Slide 2 / 192. Slide 3 / 192. Matrices

Pre-Calculus Matrices

3 SOLVING PROBLEMS BY SEARCHING

Pre-Calculus. Introduction to Matrices. Slide 1 / 192 Slide 2 / 192. Slide 3 / 192. Slide 4 / 192. Slide 6 / 192. Slide 5 / 192. Matrices

Chapter 2 Classical algorithms in Search and Relaxation

Software Paradigms (Lesson 7) Logic Programming & Software Engineering

1. The Highway Inspector s Problem

CS 771 Artificial Intelligence. Problem Solving by Searching Uninformed search

Chapter 5: Euler Paths and Circuits The Mathematics of Getting Around

14 More Graphs: Euler Tours and Hamilton Cycles

Definition Example Solution

Math 776 Graph Theory Lecture Note 1 Basic concepts

GRAPH THEORY AND COMBINATORICS ( Common to CSE and ISE ) UNIT 1

An undirected graph G can be represented by G = (V, E), where

Graph and Digraph Glossary

12/5/17. trees. CS 220: Discrete Structures and their Applications. Trees Chapter 11 in zybooks. rooted trees. rooted trees

Artificial Intelligence

Chapter 5: Euler Paths and Circuits The Mathematics of Getting Around

Grades 7 & 8, Math Circles 31 October/1/2 November, Graph Theory

Search. (Textbook Chpt ) Computer Science cpsc322, Lecture 2. May, 10, CPSC 322, Lecture 2 Slide 1

We will show that the height of a RB tree on n vertices is approximately 2*log n. In class I presented a simple structural proof of this claim:

Chapter 3 Solving problems by searching

Uninformed Search. Day 1 & 2 of Search. Russel & Norvig Chap. 3. Material in part from

Math 778S Spectral Graph Theory Handout #2: Basic graph theory

Problem Solving, Search and Control Strategies

Graph Theory

6.034 Notes: Section 2.1

Goals! CSE 417: Algorithms and Computational Complexity!

Intermediate Math Circles Wednesday, February 22, 2017 Graph Theory III

Today s Outline. CSE 326: Data Structures. Topic #15: Cool Graphs n Pretty Pictures. A Great Mathematician. The Bridges of Königsberg

New Jersey Center for Teaching and Learning. Progressive Mathematics Initiative

Constraint Satisfaction Problems

Solving Problems by Searching

Chapter 9. Graph Theory

Brute Force: Selection Sort

Name: UW CSE 473 Midterm, Fall 2014

Solving Problems by Searching

Lecture 20 : Trees DRAFT

Understand graph terminology Implement graphs using

4.1 Eulerian Tours. 4. Eulerian Tours and Trails. Königsberg. Seven Bridges. Try. Königsberg bridge problem

Instant Insanity Instructor s Guide Make-it and Take-it Kit for AMTNYS 2006

Basic Search. Fall Xin Yao. Artificial Intelligence: Basic Search

SEARCH METHODS USING HEURISTIC STRATEGIES. Michael Georgeff. Department of Computer Science, Monash University, Clayton, Vic, Australia.

Transcription:

Slide 3.1 3 STRUCTURES AND STRATEGIES FOR STATE SPACE SEARCH 3.0 Introduction 3.1 Graph Theory 3.2 Strategies for State Space Search 3.3 Using the State Space to Represent Reasoning with the Predicate Calculus 3.4 Epilogue and References 3.5 Exercises

Slide 3.2 Search Algorithm Is the problem solver guaranteed to find a solution? Will the problem solver always terminate or can it become caught in an infinite loop? When a solution is found, is it guaranteed to be optimal? What is the complexity of the search process in terms of time usage? Memory usage? How can the interpreter most effectively reduce search complexity? How can an interpreter be designed to most effectively utilize a representation language?

Slide 3.3 State Space Search Theory of the state space search is a tool for answering these questions. A problem will be represented as a state space graph Using graph theory can analyze the structure and complexity of both the problem and the search procedures that we employ to solve it Graph consists of a set of nodes and a set of arcs or links connecting pairs of nodes

Slide 3.4 State Space and Graph Theory In state space model of problem solving, nodes of the graph represent as discrete states in a problemsolving process such as the results of logical inferences or the different configurations of a game board arcs of the graph represent transitions between states transitions correspond to logical inferences or legal moves of a game In expert systems, states describe knowledge of a problem instance at some stage of a reasoning process the act of applying a rule is represented as an arc between states

Slide 3.5 Bridges of Konigsberg Problem The city of Konigsberg occupied both banks and two islands of a river The islands and the riverbanks were connected by seven bridges The bridges of Konigsberg problem asks if there is a walk around the city that crosses each bridge exactly once

Figure 3.1: The city of Königsberg. Slide 3.6

Slide 3.7 Bridges of Konigsberg problem in graph Leonhard Euler invented graph theory to solve the bridges of Konigsberg problem Graph Theory is our best tool for reasoning about the structure of objects and relations In the problem, rb1 and rb2 are riverbanks 1 and 2 i1 and i2 are two islands b1,b2,b3,b4,b5,b6,b7 are bridges

Figure 3.2: Graph of the Königsberg bridge system. Slide 3.8

In predicate calculus, Slide 3.9 connect predicate corresponds to an arc of the graph, asserting that two land masses are connected by a particular bridge Each bridge requires two connect predicates one for each direction in which the bridge may be crossed: connect(i1,i2,b1) connect(rb1,i1,b2) connect(rb1,i1,b3) connect(rb1,i2,b4) connect(rb2,i1,b5) connect(rb2,i1,b6) connect(rb2,i2,b7) connect(i2,i1,b1) connect(i1,rb1,b2) connect(i1,rb1,b3) connect(i2,rb1,b4) connect(i1,rb2,b5) connect(i1,rb2,b6) connect(i2,rb2,b7) further predicate expression connect(x,y,z) = connect(y,x,z)

Slide 3.10 Graph Theory graph a set of nodes and arcs that connect them labeled graph one or more descriptors(labels) attached to each node directed graph if arcs have an associated directionality path a sequence of nodes through successive arcs rooted graph there is a path from the root to all nodes within the graph tree two nodes have at most one path between them

Figure 3.3: A labeled directed graph. Slide 3.11

Figure 3.4: A rooted tree, exemplifying family relationships. Slide 3.12

Slide 3.13 Definition Graph

Slide 3.14 Definition continued Graph

Slide 3.15 State Space Representation of Problems In the state space representation of a problem, The nodes of a graph correspond to partial problem solution states and the arcs correspond to steps in a problem-solving process One or more initial states, corresponding to the given information in a problem instance, form the root of the graph One or more goal conditions, which are solutions to a problem instance State space search characterizes problem solving as the process of finding a solution path from the start state to a goal

Slide 3.16

Slide 3.17 Example TIC-TAC-TOE Start State an empty board Termination or Goal State a board state having three Xs in a row, column or diagonal

Slide 3.18 Example TIC-TAC-TOE continued The path from the start state to a goal state gives the series in a winning game The states in the space are all the different configurations of Xs and Os that the game can have State space is a graph rather than a tree as some states on the third and deeper levels can be reached by different paths There are no cycles in the state space because the directed arcs of the graph do not allow a move to be undone It is impossible to go back up the structure once a state has been reached No checking for cycles in path is necessary It is called DAG (directed acyclic graph)

Slide 3.19 Example The 8-Puzzle Goal to find a series of moves of files into the blank space that places the board in a goal configuration

Slide 3.20 Example The 8-Puzzle continued Legal moves move the blank up move the blank right move the blank down move the blank left all four moves are not applicable at all time for example, when the blank is in one of the corners only two moves are possible state could be represented using a simple 3x3 array a predicate calculus representation could use a state predicate with nine parameters (for the locations of numbers in the grid) four procedures, describing each of the possible moves of the blank, define the arcs in the state space

Figure 3.6: Slide 3.21 State space of the 8-puzzle generated by move blank operations.

Slide 3.22 Example The traveling salesperson Suppose a salesperson has five cities (A,B,C,D,E) to visit and then must return home the goal of the problem is to find the shortest path for the salesperson to travel, visiting each city, and then returning to the starting city In the graph, nodes represent cities, each arc is labeled with a weight indicating the cost of traveling that arc This cost might be a representation of the miles or cost of between two cities

Figure 3.7: An instance of the traveling salesperson problem. Slide 3.23

Figure 3.8: Search of the traveling salesperson problem. Each arc is marked with the total weight of all paths from the start node (A) to its endpoint. Slide 3.24

Figure 3.9: An instance of the traveling salesperson problem with the nearest neighbor path in bold. Note that this path (A, E, D, B, C, A), at a cost of 550, is not the shortest path. The comparatively high cost of arc (C, A) defeated the heuristic. Slide 3.25

Slide 3.26 Strategies for State Space Search Data-Driven and Goal-Driven Search A state space may be search in two directions from the given data of a problem instance toward a goal or from a goal back to the data data-driven search (forward chaining) takes the facts of the problem and applies the rules and legal moves to produce new facts that lead to a goal goal-driven search (backward chaining) finds the rules that could produce the goal and chains backward through successive rules and subgoals to the given facts of the problem

Slide 3.27 Goal-driven search A goal or hypothesis is given in the problem statement or can easily be formulated. In mathematics, the goal is the theorem to be proved There are a large number of rules that match the facts of the problem and thus produce an increasing number of conclusions or goals. The total number of rules used to produce a given theorem is usually much smaller than the number of rules that may be applied to the entire set of axioms Problem data are not given but must be acquired by the problem solver. Goal-driven search can help guide data acquisition. For example, a wide range of diagnostic tests can be applied. Doctors order only those that are necessary to confirm or deny a particular hypothesis Goal-driven search thus uses knowledge of the desired goal to guide the search through relevant rules and eliminate branches of the space

Slide 3.28 Data-driven search All or most of the data are given in the initial problem statement. Systems that analyze particular data fit the data-driven approach There are a large number of potential goals, but there are only a few ways to use the facts and given information of a particular problem instance. In DENDRAL, for any organic compound, there are an enormous number of possible structures. However, the mass spectrographic data on a compound allow DENTRAL to eliminate all but a few of these It is difficult to form a goal or hypothesis. In using DENDRAL, for example, little may be known initially about the possible structure of a compound Data-driven search uses the knowledge and constraints found in the given data of a problem to guide search along lines known to be true

Figure 3.10: State space in which goal-directed search effectively prunes extraneous search paths. Slide 3.29

Slide 3.30 Figure 3.11: State space in which data-directed search prunes irrelevant data and their consequents and determines one of a number of possible goals.

Slide 3.31 Implementing Graph Search Backtracking search begins at the start state and pursues a path until it reaches either a goal or a dead end. If it finds a goal, it quits and return the solution path if it reaches a dead end, it backtracks to the most recent node on the path having unexamined siblings and continues down one of these branches, as follows: if the present state S does not meet the requirements of the goal description, then generate its first descendant S child1 and apply the backtrack procedure recursively to this node. If backtrack does not find a goal node in the subgraph rooted at S child1, repeat the procedure for its sibling, S child2. This continues until either some descendent of a child is a goal node or all the children have been searched. If none of the children of S leads to a goal, then backtrack fails back to the parent of S, where it is applied to the sibling of S and so on

Function backtrack algorithm Slide 3.32

A trace of backtrack on the graph of figure 3.12 Slide 3.33

Figure 3.12: Backtracking search of a hypothetical state space. Slide 3.34

Slide 3.35 Depth-First and Breadth-First Search In depth-first search when a state is examined, all the children and their descendants are examined before any of its siblings depth-first search goes deeper into the search space whenever this is possible only when no further descendants of a state can be found are its siblings considered In breadth-first search explores the space in a level-by-level fashion only when there are no more states to be explored at a given level does the algorithm move on to the next level

Figure 3.13: Graph for breadth- and depth-first search examples. Slide 3.36

Slide 3.37 In the previous example Depth-first search examined the states in the order A,B,E,K,S,L,T,F,M,C,G,N,H,O,P,U,D,I,Q,J,R Breadth-first search A,B,C,D,E,F,G,H,I,J,K,LM,N,O,P,Q,R,S,T,U

Function breadth_first search algorithm Slide 3.38

A trace of breadth_first_search on the graph of Figure 3.13 Slide 3.39