Artificial Intelligence Heuristic 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

An Introduction to The A* Algorithm

Measuring the Performance of an Agent

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

Data Structures Fibonacci Heaps, Amortized Analysis

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

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

Problem solving and search

Section IV.1: Recursive Algorithms and Recursion Trees

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

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

Guessing Game: NP-Complete?

Near Optimal Solutions

Sequential Data Structures

Approximation Algorithms

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

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

Binary Heaps * * * * * * * / / \ / \ / \ / \ / \ * * * * * * * * * * * / / \ / \ / / \ / \ * * * * * * * * * *

Search methods motivation 1

Satisfiability Checking

Full and Complete Binary Trees

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

Binary Heaps. CSE 373 Data Structures

Binary Search Trees. Data in each node. Larger than the data in its left child Smaller than the data in its right child

Binary Search Trees CMPSC 122

Binary Heap Algorithms

A Note on Maximum Independent Sets in Rectangle Intersection Graphs

Positional Numbering System

Examination paper for MA0301 Elementær diskret matematikk

5. A full binary tree with n leaves contains [A] n nodes. [B] log n 2 nodes. [C] 2n 1 nodes. [D] n 2 nodes.

Sample Questions Csci 1112 A. Bellaachia

Artificial Intelligence Exam DT2001 / DT2006 Ordinarie tentamen

Ordered Lists and Binary Trees

Algorithms Chapter 12 Binary Search Trees

Algorithms and Data Structures

International Journal of Advanced Research in Computer Science and Software Engineering

ARTIFICIAL INTELLIGENCE (CSCU9YE) LECTURE 6: MACHINE LEARNING 2: UNSUPERVISED LEARNING (CLUSTERING)

An Effective Approach for Distributed Meeting Scheduler

Analysis of Algorithms I: Binary Search Trees

The Union-Find Problem Kruskal s algorithm for finding an MST presented us with a problem in data-structure design. As we looked at each edge,

Sorting revisited. Build the binary search tree: O(n^2) Traverse the binary tree: O(n) Total: O(n^2) + O(n) = O(n^2)

(Refer Slide Time: 2:03)

Moving Target Search. 204 Automated Reasoning

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

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

No Solution Equations Let s look at the following equation: 2 +3=2 +7

CSC148 Lecture 8. Algorithm Analysis Binary Search Sorting

Regression Verification: Status Report

Lecture Notes on Binary Search Trees

Questions 1 through 25 are worth 2 points each. Choose one best answer for each.

Efficient Data Structures for Decision Diagrams

Complexity Theory. IE 661: Scheduling Theory Fall 2003 Satyaki Ghosh Dastidar

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

In mathematics, it is often important to get a handle on the error term of an approximation. For instance, people will write

Class Overview. CSE 326: Data Structures. Goals. Goals. Data Structures. Goals. Introduction

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

Static Program Transformations for Efficient Software Model Checking

Scheduling Shop Scheduling. Tim Nieberg

1 Sufficient statistics

Fundamental Algorithms

Vieta s Formulas and the Identity Theorem

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

Quantum and Non-deterministic computers facing NP-completeness

Analysis of Algorithms, I

Applied Algorithm Design Lecture 5

CMPSCI611: Approximating MAX-CUT Lecture 20

Many algorithms, particularly divide and conquer algorithms, have time complexities which are naturally

Games Manipulators Play

Web Data Extraction: 1 o Semestre 2007/2008

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

6 March Array Implementation of Binary Trees

Data Structures and Algorithms

Generating models of a matched formula with a polynomial delay

Chapter 3. if 2 a i then location: = i. Page 40

Notes from Week 1: Algorithms for sequential prediction

A binary search tree is a binary tree with a special property called the BST-property, which is given as follows:

3 Some Integer Functions

Network (Tree) Topology Inference Based on Prüfer Sequence

CoNP and Function Problems

Outline BST Operations Worst case Average case Balancing AVL Red-black B-trees. Binary Search Trees. Lecturer: Georgy Gimel farb

5.1 Bipartite Matching

Cpt S 223. School of EECS, WSU

Converting a Number from Decimal to Binary

Incremental Routing Algorithms For Dynamic Transportation Networks

Dynamic Programming. Lecture Overview Introduction

The Basics of Graphical Models

16. Recursion. COMP 110 Prasun Dewan 1. Developing a Recursive Solution

Mathematical Induction

SEARCHING AND KNOWLEDGE REPRESENTATION. Angel Garrido

Embedded Systems 20 REVIEW. Multiprocessor Scheduling

Euclidean Minimum Spanning Trees Based on Well Separated Pair Decompositions Chaojun Li. Advised by: Dave Mount. May 22, 2014

BIG DATA PROBLEMS AND LARGE-SCALE OPTIMIZATION: A DISTRIBUTED ALGORITHM FOR MATRIX FACTORIZATION

Partial Fractions. Combining fractions over a common denominator is a familiar operation from algebra:

Optimizations. Optimization Safety. Optimization Safety. Control Flow Graphs. Code transformations to improve program

INTERNATIONAL JOURNAL OF COMPUTER ENGINEERING & TECHNOLOGY (IJCET)

Mathematical Induction. Lecture 10-11

INTERNATIONAL JOURNAL OF PURE AND APPLIED RESEARCH IN ENGINEERING AND TECHNOLOGY

