AI Principles, Semester 2, Week 1, Lecture 3, Search

Similar documents
Informed search algorithms. Chapter 4, Sections 1 2 1

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

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

Measuring the Performance of an Agent

Problem solving and search

SOLVING PROBLEMS BY SEARCHING

IAI : Expert Systems

(Refer Slide Time: 2:03)

IE 680 Special Topics in Production Systems: Networks, Routing and Logistics*

INTERNATIONAL JOURNAL OF COMPUTER ENGINEERING & TECHNOLOGY (IJCET)

Cost Model: Work, Span and Parallelism. 1 The RAM model for sequential computation:

An Introduction to The A* Algorithm

Mathematical goals. Starting points. Materials required. Time needed

Smart Graphics: Methoden 3 Suche, Constraints

1 Representation of Games. Kerschbamer: Commitment and Information in Games

Search methods motivation 1

8. KNOWLEDGE BASED SYSTEMS IN MANUFACTURING SIMULATION

Cpt S 223. School of EECS, WSU

Approximation Algorithms

A Note on Maximum Independent Sets in Rectangle Intersection Graphs

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

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

CMPSCI611: Approximating MAX-CUT Lecture 20

Analysis of Micromouse Maze Solving Algorithms

The Basics of Graphical Models

Croatian Open Competition in Informatics, contest 3 December 16, 2006

Binary Search Trees CMPSC 122

Problem Set 7 Solutions

Chinese postman problem

Decision Making under Uncertainty

INTRODUCTION TO MATHEMATICAL MODELLING

Y. Xiang, Constraint Satisfaction Problems

Dave Sly, PhD, MBA, PE Iowa State University

(Refer Slide Time: 00:01:16 min)

A Non-Linear Schema Theorem for Genetic Algorithms

Information Theory and Coding Prof. S. N. Merchant Department of Electrical Engineering Indian Institute of Technology, Bombay

Analysis of Algorithms, I

Vector storage and access; algorithms in GIS. This is lecture 6

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

Lecture 2 Introduction to Data Flow Analysis

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

6.099, Spring Semester, 2006 Assignment for Week 13 1

Off-line Model Simplification for Interactive Rigid Body Dynamics Simulations Satyandra K. Gupta University of Maryland, College Park

Game playing. Chapter 6. Chapter 6 1

vii TABLE OF CONTENTS CHAPTER TITLE PAGE DECLARATION DEDICATION ACKNOWLEDGEMENT ABSTRACT ABSTRAK

Sampling and Sampling Distributions

Outline. NP-completeness. When is a problem easy? When is a problem hard? Today. Euler Circuits

3 Essential Elements to Improving the Customer Experience. Uncovering Hidden Network Issues with Best Practice Testing Services

6.02 Practice Problems: Routing

Pathfinding in Computer Games

Personal Development Planning and eportfolio. Student Guide

Decision Trees and Networks

Self Organizing Maps: Fundamentals

SEARCHING AND KNOWLEDGE REPRESENTATION. Angel Garrido

2. (a) Explain the strassen s matrix multiplication. (b) Write deletion algorithm, of Binary search tree. [8+8]

ALGEBRA. sequence, term, nth term, consecutive, rule, relationship, generate, predict, continue increase, decrease finite, infinite

Operations and Supply Chain Management Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras

Answer Key for California State Standards: Algebra I

Introduction. Real World Planning. Planning with Time. Time 15/11/2012. COMP219: Artificial Intelligence. COMP219: Artificial Intelligence

Chapter 15: Dynamic Programming

Formal Languages and Automata Theory - Regular Expressions and Finite Automata -

CS 2302 Data Structures Spring 2015

Heaps & Priority Queues in the C++ STL 2-3 Trees

To introduce software process models To describe three generic process models and when they may be used

COMP 250 Fall 2012 lecture 2 binary representations Sept. 11, 2012

6.852: Distributed Algorithms Fall, Class 2

Introduction to Logic in Computer Science: Autumn 2006

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

WAN Wide Area Networks. Packet Switch Operation. Packet Switches. COMP476 Networked Computer Systems. WANs are made of store and forward switches.

Week_11: Network Models

Introduction to Artificial Intelligence

West Virginia University College of Engineering and Mineral Resources. Computer Engineering 313 Spring 2010

Reliability Guarantees in Automata Based Scheduling for Embedded Control Software

Lecture 2 CS An example of a middleware service: DNS Domain Name System

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

Chapter 11. MRP and JIT

VISUALIZING HIERARCHICAL DATA. Graham Wills SPSS Inc.,

