Uninformed search methods

Similar documents
Uninformed search methods

Uninformed search methods II.

Uninformed search methods II.

Artificial Intelligence. Uninformed Search Strategies

CSE 3401: Intro to AI & LP Uninformed Search II

Uninformed Search Strategies

Problem Solving Agents

CSE 3402: Intro to Artificial Intelligence Uninformed Search II

Princess Nora University Faculty of Computer & Information Systems ARTIFICIAL INTELLIGENCE (CS 370D) Computer Science Department

Solving Problems by Searching chap3 1. Problem-Solving Agents

Problem Solving as Search - I

Uninformed Search (Ch )

CENG 466 Artificial Intelligence. Lecture 4 Solving Problems by Searching (II)

Overview. Depth Limited Search. Depth Limited Search. COMP219: Artificial Intelligence. Lecture 8: Combining Search Strategies and Speeding Up

COMP219: Artificial Intelligence. Lecture 8: Combining Search Strategies and Speeding Up

Search I. Tuomas Sandholm Carnegie Mellon University Computer Science Department. [Read Russell & Norvig Chapter 3]

Uninformed search strategies

Uninformed Search (Ch )

Better Search Improved Uninformed Search CIS 32

Representation. Representation. Representation. Representation. 8 puzzle.

COMP9414: Artificial Intelligence Uninformed Search

CSC384: Introduction to Artificial Intelligence. Search

SEARCH SEARCH TREE. Node: State in state tree. Root node: Top of state tree

SEARCH TREE. Generating the children of a node

Introduction. AI and Searching. Simple Example. Simple Example. Now a Bit Harder. From Hammersmith to King s Cross

Real World Search Problems. CS 331: Artificial Intelligence Uninformed Search. Simpler Search Problems. Example: Oregon. Search Problem Formulation

CS 4649/7649 Robot Intelligence: Planning

SIDDHARTH INSTITUTE OF ENGINEERING & TECHNOLOGY :: PUTTUR (AUTONOMOUS) Siddharth Nagar, Narayanavanam Road QUESTION BANK (DESCRIPTIVE)

Depth-bounded Discrepancy Search

6.034 Artificial Intelligence

/435 Artificial Intelligence Fall 2015

Transposition Table, History Heuristic, and other Search Enhancements

Advanced Search Hill climbing

Aryeh Rappaport Avinoam Meir. Schedule automation

Urban OR: Quiz 2 Solutions (2003) ( 1 ρ 1 )( 1 ρ 1 ρ 2 ) ( 1 12 )( ) σ S ] 24 [ 2 = 60, 2 2 ] ( 2 ) 3

Bulgarian Olympiad in Informatics: Excellence over a Long Period of Time

Robust Task Execution: Procedural and Model-based. Outline. Desiderata: Robust Task-level Execution

COMP 406 Lecture 05. Artificial. Fiona Yan Liu Department of Computing The Hong Kong Polytechnic University

Decision Trees. Nicholas Ruozzi University of Texas at Dallas. Based on the slides of Vibhav Gogate and David Sontag

G53CLP Constraint Logic Programming

Spider Search: An Efficient and Non-Frontier-Based Real-Time Search Algorithm

The system design must obey these constraints. The system is to have the minimum cost (capital plus operating) while meeting the constraints.

CS Lecture 5. Vidroha debroy. Material adapted courtesy of Prof. Xiangnan Kong and Prof. Carolina Ruiz at Worcester Polytechnic Institute

CT PET-2018 Part - B Phd COMPUTER APPLICATION Sample Question Paper

Introduction to Algorithms

Application of Dijkstra s Algorithm in the Evacuation System Utilizing Exit Signs

CMPUT680 - Winter 2001

CS 4649/7649 Robot Intelligence: Planning

A new Decomposition Algorithm for Multistage Stochastic Programs with Endogenous Uncertainties

Running the Table: An AI for Computer Billiards

Algorithms and Data Structures

Practical Approach to Evacuation Planning Via Network Flow and Deep Learning

The Evolution of Transport Planning

Pedestrian Dynamics: Models of Pedestrian Behaviour

