Problem-Solving as Search

Similar documents
Measuring the Performance of an Agent

AI: A Modern Approach, Chpts. 3-4 Russell and Norvig

Problem solving and search

CS MidTerm Exam 4/1/2004 Name: KEY. Page Max Score Total 139

Informed search algorithms. Chapter 4, Sections 1 2 1

Agents: Rationality (2)

Chapter 2: Intelligent Agents

Introduction to Artificial Intelligence. Intelligent Agents

SOLVING PROBLEMS BY SEARCHING

CPSC 211 Data Structures & Implementations (c) Texas A&M University [ 313]

Decision Trees from large Databases: SLIQ

Search methods motivation 1

Game playing. Chapter 6. Chapter 6 1

Data Mining on Streams

Home Page. Data Structures. Title Page. Page 1 of 24. Go Back. Full Screen. Close. Quit

Single machine models: Maximum Lateness -12- Approximation ratio for EDD for problem 1 r j,d j < 0 L max. structure of a schedule Q...

An Introduction to The A* Algorithm

Course Outline Department of Computing Science Faculty of Science. COMP Applied Artificial Intelligence (3,1,0) Fall 2015

ECE 250 Data Structures and Algorithms MIDTERM EXAMINATION /5:15-6:45 REC-200, EVI-350, RCH-106, HH-139

A binary heap is a complete binary tree, where each node has a higher priority than its children. This is called heap-order property

Smart Graphics: Methoden 3 Suche, Constraints

SYSM 6304: Risk and Decision Analysis Lecture 5: Methods of Risk Analysis

Why? A central concept in Computer Science. Algorithms are ubiquitous.

Algorithms and Data S tructures Structures Stack, Queues, and Applications Applications Ulf Leser

Chapter 2 Intelligent Agents

PLANET: Massively Parallel Learning of Tree Ensembles with MapReduce. Authors: B. Panda, J. S. Herbach, S. Basu, R. J. Bayardo.

Exam study sheet for CS2711. List of topics

Krishna Institute of Engineering & Technology, Ghaziabad Department of Computer Application MCA-213 : DATA STRUCTURES USING C

Load Balancing. Load Balancing 1 / 24

BMW11: Dealing with the Massive Data Generated by Many-Core Systems. Dr Don Grice IBM Corporation

Binary Heaps. CSE 373 Data Structures

Chapter 6. Decoding. Statistical Machine Translation

Y. Xiang, Constraint Satisfaction Problems

Analysis of Micromouse Maze Solving Algorithms

Complete Solution of the Eight-Puzzle and the Benefit of Node Ordering in IDA*

Mining Social Network Graphs

Guessing Game: NP-Complete?

Big Data and Scripting. Part 4: Memory Hierarchies

Chess Algorithms Theory and Practice. Rune Djurhuus Chess Grandmaster / October 3, 2012

Data Mining Practical Machine Learning Tools and Techniques

INTERNATIONAL JOURNAL OF COMPUTER ENGINEERING & TECHNOLOGY (IJCET)

Binary Search Trees. A Generic Tree. Binary Trees. Nodes in a binary search tree ( B-S-T) are of the form. P parent. Key. Satellite data L R

Gerry Hobbs, Department of Statistics, West Virginia University

Previous Lectures. B-Trees. External storage. Two types of memory. B-trees. Main principles

A Review of Intelligent Agents

CSE 4351/5351 Notes 7: Task Scheduling & Load Balancing

B-Trees. Algorithms and data structures for external memory as opposed to the main memory B-Trees. B -trees

International Journal of Software and Web Sciences (IJSWS)

CSE 326: Data Structures B-Trees and B+ Trees

S. Muthusundari. Research Scholar, Dept of CSE, Sathyabama University Chennai, India Dr. R. M.

Sample Questions Csci 1112 A. Bellaachia

Intelligent Flexible Automation

Analysis of Algorithms I: Binary Search Trees

Artificial Intelligence

M. Sugumaran / (IJCSIT) International Journal of Computer Science and Information Technologies, Vol. 2 (3), 2011,

Computer Game Programming Intelligence I: Basic Decision-Making Mechanisms

Sources: On the Web: Slides will be available on:

Social Media Mining. Graph Essentials

Teaching Introductory Artificial Intelligence with Pac-Man

(Refer Slide Time: 2:03)

Using Adaptive Random Trees (ART) for optimal scorecard segmentation

Branch-and-Price Approach to the Vehicle Routing Problem with Time Windows

Introduction to Learning & Decision Trees

Mathematics for Algorithm and System Analysis

