Uninformed Search Lecture 4

Similar documents
DATA Search I 魏忠钰. 复旦大学大数据学院 School of Data Science, Fudan University. March 7 th, 2018

CS 188: Artificial Intelligence Spring 2007

Search: The Core of Planning

Reinforcement Learning

Chapter 5 Plan-Space Planning

19 Optimal behavior: Game theory

We will see what is meant by standard form very shortly

Decision Networks. CS 188: Artificial Intelligence Fall Example: Decision Networks. Decision Networks. Decisions as Outcome Trees

Administrivia CSE 190: Reinforcement Learning: An Introduction

20 MATHEMATICS POLYNOMIALS

CMSC 330: Organization of Programming Languages. DFAs, and NFAs, and Regexps (Oh my!)

4. GREEDY ALGORITHMS I

Agenda. Agenda. Regular Expressions. Examples of Regular Expressions. Regular Expressions (crash course) Computational Linguistics 1

This lecture covers Chapter 8 of HMU: Properties of CFLs

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Chapter 2 Finite Automata

Strong Bisimulation. Overview. References. Actions Labeled transition system Transition semantics Simulation Bisimulation

Finite Automata. Informatics 2A: Lecture 3. John Longley. 22 September School of Informatics University of Edinburgh

The Regulated and Riemann Integrals

The graphs of Rational Functions

CS415 Compilers. Lexical Analysis and. These slides are based on slides copyrighted by Keith Cooper, Ken Kennedy & Linda Torczon at Rice University

Convert the NFA into DFA

CS 188 Introduction to Artificial Intelligence Fall 2018 Note 7

Good-for-Games Automata versus Deterministic Automata.

Artificial Intelligence Markov Decision Problems

. Double-angle formulas. Your answer should involve trig functions of θ, and not of 2θ. sin 2 (θ) =

Non-Deterministic Finite Automata. Fall 2018 Costas Busch - RPI 1

Module 6 Value Iteration. CS 886 Sequential Decision Making and Reinforcement Learning University of Waterloo

Reinforcement learning II

Improper Integrals, and Differential Equations

CS S-12 Turing Machine Modifications 1. When we added a stack to NFA to get a PDA, we increased computational power

How can we approximate the area of a region in the plane? What is an interpretation of the area under the graph of a velocity function?

CSC 473 Automata, Grammars & Languages 11/9/10

KNOWLEDGE-BASED AGENTS INFERENCE

State space systems analysis (continued) Stability. A. Definitions A system is said to be Asymptotically Stable (AS) when it satisfies

Probabilistic Model Checking Michaelmas Term Dr. Dave Parker. Department of Computer Science University of Oxford

Lexical Analysis Finite Automate

7.2 The Definite Integral

Lexical Analysis Part III

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. NFA for (a b)*abb.

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. Comparing DFAs and NFAs (cont.) Finite Automata 2

Goals: Determine how to calculate the area described by a function. Define the definite integral. Explore the relationship between the definite

Efficient Planning. R. S. Sutton and A. G. Barto: Reinforcement Learning: An Introduction

Nondeterminism and Nodeterministic Automata

CS 373, Spring Solutions to Mock midterm 1 (Based on first midterm in CS 273, Fall 2008.)

f(x) dx, If one of these two conditions is not met, we call the integral improper. Our usual definition for the value for the definite integral

CS 188: Artificial Intelligence Fall 2010

Improper Integrals. Type I Improper Integrals How do we evaluate an integral such as

Connected-components. Summary of lecture 9. Algorithms and Data Structures Disjoint sets. Example: connected components in graphs

NFAs continued, Closure Properties of Regular Languages

Properties of Integrals, Indefinite Integrals. Goals: Definition of the Definite Integral Integral Calculations using Antiderivatives

Bases for Vector Spaces

NFAs continued, Closure Properties of Regular Languages

Balanced binary search trees

CMSC 330: Organization of Programming Languages

Faster Regular Expression Matching. Philip Bille Mikkel Thorup

Bellman Optimality Equation for V*

COMP 250. Lecture 20. tree traversal. Oct. 25/26, 2017

1 Nondeterministic Finite Automata

Turing Machines Part One

CHAPTER 1 Regular Languages. Contents. definitions, examples, designing, regular operations. Non-deterministic Finite Automata (NFA)

Anatomy of a Deterministic Finite Automaton. Deterministic Finite Automata. A machine so simple that you can understand it in less than one minute