LABEL PROPAGATION ON GRAPHS. SEMI-SUPERVISED LEARNING. ----Changsheng Liu

Transcription:

Artificial Intelligence Heuristic Search Andrea Torsello

Search in AI Blind search strategies Breadth First Depth First Iterative Deepening Analyzed Completeness Optimality Time Complexity Space Complexity Optimality evaluated only in terms of number of steps

Uniform Cost Search Uniform Cost is a blind search algorithm that is optimal according to any specified path length function Can be obtained from the generic search stab function by selecting from L the node with the minimal path length from the root Can be implemented with a heap or any efficient priority queue implementation Let L be a list of visited but not expanded nodes 1) Initialize L with the initial state 2)If L is empty, FAIL, else extract from L node n with minimum path length from the root 3)If n is a goal node, SUCCEED and return the path from the initial state to n 4)Remove n from L and insert all the children of n 5)Goto 2)

Time/Space complexity Uniform cost is guided by path length rather than depth, so its time complexity cannot easily be characterized in terms of b and d Rather, let C* be the path length of the optimal solution and ε the minimum cost of any action. Then the worst-case time and space complexity is Which can be much greater than b d Uniform cost can explore large trees of small steps before exploring paths with large and potentially useful steps. When all steps costs are equal, uniform cost is similar to breadth first.

Heuristics The assumption behind blind search is that we have no way of telling whether a particular search direction is likely to lead us to the goal or not The key idea behind informed or heuristic search algorithms is to exploit a taskspecific measure of goodness to try to either reach the goal more quickly or find a more desirable goal state. Heuristic: From the Greek for find, discover. Heuristics are criteria, methods, or principles for deciding which among several alternative courses of action promises to be the most effective in order to achieve some goal. Judea Pearl Heuristics 1984 Problem knowledge comes in the form of an heuristic function h'(n) h'(n) assigns to each node n an estimate of the optimal path length from n to a goal node We assume that h' is non-negative and that h'(n)=0 iff n is a goal node.

h' 1 (n) = number of misplaced tiles Heuristics for the game of 8 h' 2 (n) = sum of Manhattan distance* of each tile Example: h' 1 (n) = 7 h' 2 (n) = 4+0+2+3+1+3+1+3=17 * Given two planar points of coordinate P 1 =(x 1,y 1 ) and P 2 =(x 2,y 2 ), the Manhattan distance is defined as

Travel Planning h'(n) = straight-line distance between n and goal node

Best First (Greedy) Search The idea behind best first search is to always explore the most promising path first. Can be obtained from the generic search stab function by selecting from L the node with the minimal value of the expected distance to goal (value of heuristic function) Let L be a list of visited but not expanded nodes 1) Initialize L with the initial state 2)If L is empty, FAIL, else extract from L node n with minimum value of h'(n) 3)If n is a goal node, SUCCEED and return the path from the initial state to n 4)Remove n from L and insert all the children of n 5)Goto 2)

Best First Search Example

Best First Search Example

Best First Search Example

Best First Search Example

Analysis of Best First Complete? No can get stuck in loops, e.g., Iasi -> Neamt -> Iasi -> Neamt Time? Space? Optimal? O(bm), but a good heuristic can give dramatic improvement O(bm) -- keeps all nodes in memory No Example of non optimality The number in parentheses represent the order of expansion The other the value of the heuristic function h'

A* A* algorithm mixes the optimality of uniform cost with the heuristic search of best first A* realizes a best first search with evaluation function with g(n) is the path length from the root to n h'(n) is the heuristic prediction of the cost from n to the goal Let L be a list of visited but not expanded nodes 1) Initialize L with the initial state 2)If L is empty, FAIL, else extract from L node n with minimum value of f(n)=g(n)+h'(n) 3)If n is a goal node, SUCCEED and return the path from the initial state to n 4)Remove n from L and insert all the children of n 5)Goto 2)

A* search example

A* search example

A* search example

A* search example

A* search example

A* search example

Consistent heuristics A heuristic is consistent if for every node n, every successor n' of n generated by any action a, with cost c(n,a,n') If h' is consistent, we have i.e., f(n) is non-decreasing along any path Corollary: h'(n) h(n), where h(n) is the real (unknown) distance from the goal

Optimality of A* Theorem: If function h' is consistent, then A* is optimal Proof: Let s be an optimal goal node and x a non-optimal goal. Let n 0 n 1... n k =s be the path from the root to s. For all i=0...k, we have f(n i )<f(x). In fact: But then s must be expanded before x.

Optimality of A* A* expands nodes in order of increasing f value Gradually adds "f-contours" of nodes Contour i has all nodes with f=fi, where fi < fi+1

Properties of A* Complete? Time? Space? Optimal? Yes (unless there are infinitely many nodes with f f(g)) Exponential Exponential (Keeps all nodes in memory) Yes A* is an Heuristic counterpart of breadth first. We can improve the space requirements in a way similar to iterative deepening

Iterative Deepening A* (IDA*) Let L be the list of visited but not expanded node, and C the maximum depth 1)Let C=0 2) Initialize L to the initial state (only) 3)If L is empty increase C and goto 2), else extract a node n from the front of L 4)If n is a goal node, SUCCEED and return the path from the initial state to n 5)Remove n from L. If the level is smaller than C, insert at the front of L all the children n' of n with f(n') C 6)Goto 3)

IDA* Example