Uninformed search methods

Similar documents
Uninformed search methods

Uninformed search methods II.

Uninformed search methods II.

Artificial Intelligence. Uninformed Search Strategies

Uninformed Search (Ch )

Problem Solving Agents

Uninformed Search Strategies

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

CSE 3401: Intro to AI & LP Uninformed Search II

Solving Problems by Searching chap3 1. Problem-Solving Agents

Problem Solving as Search - I

Uninformed Search (Ch )

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

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

CSE 3402: Intro to Artificial Intelligence Uninformed Search II

Better Search Improved Uninformed Search CIS 32

Representation. Representation. Representation. Representation. 8 puzzle.

Uninformed search strategies

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

COMP9414: Artificial Intelligence Uninformed Search

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

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

SEARCH TREE. Generating the children of a node

CS 4649/7649 Robot Intelligence: Planning

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

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

CSC384: Introduction to Artificial Intelligence. Search

Depth-bounded Discrepancy Search

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

6.034 Artificial Intelligence

Transposition Table, History Heuristic, and other Search Enhancements

Advanced Search Hill climbing

/435 Artificial Intelligence Fall 2015

G53CLP Constraint Logic Programming

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

Aryeh Rappaport Avinoam Meir. Schedule automation

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

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

Provably Secure Camouflaging Strategy for IC Protection

The Evolution of Transport Planning

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

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

Algorithms and Data Structures

CMPUT680 - Winter 2001

CS 4649/7649 Robot Intelligence: Planning

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

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

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

Optimization and Search. Jim Tørresen Optimization and Search

Analysis of Professional Cycling Results as a Predictor for Future Success

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

CS 4649/7649 Robot Intelligence: Planning

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

CS 4649/7649 Robot Intelligence: Planning

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

Incompressible Potential Flow. Panel Methods (3)

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

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

CS 4649/7649 Robot Intelligence: Planning

Practical Approach to Evacuation Planning Via Network Flow and Deep Learning

A new Decomposition Algorithm for Multistage Stochastic Programs with Endogenous Uncertainties

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

EE582 Physical Design Automation of VLSI Circuits and Systems

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

Running the Table: An AI for Computer Billiards

knn & Naïve Bayes Hongning Wang

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

Shot-by-shot directional source deghosting and directional designature using near-gun measurements

Generating Efficient Breeding Plans for Thoroughbred Stallions

STICTION: THE HIDDEN MENACE

Lecture 5. Optimisation. Regularisation

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

University of Cincinnati

Practical Guide to ICD 10:

Introduction to Algorithms

COLREGS Based Collision Avoidance of Unmanned Surface Vehicles

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

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

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

Traffic circles. February 9, 2009

Sontek RiverSurveyor Test Plan Prepared by David S. Mueller, OSW February 20, 2004

i) Linear programming

Determining Occurrence in FMEA Using Hazard Function

DESIGN AND ANALYSIS OF ALGORITHMS (DAA 2017)

Efficiency of Choice Set Generation Methods for Bicycle Routes

Supplementary Material for Bayes Merging of Multiple Vocabularies for Scalable Image Retrieval

CS472 Foundations of Artificial Intelligence. Final Exam December 19, :30pm

University of Cincinnati

Application of Bayesian Networks to Shopping Assistance

Planning and Acting in Partially Observable Stochastic Domains

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

Computational Models: Class 6

ERP TO E2RP: A CASE STUDY APPROACH BY SANDEEPABHISHEK SRIVASTAVA DESAI

Titolo presentazione sottotitolo

Efficient Minimization of Routing Cost in Delay Tolerant Networks

1 PIPESYS Application

Software Reliability 1

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

Queue analysis for the toll station of the Öresund fixed link. Pontus Matstoms *

Improved Real-time Monitoring and Control of Water Supply Networks by Use of Graph Decomposition

Transcription:

Lecture 3 Uninformed search methods Milos Hauskrecht milos@cs.pitt.edu 5329 Sennott Square Announcements Homework 1 Access through the course web page http://www.cs.pitt.edu/~milos/courses/cs2710/ Two things to download: Problem statement C/C++ programs you will need for the assignment Due date: September 14, 2004 before the lecture Submission: Reports: on the paper at the lecture Programs: electronic submissions Submission guidelines: http://www.cs.pitt.edu/~milos/courses/cs2710/program-submissions.html

Formulating a search problem Many challenging problems in practice require search Search (process) The process of exploration of the search space Search space: alternatives (objects) among which we search for the solution 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 Think twice before solving the problem by search: Choose the search space and the exploration policy Uninformed search methods Many different ways to explore the state space (build a tree) Uninformed search methods: use only 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? Parameters to measure complexities. Space and time complexity. Complexities are measured in terms of parameters: b maximum branching factor d depth of the optimal solution m maximum depth of the state space Branching factor Number of operators

Breadth first search (BFS) The shallowest node is expanded first Breadth-first search Expand the shallowest node first Implementation: put successors to the end of the queue (FIFO) queue Fagaras Lugoj

Breadth-first search queue Fagaras Lugoj Breadth-first search queue Fagaras Lugoj

Breadth-first search queue Fagaras Romnicu Fagaras Lugoj Breadth-first search queue Fagaras Romnicu Lugoj Fagaras Lugoj

Properties of breadth-first search Completeness:? Optimality:? Time complexity:? Memory (space) complexity:? For complexities use: b maximum branching factor d depth of the optimal solution m maximum depth of the search tree 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:?

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 ) Properties of breadth-first search Completeness: Yes. The solution is reached if it exists. Optimality: Yes, for the shortest path. Time complexity: 2 1 + b + b d + K + b d = 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 ) 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 1 + b + b d + K + b d = O ( b ) exponential in the depth of the solution d Memory (space) complexity: O ( b d ) nodes are kept in the memory

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 Fagaras Lugoj