CS 188: Artificial Intelligence

Mathematics Extension 1

CS 275 Automata and Formal Language Theory

Decision Networks. CS 188: Artificial Intelligence. Decision Networks. Decision Networks. Decision Networks and Value of Information

MATH 144: Business Calculus Final Review

p-adic Egyptian Fractions

Chapter 4 State-Space Planning

CS 301. Lecture 04 Regular Expressions. Stephen Checkoway. January 29, 2018

Review of Gaussian Quadrature method

Genetic Programming. Outline. Evolutionary Strategies. Evolutionary strategies Genetic programming Summary

. Double-angle formulas. Your answer should involve trig functions of θ, and not of 2θ. cos(2θ) = sin(2θ) =.

38 Riemann sums and existence of the definite integral.

MTH 122 Fall 2008 Essex County College Division of Mathematics Handout Version 10 1 October 14, 2008

Concepts of Concurrent Computation Spring 2015 Lecture 9: Petri Nets

Part 5 out of 5. Automata & languages. A primer on the Theory of Computation. Last week was all about. a superset of Regular Languages

Mathcad Lecture #1 In-class Worksheet Mathcad Basics

Situation Calculus. Situation Calculus Building Blocks. Sheila McIlraith, CSC384, University of Toronto, Winter Situations Fluents Actions

Module 9: Tries and String Matching

Module 9: Tries and String Matching

Review of Calculus, cont d

Intermediate Math Circles Wednesday, November 14, 2018 Finite Automata II. Nickolas Rollick a b b. a b 4

On Determinisation of History-Deterministic Automata.

Jim Lambers MAT 169 Fall Semester Lecture 4 Notes

First Midterm Examination

5.1 Definitions and Examples 5.2 Deterministic Pushdown Automata

Numerical Integration

NFAs and Regular Expressions. NFA-ε, continued. Recall. Last class: Today: Fun:

Math Lecture 23

Parse trees, ambiguity, and Chomsky normal form

Categorical approaches to bisimilarity

Finite Automata-cont d

Bayesian Networks: Approximate Inference

Chapter 6 Notes, Larson/Hostetler 3e

More on automata. Michael George. March 24 April 7, 2014

1.4 Nonregular Languages

Math 360: A primitive integral and elementary functions

FABER Formal Languages, Automata and Models of Computation

Riemann Sums and Riemann Integrals

Transcription:

Lecture 4 Wht re common serch strtegies tht operte given only serch problem? How do they compre? 1

Agend A quick refresher DFS, BFS, ID-DFS, UCS Unifiction! 2

Serch Problem Formlism Defined vi the following components: The initil stte the gent strts in A successor/trnsition function S(x) = {ction+cost->stte} A gol test, which determines whether given stte is gol stte A pth cost tht ssigns numeric cost to ech pth A solution is sequence of ctions leding from initil stte to gol stte (optiml = lowest pth cost) Together the initil stte nd successor function implicitly define the stte spce, the set of ll rechble sttes 3

Stte Spce Grph Stte spce grph: A mthemticl representtion of serch problem Nodes re (bstrcted) world configurtions Arcs represent successors (ction results) The gol test is set of gol node(s) In serch grph, ech stte occurs only once! We cn rrely build this full grph in memory (i.e. it s too big), but it s useful ide S b p d q c h e r f G 4

Serch Tree A wht if tree of plns nd their outcomes The strt stte is the root node Children correspond to successors Nodes show sttes, but correspond to PLANS tht chieve those sttes For most problems, we cn never ctully build the whole tree N, 1.0 E, 1.0 5

Serching for Solutions Bsic ide: incrementlly build serch tree until gol stte is found Root = initil stte Expnd vi trnsition function to crete new nodes Nodes tht hven t been expnded re lef nodes nd form the frontier (open list) Different serch strtegies choose next node to expnd (s few s possible!) Use closed list to prevent expnding the sme stte more thn once 6

Generl Algorithm Queue (FIFO) Stck (LIFO) Priority Queue 7

Evluting Serch Strtegy Solution Completeness: does it lwys find solution if one exists? Efficiency Time Complexity: number of nodes generted/expnded Optimlity: does it lwys find lest-cost solution? Spce Complexity: mximum number of nodes in memory 8

Depth-First Serch (DFS) 9