A Fast Algorithm For Finding Hamilton Cycles

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

Fast Sequential Summation Algorithms Using Augmented Data Structures

Linear Programming. April 12, 2005

/ Department of Mechanical Engineering. Manufacturing Networks. Warehouse storage: cases or layers? J.J.P. van Heur. Where innovation starts

Lecture 10: Regression Trees

Class Notes CS Creating and Using a Huffman Code. Ref: Weiss, page 433

Recursive Algorithms. Recursion. Motivating Example Factorial Recall the factorial function. { 1 if n = 1 n! = n (n 1)! if n > 1

Lecture 2.1 : The Distributed Bellman-Ford Algorithm. Lecture 2.2 : The Destination Sequenced Distance Vector (DSDV) protocol

Introduction Solvability Rules Computer Solution Implementation. Connect Four. March 9, Connect Four

Teaching Introductory Artificial Intelligence with Pac-Man

Regular Expressions with Nested Levels of Back Referencing Form a Hierarchy

Chapter 6: Graph Theory

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

Unit 1 Number Sense. In this unit, students will study repeating decimals, percents, fractions, decimals, and proportions.

Data Structures and Algorithms Written Examination

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

Lexical Analysis and Scanning. Honors Compilers Feb 5 th 2001 Robert Dewar

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

FACTORS, PRIME NUMBERS, H.C.F. AND L.C.M.

ECON 459 Game Theory. Lecture Notes Auctions. Luca Anderlini Spring 2015

From Last Time: Remove (Delete) Operation

Transcription:

AI Principles, Semester 2, Week 1, Lecture 3, Search Examples of problems which are solved by search Setting the scene: your Romanian holiday search problem How to be systematic in your search Uninformed Search Comparing Uninformed Search Algorithms Informed Search Assumptions made about the environment Goal and Problem formulation (Material taken from Russel and Norvig chapters 3 and 4, Callan chapter 2 and John Bullinaria's slides from last year) 1

Examples of problems which are solved by search Route planning routing in computer networks, military operations planning, airline travel planning Touring problems Travelling salesman problem VLSI layout Robot Navigation Automatic assembly sequencing Internet searching (Russel & Norvig 67-68) 2

Setting the scene: your Romanian holiday search problem You are on holiday in Romania in a town called Arad It is 1am in the morning and you have a car, but no map, no-one to ask advice, and you have just realised that your flight leaves from Bucharest Airport in the afternoon. Luckily you have a satellite navigation gadget. Unluckily it is partly broken, and will only give you limited information. If you enter the name of any Romanian town it will give you only the details of the nearest neighbouring towns to the location you entered. You cannot get the gadget to give you details of the whole Arad to Bucharest route in one go. 3

Another way of viewing the Romanian holiday search problem This problem is similar to how a software component within a satellite navigation gadget or route planning internet application might build up longer travel routes (see http://www.theaa.com/travelwatch/planner_main.jsp for an example) A route planner is given a starting point and an end point and works from one to the other. 4

First results from the sat-nav The sat-nav gives you the names of the three towns that are immediately neighbouring Arad. Arad Sibiu Timisoara Zerind What kind of data structure are we starting to form? What kind of data structure might the sat-nav be accessing? 5

State spaces and search trees All the major towns in Romania form our state space. The towns that we have expanded from Arad form our search tree Arad Sibiu Timisoara Zerind The root of this search tree is the search node initial state. It gives us three potential search paths to follow. 6

State spaces In general, the state space is simply the space of all possible states, or configurations, that our system may be in. We prefer to work with some convenient representation of that state space. There are two components to the representation of state space: 1. Static states, such as the Romanian town you are currently in. 2. Transitions between states, such as moving from a town to a neighbouring town that is connected by a road. If states spaces are not too large they can be represented as graphs, which possess nodes and the transitions between them. Our aim is to search for a route from initial state to goal state. 7

You expand your search tree by entering Sibiu in the sat-nav You get four new nodes in your search tree Arad Sibiu Timisoara Zerind Arad Fagaras Oradea Rimnicu Vilcea Why does Arad appear twice in the search tree? It is important to distinguish between state space and search tree: 20 states in state space infinite number of paths therefore infinite number of nodes in the search tree If you were to automate this search, how would you deal with this? 8

What are your options for continuing this search systematically You get four new nodes in your search tree Arad Sibiu Timisoara Zerind Arad Fagaras Oradea Rimnicu Vilcea? If you expand Fagaras, or one of the other children of Sibiu, then you might continue and undertake a depth first search by following a single path until it reaches the goal state or terminate 9

What are your options for continuing this search systematically You get four new nodes in your search tree Arad Sibiu Timisoara Zerind Arad Fagaras Oradea Rimnicu Vilcea? If you expand Timisoara, and then all the other children of Arad, then you might continue and undertake a breadth first search 10

Will you stop searching when you find the first time route to Bucharest? You might continue searching until you uncover the entire map (graph) of major towns in Romania. Why might you want to know all possible routes to Bucharest? If the state space you were searching was finite (in this case it is 20 towns) and you attempted a complete search, would it make any difference if you undertook depth or breadth first search? If you didn't have time for a complete search (perhaps the sat-nav was very slow) AND the time for your actual journey really mattered, how might you change your search strategy? 11

Measuring problem solving performance Completeness: Is the algorithm guaranteed to find a solution when there is one? Optimality: Does the strategy find the optimal solution? (that is the lowest path cost) Time complexity: how long does it take to find a solution? Space complexity: how much memory is needed to perform the search? 12

You choose to search with depth first search. Will you stop searching if your path is too long? In this problem there are only twenty towns in the state space (including Arad and Bucharest). How long a search path should you construct before you conclude that the search path is not going to be optimal? Depth limited search allows you to set a limit to the depth of the search tree that you will descend before back-tracking. 13

You want to combine benefits from depth and breadth first search Depth first search possesses the benefit of lower space complexity. Breadth first search is guaranteed to find an optimal path. Can these two strategies be combined? 14

You want to combine benefits from depth and breadth first search Depth first search possesses the benefit of lower space complexity. Breadth first search is guaranteed to find an optimal path. Can these two strategies be combined? YES Iterative Deepening Search Can you guess what this does? What benefits does it give? 15

Iterative Deepening Search Iterative deepening search involves trying all possible depths in turn and stopping once a goal state is reached. The benefits are that it is complete and optimal like Breadth First Search, but has the modest memory requirements of depth first search. What is the obvious drawback of Iterative Deepening Search? Under what conditions is this drawback not too serious? 16

Bidirectional Search Bi-directional search involves both simultaneously searching forward from the initial state and back from the goal state 17

A graph of the whole state space: comparing Uninformed search strategies 18

Comparing Uninformed Search Strategies Complete Optimal Time complexity Space complexity Breadth first search: yes yes O(b d ) O(b d ) Depth first search no no O(b m ) O(bm) Depth limited search if l >= d no O(b l ) O(bl) depth first iterative yes yes O(b d ) O(bd) deepening search bi-directional search yes yes O(b d/2 ) O(b d/2 ) b is branching factor, d is depth of the shallowest solution, m is the maximum depth of the search tree, l is the depth limit 19

How might we inform our Search Strategy If the faulty sat-nav gave the coordinates of every town then we could use this information to gain 'as-the-crow-flies' direct (straight line) distances between locations. How might this information be used when deciding which node to expand in our search tree? 20

A graph of the whole state space Consider if we are at Sibiu, which node will we expand using greedy best first search? Is this the best node to expand? What extra information might help us make a better decision? 21

A* Search When expanding a node n in the search tree, greedy best first search used the estimated cost to get from the current state to the goal state, which we can define as h(n). In our problem h(n) is the straightline distance We also possess the sum of the cost to reach that node from the start state, which we can define as g(n). In our problem this is the sum of the step costs for the search path. For each node in the search tree, an evaluation function f(n) can be defined as the sum of these functions. f(n) = g(n) + h(n) A* search repeatedly picks the node with the lowest f(n) to expand next. It turns out that if h(n) never over-estimates the cost to reach the goal A* is complete and optimal. Will h(n) in the route finding problem overestimate the cost to reach the goal? 22

Assumptions made about the environment Static (unchanging) Observable (can sense its initial and current state) Discrete (world carved up into towns) Deterministic (no unexpected events) (Russel & Norvig 61) 23

The difference between being a software component in a sat-nav and a real live tourist in Romania Well-defined problems and solutions Goal formulation tourists have many more goals than a sat-nav Problem formulation the tourist may have one single goal that out-weights all the others goals. At an abstract level the two problems are the same. (Russel & Norvig 62-64) 24

Summary How to be systematic in your search Uninformed Search Comparing the Uninformed Search Algorithms Informed Search Assumptions made about the environment Goal and Problem formulation (Reading: Callan chapter 2 and Russell and Norvig pages 94-101 (which goes over the Romanian route finding problem for greedy best first search and A* search in more detail than these lectures)) 25