Artificial Intelligence Exam DT2001 / DT2006 Ordinarie tentamen

Artificial Intelligence BEG471CO

Reliability Guarantees in Automata Based Scheduling for Embedded Control Software

CS104: Data Structures and Object-Oriented Design (Fall 2013) October 24, 2013: Priority Queues Scribes: CS 104 Teaching Team

Intelligent Agents for Routing on Mobile Ad-Hoc Networks

MAX = 5 Current = 0 'This will declare an array with 5 elements. Inserting a Value onto the Stack (Push)

cs171 HW 1 - Solutions

Data quality in Accounting Information Systems

DEVELOPMENT OF A VULNERABILITY ASSESSMENT CODE FOR A PHYSICAL PROTECTION SYSTEM: SYSTEMATIC ANALYSIS OF PHYSICAL PROTECTION EFFECTIVENESS (SAPE)

SIMS 255 Foundations of Software Design. Complexity and NP-completeness

Algorithms and Data Structures

R-trees. R-Trees: A Dynamic Index Structure For Spatial Searching. R-Tree. Invariants

Handling Fault Detection Latencies in Automata-based Scheduling for Embedded Control Software

Classifying Large Data Sets Using SVMs with Hierarchical Clusters. Presented by :Limou Wang

Expanding the CASEsim Framework to Facilitate Load Balancing of Social Network Simulations

50 Computer Science MI-SG-FLD050-02

Clustering Artificial Intelligence Henry Lin. Organizing data into clusters such that there is

Classification and Prediction

Week_11: Network Models

Texas Essential Knowledge and Skills Correlation to Video Game Design Foundations 2011 N Video Game Design

! Solve problem to optimality. ! Solve problem in poly-time. ! Solve arbitrary instances of the problem. #-approximation algorithm.

1) The postfix expression for the infix expression A+B*(C+D)/F+D*E is ABCD+*F/DE*++

The following themes form the major topics of this chapter: The terms and concepts related to trees (Section 5.2).

Chess Algorithms Theory and Practice. Rune Djurhuus Chess Grandmaster / September 23, 2014

PPD: Scheduling and Load Balancing 2

Classification/Decision Trees (II)

3 Abstract Data Types and Search

Blind Security Testing

THE SECURITY AND PRIVACY ISSUES OF RFID SYSTEM

Union-Find Algorithms. network connectivity quick find quick union improvements applications

6.852: Distributed Algorithms Fall, Class 2

6 March Array Implementation of Binary Trees

Symbol Tables. Introduction

Chapter 5 Supporting Facility and Process Flows

CSE 326, Data Structures. Sample Final Exam. Problem Max Points Score 1 14 (2x7) 2 18 (3x6) Total 92.

Transcription:

Problem-Solving as Search

Intelligent Agents Agent: Anything that can be viewed as perceiving its environment through sensors and acting upon that environment through actuators. Agent Function: Agent behavior is determined by the agent function that maps any given percept sequence to an action. Agent Program: The agent function for an artificial agent will be implemented by an agent program.

A Simple Reflex Agent Agent Sensors What the world is like now Environment Condition-action rules What action I should do now Actuators

Agent with Model and Internal State Agent Sensors How the world evolves What the world is like now Environment Condition-action rules What action I should do now Actuators

Goal-Based Agent Agent Sensors How the world evolves What the world is like now What it will be like if I do action A Environment Goals What action I should do now Actuators

Schedule Search Machine learning Knowledge based systems Discovery

Problem Solving as Search Search is a central topic in AI Originated with Newell and Simon's work on problem solving. Famous book: Human Problem Solving (1972) Automated reasoning is a natural search task More recently: Smarter algorithms Given that almost all AI formalisms (planning, learning, etc.) are NP-complete or worse, some form of search is generally unavoidable (no smarter algorithm available).

Defining a Search Problem State space - described by initial state - starting state actions - possible actions available successor function; operators - given a particular state x, returns a set of < action, successor > pairs Goal test - determines whether a given state is a goal state (sometimes list, sometimes condition). Path cost - function that assigns a cost to a path

The 8 Puzzle 5 4 1 2 3 6 1 8 8 4 7 3 2 Initial State 7 6 5 Goal State

Clicker What is the size of the state space? A. 4 B. 3x3 C. 9! D. 9 9 E. Whatever

Clicker How many actions possible for each state (on average)? A. ~1 B. ~4 C. ~9 D. ~9!

Cryptarithmetic SEND + MORE ------ MONEY Find (non-duplicate) substitution of digits for letters such that the resulting sum is arithmetically correct. Each letter must stand for a different digit.

