Uninformed search. Lirong Xia

Similar documents
Constraint satisfaction problems. Lirong Xia

ECE250: Algorithms and Data Structures Trees

Title: Solving Problems by Searching AIMA: Chapter 3 (Sections 3.1, 3.2 and 3.3)

Priority Queues & Heaps

Midterm Review. EECS 2011 Prof. J. Elder - 1 -

Priority Queues & Heaps

Priority Queues & Heaps

Computational Social Processes. Lirong Xia

Comparison Sorts. EECS 2011 Prof. J. Elder - 1 -

Title: Adverserial Search AIMA: Chapter 5 (Sections 5.1, 5.2 and 5.3)

Chapter 8: Recursion

Minimum Spanning Tree Union-Find Data Structure. Feb 28, 2018 CSCI211 - Sprenkle. Comcast wants to lay cable in a neighborhood. Neighborhood Layout

Midterm Review. EECS 2011 Prof. J. Elder - 1 -

Search Trees. Chapter 10. CSE 2011 Prof. J. Elder Last Updated: :51 PM

NEW YORK CITY COLLEGE OF TECHNOLOGY The City University of New York

Introduction to Game Theory. Lirong Xia

Politics is the subset of human behavior that involves the use of power or influence.

File Systems: Fundamentals

Subreddit Recommendations within Reddit Communities

Cyber-Physical Systems Scheduling

Title: Local Search Required reading: AIMA, Chapter 4 LWH: Chapters 6, 10, 13 and 14.

Processes. Criteria for Comparing Scheduling Algorithms

Citizen s response depends on expected response of the state. Exit Voice Game with Outcomes

Classifier Evaluation and Selection. Review and Overview of Methods

Deadlock. deadlock analysis - primitive processes, parallel composition, avoidance

CS 4407 Algorithms Greedy Algorithms and Minimum Spanning Trees

Event Based Sequential Program Development: Application to Constructing a Pointer Program

Randomized Pursuit-Evasion in Graphs

Combating Friend Spam Using Social Rejections

Computational challenges in analyzing and moderating online social discussions

De-identified Data & Limited Data Set. J. T. Ash University of Hawaii System HIPAA Compliance Officer

APPENDIX B. Environmental Justice Evaluation

Coalitional Game Theory

CS 5523: Operating Systems

STUDY GUIDE FOR TEST 2

Correlations PreK, Kindergarten, First Grade, and Second Grade

Maps, Hash Tables and Dictionaries

THE PREPARE CURRICULUM: FOR POST-SECONDARY AND CAREER READNISS

THE 2017 EU JUSTICE SCOREBOARD

Analyzing and Representing Two-Mode Network Data Week 8: Reading Notes

THE PREPARED CURRICULUM:

Case Study: Border Protection

Randomized Pursuit-Evasion in Graphs

Michael Laver and Ernest Sergenti: Party Competition. An Agent-Based Model

The Australian Society for Operations Research

New features in Oracle 11g for PL/SQL code tuning.

Optimization Strategies

Estimating the Margin of Victory for Instant-Runoff Voting

IDENTIFYING FAULT-PRONE MODULES IN SOFTWARE FOR DIAGNOSIS AND TREATMENT USING EEPORTERS CLASSIFICATION TREE

Computational Social Choice: Spring 2017

Wind power integration and consumer behavior: a complementarity approach

Interviewing. ScWk 242 Session 3 Slides

A Calculus for End-to-end Statistical Service Guarantees

DevOps Course Content

Real-Time Wireless Control Networks for Cyber-Physical Systems

Assessment Planning for Academic Degree Programs

Graph Structurings. 16. How to Structure Large Models - Obligatory Reading. Ø T. Fischer, Jörg Niere, L. Torunski, and Albert Zündorf, 'Story

CSE 190 Assignment 2. Phat Huynh A Nicholas Gibson A

Outline. Proposed Elementary School Reading, Pennsylvania AEI Competition OVERVIEW

Introduction to Artificial Intelligence CSCE , Fall 2017 URL:

8 th Grade GLE Division WMDS