Depth-first search queue Fagaras Lugoj Depth-first search queue Fagaras Lugoj

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

Properties of depth-first search Completeness: No. Infinite loops can occur. Infinite loops imply -> Infinite depth search tree. Optimality: does it find the minimum length path? Time complexity:? Memory (space) complexity:? Properties of depth-first search Completeness: No. Infinite loops can occur. Optimality: No. Solution found first may not be the shortest possible. Time complexity:? Memory (space) complexity:?

Properties of depth-first search Completeness: No. Infinite loops can occur. Optimality: No. Solution found first may not be the shortest possible. Time complexity:? 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 Total nodes: O ( b m )

Properties of depth-first search Completeness: No. Infinite loops can occur. Optimality: No. Solution found first may not be the shortest possible. Time complexity: m O ( b ) exponential in the maximum depth of the search tree m Memory (space) complexity:? 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 )

Properties of depth-first search Completeness: No. Infinite loops can occur. Optimality: No. Solution found first may not be the shortest possible. Time complexity: m O ( b ) exponential in the maximum depth of the search tree m Memory (space) complexity: O(bm ) the tree size we need to keep is linear in the maximum depth of the search tree m Limited-depth depth first search The limit (l) on the depth of the depth-first exploration Limit l=2 l Not explored Time complexity: Memory complexity: O ( b l ) O(bl ) l - is the given limit

Limited depth depth-first search Avoids pitfalls of depth first search Use cutoff on the maximum depth of the tree How to pick the maximum depth? Assume: we have a traveler problem with 20 cities How to pick the maximum tree depth? Limited depth depth-first search Avoids pitfalls of depth first search Use cutoff on the maximum depth of the tree 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 l ) Memory complexity: O(bl ) l -is the limit

Iterative deepening algorithm (IDA) Based on the idea of the limited-depth search, but It resolves the difficulty of knowing the depth limit ahead of time. Idea: try all depth limits in an increasing order. That is, search first with the depth limit l=0, then l=1, l=2, and so on until the solution is reached Iterative deepening combines advantages of the depth-first and breadth-first search with only moderate computational overhead Iterative deepening algorithm (IDA) Progressively increases the limit of the limited-depth depthfirst search Limit 0 Limit 1 Limit 2

Iterative deepening Cutoff depth = 0 Fagaras Lugoj Iterative deepening Cutoff depth = 0 Fagaras Lugoj

Iterative deepening Cutoff depth = 1 Fagaras Lugoj Iterative deepening Cutoff depth = 1 Fagaras Lugoj

Iterative deepening Cutoff depth = 1 Fagaras Lugoj Iterative deepening Cutoff depth = 1 Fagaras Lugoj

Iterative deepening Cutoff depth = 1 Fagaras Lugoj Iterative deepening Cutoff depth = 2 Fagaras Lugoj

Iterative deepening Cutoff depth = 2 Fagaras Lugoj Iterative deepening Cutoff depth = 2 Fagaras Lugoj

Iterative deepening Cutoff depth = 2 Fagaras Lugoj Iterative deepening Cutoff depth = 2 Fagaras Lugoj

Iterative deepening Cutoff depth = 2 Fagaras Lugoj Properties of IDA Completeness:? Optimality:? Time complexity:? Memory (space) complexity:?

Properties of IDA Completeness: Yes. The solution is reached if it exists. (the same as BFS when limit is always increased by 1) Optimality: Yes, for the shortest path. (the same as BFS) Time complexity:? Memory (space) complexity:? IDA time complexity Level 0 Level 1 Level 2 Level d d O (1) O (b) O ( b 2 ) O ( b d ) O ( b d )

Properties of IDA Completeness: Yes. The solution is reached if it exists. (the same as BFS) Optimality: Yes, for the shortest path. (the same as BFS) Time complexity: 1 2 d d O (1) + O( b ) + O ( b ) + K + O ( b ) = O ( b ) exponential in the depth of the solution d worse than BFS, but asymptotically the same Memory (space) complexity:? IDA memory complexity Level 0 Level 1 Level 2 Level d d O (1) O (b) O ( 2b) O(db ) O(db )

Properties of IDA Completeness: Yes. The solution is reached if it exists. (the same as BFS) Optimality: Yes, for the shortest path. (the same as BFS) Time complexity: 1 2 d d O (1) + O( b ) + O ( b ) + K + O ( b ) = O ( b ) exponential in the depth of the solution d worse than BFS, but asymptotically the same Memory (space) complexity: O(db ) much better than BFS 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

Elimination of cycles A A Case A: Corresponds to the path with a cycle 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 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.

Elimination of cycles A A How to check for cyclic state repeats: Check ancestors in the tree structure Caveat: we need to keep the tree. Do not expand the node with the state that is the same as the state in one of its ancestors. 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 Is one of the nodes nodeb-1, nodeb-2 better or preferable??

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 Is one of the nodes nodeb-1, nodeb-2 better or preferable? Yes. nodeb-1 represents the shorter path between the initial state and B Elimination of non-cyclic state repeats Root of the search tree B nodeb-1 B nodeb-2 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.

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

Elimination of non-cyclic state repeats with DFS Root of the search tree B nodeb-1 B nodeb-2 Depth FS: nodeb-2 is 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: marking 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.)

Bi-directional search In some search problems we want to find the path from the initial state to the unique goal state (e.g. traveler problem) Bi-directional search: Initial state Goal state Search both from the initial state and the goal state; Use inverse operators for the goal-directed search. Bi-directional search When does it help? It cuts the size of the search tree by half. What is necessary? Merge the solutions. Initial state Goal state Equal?