Solving a Search Problem: State Space Search Input: Initial state Goal test Successor function Path cost function Output: Path from initial state to goal state. Solution quality is measured by the path cost.

Generic Search Algorithm L = make-list(initial-state) loop node = remove-front(l) (node contains path of how the algorithm got there) if goal-test(node) == true then return(path to node) S = successors (node) insert (S,L) until L is empty return failure

Search procedure defines a search tree Search tree root node - initial state children of a node - successor states fringe of tree - L: states not yet expanded Search strategy - algorithm for deciding which leaf node to expand next. stack: Depth-First Search (DFS). queue: Breadth-First Search (BFS).

Solving the 8-Puzzle 5 4 1 2 3 6 1 8 8 4 7 3 2 Start State 7 6 5 Goal State What would the search tree look like after the start state was expanded?

Node Data Structure 5 4 PARENT-NODE 6 1 8 STATE NODE ACTION= right DEPTH=6 PATH-COST=6 7 3 2 CHILD-NODE CHILD-NODE

Sliding Block Puzzles 8-puzzle (on 3x3 grid) has 181,440 states Easily solvable from any random position 15-puzzle (on 4x4 grid) has ~1.3 Trillion states Solvable in a few milliseconds 24-puzzle (on 5x5 grid) has ~10 25 states Difficult to solve

Evaluating a Search Strategy Completeness: Is the strategy guaranteed to find a solution when there is one? Time Complexity: How long does it take to find a solution? Space Complexity: How much memory does it need? Optimality: Does strategy always find a lowest-cost path to solution? (this may include different cost of one solution vs. another).

Uninformed search: BFS Consider paths of length 1, then of length 2, then of length 3, then of length 4,...

Time and Memory Requirements for BFS O(b d+1 ) Let b = branching factor, d = solution depth, then the maximum number of nodes generated is: b + b 2 +... + b d + (b d+1 -b)

Time and Memory Requirements for BFS O(b d+1 ) Example: b = 10 10,000 nodes/second each node requires 1000 bytes of storage Depth Nodes Time Memory 2 1100.11 sec 1 meg 4 111,100 11 sec 106 meg 6 10 7 19 min 10 gig 8 10 9 31 hrs 1 tera 10 10 11 129 days 101 tera 12 10 13 35 yrs 10 peta 14 10 15 3523 yrs 1 exa

Uniform-cost Search Use BFS, but always expand the lowest-cost node on the fringe as measured by path cost g(n). s 0 s A B C s A 1 5 15 1 10 A B 5 B s 5 5 G G 11 15 5 C Requirement: g(successor(n)) g(n) C 15 A G s B G 11 10 C 15 Always expand lowest cost node in open-list. Goal-test only before expansion, not after generation.

Uninformed search: DFS

DFS vs. BFS Complete Optimal Time Space BFS YES YES O(b d+1 ) O(b d+1 ) DFS Finite depth NO O(b m ) O(bm) m is maximum search depth d is solution depth b is branching factor Time Space m = d: DFS typically wins m > d: BFS might win m is infinite: BFS probably will do better DFS almost always beats BFS

Which search should I use... If there may be infinite paths? B=BFS D=DFS

Which search should I use... If goal is at a known depth? B=BFS D=DFS

Which search should I use... If there is a large (possibly infinite) branching factor? B=BFS D=DFS

Which search should I use... If there are lots of solutions? B=BFS D=DFS

Backtracking Search Idea: DFS, but don t expand all b states before next level Generate the next state as needed (e.g. from previous state) Uses only O(m) storage Important when space required to store each state is very large (e.g. assembly planning)

Iterative Deepening [Korf 1985] Idea: Use an artificial depth cutoff, c. If search to depth c succeeds, we're done. If not, increase c by 1 and start over. Each iteration searches using depth-limited DFS.

Limit=0 Iterative Deepening Limit=1 Limit=2 Limit=3

Cost of Iterative Deepening space: O(bd) as in DFS, time: O(b d ) b ratio of IDS to DFS 2 3 3 2 5 1.5 10 1.2 25 1.08 100 1.02

Bidirectional Search

Criterion Comparing Search Strategies Breadth -First Uniform- Cost 1 C* b Depth- First Iterative Deepening Time b d+1 b m b d b d/2 1 C* b Space b d+1 bm bd b d/2 Optimal? Yes yes no yes yes Complete? Yes Yes No Yes Yes Bidirectional (if applicable) ***Note that many of the ``yes's'' above have caveats, which we discussed when covering each of the algorithms.