CHAPTER 11 POWERS OF CONGRESS AND CHAPTER 12 CONGRESS IN ACTION Monster Packet

Irrigation Design Attributes for SDI Alfalfa Production. Patrick Fernandes AG District Sales Manager Southwest Netafim USA December 12, 2014

COMP : DATA STRUCTURES 2/27/14. Are binary trees satisfying two additional properties:

16. How to Structure Large Models and Programs with Graph Structurings

Hoboken Public Schools. Algebra II Honors Curriculum

Political Districting for Elections to the German Bundestag: An Optimization-Based Multi-Stage Heuristic Respecting Administrative Boundaries

SPARC Version New Features

Real- Time Wireless Control Networks for Cyber- Physical Systems

CS 5523 Operating Systems: Synchronization in Distributed Systems

Grade 04 Social Studies Unit 07 Exemplar Lesson 02: The Influence of the U.S. Constitution

INTERNATIONAL ECONOMICS, FINANCE AND TRADE Vol. II - Strategic Interaction, Trade Policy, and National Welfare - Bharati Basu

Public Opinion and Political Participation

Lecture 8: Verification and Validation

Power and Authority. Sources of Authority. Organizational Frameworks. Structure (rationale) Culture and Meaning (Symbolic) Politics (Conflict)

How to identify experts in the community?

Coalitional Game Theory for Communication Networks: A Tutorial

Chapter The President s Job Description

TT SERIES OD ORBITAL CUTTING & BEVELING MACHINES 1/8 TO 168 OD 1/9

SelectivePrep Selective Enrollment Exam Preparation Program (8 th Graders)

Maps and Hash Tables. EECS 2011 Prof. J. Elder - 1 -

Hat problem on a graph

Support Vector Machines

Game theoretical techniques have recently

FOR OFFICIAL USE ONLY epic.org EPIC DHS-FOIA Production

How hard is it to control sequential elections via the agenda?

Algorithms, Games, and Networks February 7, Lecture 8

Reduction of backlog: The experience of the Strasbourg Program and the census of Italian civil justice system

Explaining rational decision making by arguing

Public Hearing Better News about Housing and Financial Markets

Cluster Analysis. (see also: Segmentation)

INTRODUCTION TO READING & BRIEFING CASES AND OUTLINING

Virtual Memory and Address Translation

Understanding and Solving Societal Problems with Modeling and Simulation

Trocar Systems. Complete and efficient. Trocar systems

Doctoral Research Agenda

Vocabulary Activity 7

THANKFUL TREE THANKFUL TREE

AGENDAS AND SINCERITY: A SECOND RESPONSE TO SCHWARTZ

Lecture 18 Sociology 621 November 14, 2011 Class Struggle and Class Compromise

Transcription:

Uninformed search Lirong Xia Spring, 2017

Today s schedule ØRational agents ØSearch problems State space graph: modeling the problem Search trees: scratch paper for solution ØUninformed search Depth first search (DFS) algorithm Breadth first search (BFS) algorithm 2

Example 0: Roguelike game ØYou entered a maze in darkness ØNo map but you build one as you explore ØLimited sight, only know which direction does not have a wall know nothing about enemies, traps, etc. you only see the exit when you step on it ØGoal: write a walkthrough to minimize the cost of reaching the next level ØHow would you do it? 3

Rational Agents ØAn agent is an entity that perceives and acts. ØA rational agent selects actions that maximize its utility function. ØCharacteristics of the percepts, environment, and action space dictate techniques for selecting rational actions. Agent Actuators Sensors Actions Percepts Environment 4

Example 1: Pacman as an Agent Agent Sensors? Percepts Environment Actuators Actions 5

When goal = search for something (no cost yet) 6

Search Problems ØA search problem consists of: A state space... A successor function (N, 1). (with actions, costs).. (E, 1) A start state and a goal test ØA solution is a sequence of actions (a plan) which transforms the start state to a goal state 7

State space graph: modeling the problem ØA directed weighted graph of all states aàb: b is a successor of a weight(aàb): the cost of traveling from a to b. (E, 1) Goal (S, 1) Start (N, 1). (W, 1). (E, 1) Note: just for analysis, usually the state space graph is not fully built 8