DFS Exmple 10 S b d p c e p h f r q q c G q e p h f r q q c G S G d b p q c e h f r q p h f d b c e r Strtegy: expnd deepest node first Implementtion: Fringe is LIFO stck

Let s Evlute! 11

Serch Tree Properties Brnching fctor Mximum depth m tiers b 1 node b nodes b 2 nodes Solutions t vrious depths b m nodes Number of nodes in the tree? 1 + b + b 2 +. b m = O(?) b m 12

DFS Evlution Time Expnds left Could be whole tree! Assuming finite depth, O(b m ) m tiers b 1 node b nodes b 2 nodes Spce Only siblings on pth, O(bm) Complete Only if finite b m nodes Optiml No, left-most w/o regrd to cost/depth 13

Bredth-First Serch (BFS) 14

BFS Exmple Strtegy: expnd shllowest node first Implementtion: Fringe is FIFO queue S b p d q c h e r f G S Serch Tiers b d c h e r p h q e r f p q p q f q c G q c G 15

BFS Evlution Time Processes ll nodes bove shllowest solution, O(b s ) s tiers b 1 node b nodes b 2 nodes Spce Hs roughly the lst tier, so O(b s ) Complete Yes! b s nodes b m nodes Optiml Only if ll costs equl (more lter) 16

DFS vs. BFS Empty-DFS Empty-BFS Mze-DFS Mze-BFS 17

Grounding the Brnching Fctor Depth Nodes Time Memory 2 110 0.11 msecs 107 KB 4 11,110 11 msecs 10.6 MB 6 10 6 1.1 secs 1 GB 8 10 8 2 mins 103 GB 10 10 10 3 hours 10 TB 12 10 12 13 dys 1 PB 14 10 14 3.5 yers 99 PB 16 10 16 350 yers 10 EB Assumptions b = 10 1 million nodes/second 1000 bytes/node Memory often becomes the limiting fctor 18

Itertive Deepening DFS (ID-DFS) Bsic ide: DFS memory with BFS time/shllow solution DFS up to 1 DFS up to 2. Generlly most work hppens in the lowest level serched, so not too wsteful b 19

Cost-Sensitive Serch b 2 3 1 d 2 c 3 8 2 e 9 8 2 GOAL 2 f START 1 p 4 15 q 4 h r 2 BFS finds the shortest pth in terms of number of ctions, but it does not find the lest-cost pth. We will now cover similr lgorithm which does! 20

Uniform-Cost Serch (UCS) 21

UCS Exmple Strtegy: expnd chepest node first Fringe is priority queue (priority: cumultive cost) S 1 b 3 S 2 p 1 0 d 15 8 9 q 2 c h e 8 2 r G 2 f 1 Cost contours b 4 6 d c 3 e 9 e 5 h 17 r 11 11 h 13 r 7 p q f p q f 8 q c G p q 1 16 q 11 c G 10 22

UCS Evlution Time O(b C*/ε ) Spce O(b C*/ε ) C*/e tiers (effective depth) b c 1 c 2 c 3 Complete Yes! Optiml Yes! Assume optiml solution costs C* nd rcs cost t lest ε 23

UCS vs. DFS vs. BFS UCS is good nd optiml However, it still moves in every direction it s not informed bout gol direction Empty-UCS Mze-UCS MzeCost-DFS c 1 c 2 c 3 Strt Gol MzeCost-BFS MzeCost-UCS 24

All these serch lgorithms re the sme except for fringe strtegies Conceptully, ll fringes re priority queues (i.e. collections of nodes with ttched priorities) Prcticlly, for DFS nd BFS, you cn void the log(n) overhed from n ctul priority queue, by using stcks nd queues Unifiction 25

Serch given only the problem definition DFS BFS UCS Fringe LIFO (stck) FIFO (queue) PQ (pth cost) Complete X X Optiml X Time O(b % ) O(b ' ) O(b ( /+ ) Spce O(bm) O(b ' ) O(b ( /+ ) Assumptions: potentilly infinite depth, rbitrry positive ction costs 26

Serch opertes over models of the world The gent doesn t ctully try ll the plns out in the rel world! Plnning is ll in simultion Your serch is only s good s your models A Reminder 27

Serch Gone Wrong 28

Summry We evluted severl uninformed strtegies to solve serch problem DFS, BFS, ID-DFS, UCS DFS, BFS, nd UCS cn ll be implemented vi generic grph-serch lgorithm over serch tree by simply chnging how the fringe is orgnized 29