Analysis of Professional Cycling Results as a Predictor for Future Success

CS 4649/7649 Robot Intelligence: Planning

Algebra I: Strand 3. Quadratic and Nonlinear Functions; Topic 1. Pythagorean Theorem; Task 3.1.2

Broken Calculators. Prepared by Daniel Finkel for the Julia Robinson Festival

TERMINATION FOR HYBRID TABLEAUS

Efficiency of Choice Set Generation Methods for Bicycle Routes

Applying Bi-objective Shortest Path Methods to Model Cycle Route-choice

Computational Models: Class 6

CS 4649/7649 Robot Intelligence: Planning

There s Math in March Madness

Incremental ARA*: An Anytime Incremental Search Algorithm For Moving Target Search. University of Southern California Singapore Management University

OIL & GAS. 20th APPLICATION REPORT. SOLUTIONS for FLUID MOVEMENT, MEASUREMENT & CONTAINMENT. Q&A: OPEC Responds to SHALE BOOM

At each type of conflict location, the risk is affected by certain parameters:

Exercise 11: Solution - Decision tree

y ) s x x )(y i (x i r = 1 n 1 s y Statistics Lecture 7 Exploring Data , y 2 ,y n (x 1 ),,(x n ),(x 2 ,y 1 How two variables vary together

CMSC131. Introduction to Computational Thinking. (with links to some external Scratch exercises) How do you accomplish a task?

ENHANCED PARKWAY STUDY: PHASE 2 CONTINUOUS FLOW INTERSECTIONS. Final Report

CS 4649/7649 Robot Intelligence: Planning

Optimization and Search. Jim Tørresen Optimization and Search

Maximum CPU utilization is obtained by multiprogramming. CPU I/O Burst Cycle Process execution consists of a cycle of CPU execution and I/O wait

Estimating a Toronto Pedestrian Route Choice Model using Smartphone GPS Data. Gregory Lue

Generating Efficient Breeding Plans for Thoroughbred Stallions

Ocean Fishing Fleet Scheduling Path Optimization Model Research. Based On Improved Ant Colony Algorithm

If you need to reinstall FastBreak Pro you will need to do a complete reinstallation and then install the update.

ISyE 3103 Introduction to Supply Chain Modeling: Logistics Summer 2012 Homework 8 Issued: July 11, 2012 Due: July 18, 2012

Problem-Solving: A* and Beyond. CSCI 3202, Fall 2010

Prof. Brian C. Williams February 23 rd, /6.834 Cognitive Robotics. based on [Kim,Williams & Abramson, IJCAI01] Outline

Flyweight Pattern. Flyweight: Intent. Use sharing to support large numbers of fine-grained objects efficiently. CSIE Department, NTUT Chien-Hung Liu

Worker Seriously Injured Servicing a Plunger Lift System

Neural Nets Using Backpropagation. Chris Marriott Ryan Shirley CJ Baker Thomas Tannahill

Heap Sort. Lecture 35. Robb T. Koether. Hampden-Sydney College. Mon, Apr 25, 2016

Optimizing Cyclist Parking in a Closed System

Understanding Anchor Systems

Measuring Length. Goals. You will be able to

Tokyo: Simulating Hyperpath-Based Vehicle Navigations and its Impact on Travel Time Reliability

CSC242: Intro to AI. Lecture 21

Centennial Neighbourhoods Transportation Management Plan Summary of Phase 1 Consultation. Overview of Issues

The Rule of Right-Angles: Exploring the term Angle before Depth

Methods for the Anisotropic Wavelet Packet Transform

Decision Trees. an Introduction

Roundabouts along Rural Arterials in South Africa

GRAPH-BASED SPORTS RANKINGS

Provably Secure Camouflaging Strategy for IC Protection

Planning and Acting in Partially Observable Stochastic Domains

Three New Methods to Find Initial Basic Feasible. Solution of Transportation Problems

Ingersoll Rand. X-Series System Automation

Transcription:

Lecture 3 Uninformed search methods Milos Hauskrecht milos@cs.pitt.edu 5329 Sennott Square Announcements Homework assignment 1 is out Due on Tuesday, September 12, 2017 before the lecture Report and programming part: Programming part involves Puzzle 8 problem. Course web page: http://www.cs.pitt.edu/~milos/courses/cs2710/ Homework submission: Electronic via CourseWeb Separate report and programming part 1

Search Search (process) The process of exploration of the search space The efficiency of the search depends on: The search space and its size Method used to explore (traverse) the search space Condition to test the satisfaction of the search objective (what it takes to determine I found the desired goal object Search Search (process) The process of exploration of the search space The efficiency of the search depends on: The search space and its size Method used to explore (traverse) the search space Condition to test the satisfaction of the search objective (what it takes to determine I found the desired goal object 2

Search process Exploration of the state space through successive application of operators from the initial state Search tree = structure representing the exploration trace Is built on-line during the search process Branches correspond to explored paths, and leaf nodes to the exploration fringe Zerind Sibiu Timisoara Fagaras Rimnicu Vilcea Search tree A branch in the search tree = a path in the graph Zerind Sibiu Timisoa ra Fagaras Rimnicu Lugoj Vilcea 3

Uninformed search methods Search techniques that rely only on the information available in the problem definition Breadth first search Depth first search Iterative deepening Bi-directional search For the minimum cost path problem: Uniform cost search Search methods Properties of search methods : Completeness. Does the method find the solution if it exists? Optimality. Is the solution returned by the algorithm optimal? Does it give a minimum length path? Space and time complexity. How much time it takes to find the solution? How much memory is needed to do this? 4

Parameters to measure complexities. Space and time complexity. Complexity is measured in terms of the following tree parameters: b maximum branching factor d depth of the optimal solution m maximum depth of the state space Branching factor The number of applicable operators Breadth first search (BFS) The shallowest node is expanded first 5

Breadth-first search Expand the shallowest node first Implementation: put successors to the end of the queue (FIFO) queue Zerind Sibiu Timisoara Fagaras Rimnicu Lugoj Vilcea Breadth-first search queue Zerind Sibiu Timisoara Zerind Sibiu Timisoara Fagaras Rimnicu Lugoj Vilcea 6

Breadth-first search queue Sibiu Timisoara Zerind Sibiu Timisoara Fagaras Rimnicu Lugoj Vilcea Breadth-first search Zerind Sibiu Timisoara queue Timisoara Fagaras Romnicu Vilcea Fagaras Rimnicu Vilcea Lugoj 7

Breadth-first search Zerind Sibiu Timisoara queue Fagaras Romnicu Vilcea Lugoj Fagaras Rimnicu Lugoj Vilcea Properties of breadth-first search Completeness:? Optimality:? Time complexity:? Memory (space) complexity:? For complexity use: b maximum branching factor d depth of the optimal solution m maximum depth of the search tree 8

Properties of breadth-first search Completeness: Yes. The solution is reached if it exists. Optimality:? Time complexity:? Memory (space) complexity:? Properties of breadth-first search Completeness: Yes. The solution is reached if it exists. Optimality: Yes, for the shortest path. Time complexity:? Memory (space) complexity:? 9

BFS time complexity depth number of nodes b 0 1 d 1 2 1 =2 2 2 2 =4 3 2 3 =8 d 2 d (b d ) d+1 2 d+1 (b d+1 ) Total nodes:? BFS time complexity depth number of nodes b 0 1 d 1 2 1 =2 2 2 2 =4 3 2 3 =8 d 2 d (b d ) d+1 2 d+1 (b d+1 ) Expanded nodes: O( b d ) d 1 Total nodes: O( b ) 10

Properties of breadth-first search Completeness: Yes. The solution is reached if it exists. Optimality: Yes, for the shortest path. Time complexity: 2 d d 1 b b b O( b ) exponential in the depth of the solution d Memory (space) complexity:? BFS memory complexity Count nodes kept in the tree structure or in the queue b depth number of nodes 0 1 d 1 2 1 =2 2 2 2 =4 3 2 3 =8 d 2 d (b d ) d+1 2 d+1 (b d+1 ) Total nodes:? 11

BFS memory complexity Count nodes kept in the tree structure or in the queue b depth number of nodes 0 1 d 1 2 1 =2 2 2 2 =4 3 2 3 =8 d 2 d (b d ) d+1 2 d+1 (b d+1 ) Expanded nodes: O( b d ) d 1 Total nodes: O( b ) Properties of breadth-first search Completeness: Yes. The solution is reached if it exists. Optimality: Yes, for the shortest path. Time complexity: 2 d d 1 b b b O( b ) exponential in the depth of the solution d Memory (space) complexity: O( b d ) nodes are kept in the memory 12

Depth-first search (DFS) The deepest node is expanded first Backtrack when the path cannot be further expanded Depth-first search The deepest node is expanded first Implementation: put successors to the beginning of the queue queue Zerind Sibiu Timisoara Fagaras Rimnicu Lugoj Vilcea 13

Depth-first search Zerind Sibiu Timisoara queue Zerind Sibiu Timisoara Fagaras Rimnicu Lugoj Vilcea Depth-first search Zerind Sibiu Timisoara queue Sibiu Timisoara Fagaras Rimnicu Lugoj Vilcea 14

Depth-first search Zerind Sibiu Timisoara queue Zerind Sibiu Timisoara Sibiu Timisoara Fagaras Rimnicu Lugoj Vilcea Zerind Sibiu Timisoara Note: Zerind cycle Properties of depth-first search Completeness: Does it always find the solution if it exists? Optimality:? Time complexity:? Memory (space) complexity:? 15

Properties of depth-first search Completeness: No. Infinite loops can occur. Optimality: does it find the minimum length path? Time complexity:? Memory (space) complexity:? Properties of depth-first search Completeness: No. Infinite loops can occur. Solution 1: set the maximum depth limit m Solution 2: prevent occurrence of cycles Optimality: does it find the minimum length path? Time complexity:? Memory (space) complexity:? 16

Properties of depth-first search Completeness: No, if we permit infinite loops.. Solution 1: set the maximum depth limit m Solution 2: prevent occurrence of cycles Optimality: does it find the minimum length path? Time complexity:? Memory (space) complexity:? Properties of depth-first search Completeness: No. If we permit infinite loops. Solution 1: set the maximum depth limit m Solution 2: prevent occurrence of cycles Optimality: No. Solution found first may not be the shortest possible. Time complexity:? Memory (space) complexity:? 17

Properties of depth-first search Completeness: No. If we permit infinite loops. Solution 1: set the maximum depth limit m Solution 2: prevent occurrence of cycles Optimality: No. Solution found first may not be the shortest possible. Time complexity: assume a finite maximum tree depth m Memory (space) complexity:? DFS time complexity depth number of nodes b 0 1 m d 1 2 1 =2 2 2 2 =4 3 2 3 =8 d 2 d m 2 m -2 m-d Complexity: 18

DFS time complexity depth number of nodes b 0 1 m d 1 2 1 =2 2 2 2 =4 3 2 3 =8 d 2 d m 2 m -2 m-d Complexity: O( b m ) Properties of depth-first search Completeness: No. If we permit infinite loops. Solution 1: set the maximum depth limit m Solution 2: prevent occurrence of cycles Optimality: No. Solution found first may not be the shortest possible. Time complexity: O( b m ) exponential in the maximum depth of the search tree m Memory (space) complexity:? 19

DFS memory complexity depth number of nodes kept b 0 1 DFS memory complexity depth number of nodes kept b 0 0 1 2 = b 20

DFS memory complexity depth number of nodes kept b 0 0 1 1 = (b-1) 2 2 = b DFS memory complexity depth number of nodes kept b 0 0 m 1 1 2 1 3 1 m 2=b Complexity: 21

DFS memory complexity depth number of nodes kept b 0 0 m 1 1=(b-1) 2 1= (b-1) 3 1 =(b-1) m 2=b Complexity: O(bm) DFS memory complexity Count nodes kept in the tree structure or the queue depth number of nodes b 0 1 m 1 2 = b 2 2 3 2 m 2 Total nodes: O(bm) 22

Properties of depth-first search Completeness: No. If we permit infinite loops. Solution 1: set the maximum depth limit m Solution 2: prevent occurrence of cycles Optimality: No. Solution found first may not be the shortest possible. Time complexity: O( b m ) exponential in the maximum depth of the search tree m Memory (space) complexity:? O(bm) linear in the maximum depth of the search tree m Setting the maximum depth of the depthfirst search Setting the maximum depth of the search tree avoids pitfalls of depth first search Use cutoff on the maximum depth of the tree Problem: How to pick the maximum depth? Assume: we have a traveler problem with 20 cities How to pick the maximum tree depth? 23

Setting the maximum depth of the depthfirst search Setting the maximum depth of the search tree avoids pitfalls of depth first search Problem: How to pick the maximum depth? Assume: we have a traveler problem with 20 cities How to pick the maximum tree depth? We need to consider only paths of length < 20 Limited depth DFS Time complexity: O( b m ) Memory complexity: O(bm) Elimination of state repeats While searching the state space for the solution we can encounter the same state many times. Question: Is it necessary to keep and expand all copies of states in the search tree? Two possible cases: (A) Cyclic state repeats Search tree (B) Non-cyclic state repeats A B A B 24

Elimination of cycles A A Case A: Corresponds to the path with a cycle Question: Can the branch (path) in which the same state is visited twice ever be a part of the optimal (shortest) path between the initial state and the goal???? Elimination of cycles A A Case A: Corresponds to the path with a cycle Question: Can the branch (path) in which the same state is visited twice ever be a part of the optimal (shortest) path between the initial state and the goal? No!! Branches representing cycles cannot be the part of the shortest solution and can be eliminated. 25

Elimination of cycles A A How to check for cyclic state repeats: Do not expand the node with the state that is the same as the state in one of its ancestors. Check ancestors in the tree structure Caveat: we need to keep the tree. Elimination of non-cyclic state repeats Root of the search tree B nodeb-1 B nodeb-2 Case B: nodes with the same state are not on the same path from the initial state Question: Is one of the nodes nodeb-1, nodeb-2 better or preferable? 26

Elimination of non-cyclic state repeats Root of the search tree B nodeb-1 B nodeb-2 Case B: nodes with the same state are not on the same path from the initial state Question: Is one of the nodes nodeb-1, nodeb-2 better or preferable? Yes. nodeb-1 represents a shorter path from the initial state to B Elimination of non-cyclic state repeats Root of the search tree B nodeb-1 B nodeb-2 Conclusion: Since we are happy with the optimal solution nodeb-2 can be eliminated. It does not affect the optimality of the solution. Problem: Nodes can be encountered in different order during different search strategies. 27

Elimination of non-cyclic state repeats with BFS Root of the search tree B nodeb-1 B nodeb-2 Breadth FS is well behaved with regard to non-cyclic state repeats: nodeb-1 is always expanded before nodeb-2 Order of expansion determines the correct elimination strategy we can safely eliminate the node that is associated with the state that has been expanded before Elimination of state repeats for the BFS For the breadth-first search (BFS) we can safely eliminate all second, third, fourth, etc. occurrences of the same state this rule covers both cyclic and non-cyclic repeats!!! Implementation of all state repeat elimination through marking: All expanded states are marked All marked states are stored in a hash table Checking if the node has ever been expanded corresponds to the mark structure lookup Use hash table to implement marking 28

Elimination of non-cyclic state repeats with DFS Root of the search tree B nodeb-1 B nodeb-2 Depth FS: nodeb-2 can be expanded before nodeb-1 The order of node expansion does not imply correct elimination strategy we need to remember the length of the path between nodes to safely eliminate them Elimination of all state redundancies General strategy: A node is redundant if there is another node with exactly the same state and a shorter path from the initial state Works for any search method Uses additional path length information Implementation: hash table with the minimum path value: The new node is redundant and can be eliminated if it is in the hash table (it is marked), and its path is longer or equal to the value stored. Otherwise the new node cannot be eliminated and it is entered together with its value into the hash table. (if the state was in the hash table the new path value is better and needs to be overwritten.) 29