What s in a State Space? The world state specifies every last detail of the environment A search state keeps only the details needed (abstraction) Problem: Pathing States: (x,y) location Actions: NSEW Successor: adjacent locations Goal test: is (x,y) = END Problem: Eat-All-Dots States: {(x,y), dot booleans} Actions: NSEW Successor: updated location and dot booleans Goal test: dots all false 9

State Space Sizes? Ø World state: Agent positions: 120 Food count: 30 Ghost positions: 12 Agent facing: NSEW Ø How many World states? 120 2 30 12 2 4 States for pathing? 120 States for eat-all-dots? 120 2 30 10

Search Trees: scratch paper for solution A search tree: Start state at the root node Children correspond to successors Nodes contain states, correspond to PLANS to those states For most problems, we can never actually build the whole tree 11

Space graph vs. search tree Nodes in state space graphs are problem states: Represent an abstracted state of the world Have successors, can be goal/non-goal, have multiple predecessors Nodes in search trees are plans Represent a plan (sequence of actions) which results in the node s state Have a problem state and one parent, a path length, a depth and a cost The same problem state may be achieved by multiple search tree nodes Problem States Search Nodes 12

Uninformed search ØUninformed search: given a state, we only know whether it is a goal state or not ØCannot say one non-goal state looks better than another non-goal state ØCan only traverse state space blindly in hope of somehow hitting a goal state at some point Also called blind search Blind does not imply unsystematic!

Breadth-first search (search tree)

Ø Never expand a node whose state has been visited Ø Fringe can be maintained as a First-In-First-Out (FIFO) queue (class Queue in util.py) Ø Maintain a set of visited states Ø fringe := {node corresponding to initial state} Ø loop: if fringe empty, declare failure BFS choose and remove the top node v from fringe check if v s state s is a goal state; if so, declare success if v s state has been visited before, skip if not, expand v, insert resulting nodes into fringe Ø This is the BFS you should implement in project 1 15

Properties of breadth-first search Ø May expand more nodes than necessary Ø BFS is complete: if a solution exists, one will be found Ø BFS finds a shallowest solution Not necessarily an optimal solution if the cost is non-uniform Ø If every node has b successors (the branching factor), shallowest solution is at depth d, then fringe size will be at least b d at some point This much space (and time) required L

Depth-first search

Properties of depth-first search Ø Not complete (might cycle through non-goal states) Ø If solution found, generally not optimal/shallowest Ø If every node has b successors (the branching factor), and we search to at most depth m, fringe is at most bm Much better space requirement J Saves even more space by recursion Ø Time: still need to check every node b m + b m-1 + + 1 (for b>1, O(b m )) Inevitable for uninformed search methods

If we keep a set of visited stages ØNever add a visited state to the fringe ØThis version of DFS is complete (avoid cycling) ØSpace requirement can be as bad as BFS 19

Ø Never expand a node whose state has been visited Ø Fringe can be maintained as a Last-In-First-Out (LIFO) queue (class Stack in util.py) Ø Maintain a set of visited states Ø fringe := {node corresponding to initial state} Ø loop: if fringe empty, declare failure DFS choose and remove the top node v from fringe check if v s state s is a goal state; if so, declare success if v s state has been visited before, skip if not, expand v, insert resulting nodes into fringe Ø This is the DFS you should implement in project 1 20

You can start to work on Project 1 now Ø Read the instructions on course website and the comments in search.py first Ø Q1: DFS LIFO Ø Q2: BFS FIFO Ø Due in two weeks (Feb 3) Ø Check util.py for LIFO and FIFO implementation Ø Use piazza for Q/A 21

Dodging the bullets Ø The auto-grader is very strict 0 point for expanding more-than-needed states no partial credit Ø Hint 1: do not include print "Start:", problem.getstartstate() in your formal submission comment out all debuging commands Ø Hint 2: remember to check if a state has been visited before Ø Hint 3: return a path from start to goal. You should pass the local test before submission (details and instructions on project 1 website) 22