Artificial Intelligence Informed search. Peter Antal

Similar documents
Artificial Intelligence Informed search. Peter Antal Tadeusz Dobrowiecki

Artificial Intelligence Informed search. Peter Antal

Informed/Heuristic Search

Chapter 3: Informed Search and Exploration. Dr. Daisy Tang

Lecture 4: Informed/Heuristic Search

Informed search algorithms. Chapter 4

Informed Search and Exploration for Agents

A.I.: Informed Search Algorithms. Chapter III: Part Deux

Informed search. Soleymani. CE417: Introduction to Artificial Intelligence Sharif University of Technology Spring 2016

Outline. Best-first search

Informed Search. Best-first search. Greedy best-first search. Intelligent Systems and HCI D7023E. Romania with step costs in km

Outline. Best-first search

Informed search algorithms

CS 771 Artificial Intelligence. Informed Search

Artificial Intelligence

CSE 473. Chapter 4 Informed Search. CSE AI Faculty. Last Time. Blind Search BFS UC-BFS DFS DLS Iterative Deepening Bidirectional Search

EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS

CS 380: Artificial Intelligence Lecture #4

Informed search algorithms. (Based on slides by Oren Etzioni, Stuart Russell)

Artificial Intelligence

Informed search algorithms

Informed search algorithms

Informed search algorithms

Informed Search. Notes about the assignment. Outline. Tree search: Reminder. Heuristics. Best-first search. Russell and Norvig chap.

COMP9414/ 9814/ 3411: Artificial Intelligence. 5. Informed Search. Russell & Norvig, Chapter 3. UNSW c Alan Blair,

Outline for today s lecture. Informed Search I. One issue: How to search backwards? Very briefly: Bidirectional search. Outline for today s lecture

Outline. Informed search algorithms. Best-first search. Review: Tree search. A search Heuristics. Chapter 4, Sections 1 2 4

2006/2007 Intelligent Systems 1. Intelligent Systems. Prof. dr. Paul De Bra Technische Universiteit Eindhoven

Lecture 5 Heuristics. Last Time: A* Search

Informed Search Algorithms

Informed search algorithms. Chapter 4

CS 331: Artificial Intelligence Informed Search. Informed Search

Outline for today s lecture. Informed Search. Informed Search II. Review: Properties of greedy best-first search. Review: Greedy best-first search:

Informed search strategies (Section ) Source: Fotolia

CS 331: Artificial Intelligence Informed Search. Informed Search

Informed search algorithms. Chapter 3 (Based on Slides by Stuart Russell, Dan Klein, Richard Korf, Subbarao Kambhampati, and UW-AI faculty)

ARTIFICIAL INTELLIGENCE. Informed search

Solving problems by searching

Introduction to Artificial Intelligence. Informed Search

Last time: Problem-Solving

Artificial Intelligence

Artificial Intelligence

Informed search algorithms

Dr. Mustafa Jarrar. Chapter 4 Informed Searching. Sina Institute, University of Birzeit

S A E RC R H C I H NG N G IN N S T S A T T A E E G R G A R PH P S

Planning, Execution & Learning 1. Heuristic Search Planning

CS:4420 Artificial Intelligence

Part I. Instructor: Dr. Wei Ding. Uninformed Search Strategies can find solutions to problems by. Informed Search Strategies

CS 4700: Foundations of Artificial Intelligence

Informed Search. CS 486/686 University of Waterloo May 10. cs486/686 Lecture Slides 2005 (c) K. Larson and P. Poupart

DFS. Depth-limited Search

Informed Search A* Algorithm

Dr. Mustafa Jarrar. Chapter 4 Informed Searching. Artificial Intelligence. Sina Institute, University of Birzeit

Informed Search Methods

CS 4700: Foundations of Artificial Intelligence

Informed (Heuristic) Search. Idea: be smart about what paths to try.

Artificial Intelligence

Informed search algorithms. (Based on slides by Oren Etzioni, Stuart Russell)

Informed search algorithms. Chapter 4, Sections 1 2 1

Review Search. This material: Chapter 1 4 (3 rd ed.) Read Chapter 18 (Learning from Examples) for next week

Informed Search and Exploration

Artificial Intelligence p.1/49. n-queens. Artificial Intelligence p.2/49. Initial state: the empty board or a board with n random

4 INFORMED SEARCH AND EXPLORATION. 4.1 Heuristic Search Strategies

Artificial Intelligence Search: summary&exercises. Peter Antal

PROBLEM SOLVING AND SEARCH IN ARTIFICIAL INTELLIGENCE

Ar#ficial)Intelligence!!

Mustafa Jarrar: Lecture Notes on Artificial Intelligence Birzeit University, Chapter 3 Informed Searching. Mustafa Jarrar. University of Birzeit

Problem Solving and Search

HW#1 due today. HW#2 due Monday, 9/09/13, in class Continue reading Chapter 3

Chapter4. Tree Search (Reviewed, Fig. 3.9) Best-First Search. Search Strategies. Best-First Search (cont.-2) Best-First Search (cont.

Artificial Intelligence: Search Part 2: Heuristic search

Problem Solving: Informed Search

Informed Search and Exploration

Informed Search and Exploration

Informed Search CS457 David Kauchak Fall 2011

mywbut.com Informed Search Strategies-I

Informed Search. CMU Snake Robot. Administrative. Uninformed search strategies. Assignment 1 was due before class how d it go?

Lecture 2: Fun with Search. Rachel Greenstadt CS 510, October 5, 2017

ITCS 6150 Intelligent Systems. Lecture 5 Informed Searches

Artificial Intelligence

TDT4136 Logic and Reasoning Systems

TDDC17. Intuitions behind heuristic search. Recall Uniform-Cost Search. Best-First Search. f(n) =... + h(n) g(n) = cost of path from root node to n

Informed Search. CS 486/686: Introduction to Artificial Intelligence Fall 2013

Solving problems by searching

Problem solving and search

COMP9414: Artificial Intelligence Informed Search

Solving problems by searching

3 SOLVING PROBLEMS BY SEARCHING

Chapters 3-5 Problem Solving using Search

Informed Search. Dr. Richard J. Povinelli. Copyright Richard J. Povinelli Page 1

Introduction to Computer Science and Programming for Astronomers

Solving Problems: Intelligent Search

Informed search methods

Wissensverarbeitung. - Search - Alexander Felfernig und Gerald Steinbauer Institut für Softwaretechnologie Inffeldgasse 16b/2 A-8010 Graz Austria

Problem solving and search

CPS 170: Artificial Intelligence Search

Informed search algorithms

Problem Solving & Heuristic Search

Informed search methods

Solving Problems by Searching

Transcription:

Artificial Intelligence Informed search Peter Antal antal@mit.bme.hu 1

Informed = use problem-specific knowledge Which search strategies? Best-first search and its variants Heuristic functions? How to invent them Local search and optimization Hill climbing, local beam search, genetic algorithms, 2

Criterion Breadth- First Depth-First Uniformcost Depthlimited Iterative deepening Bidirectional search Complete? YES* YES* NO YES, if l d YES YES* Time b d+1 b C*/e b m b l b d b d/2 Space b d+1 b C*/e bm bl bd b d/2 Optimal? YES* YES* NO NO YES YES 2/21/2018 A.I. Uninformed search 3

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

The cardinality: 10 19 Any position can be solved in 20 or fewer moves (where a half-twist is counted as a single move) average branching factor is ~13.3 Invented in 1974 by Ernő Rubik. Rubik's cube current world records http://www.youtube.com/watch?v=oc0b4b4j9ys How can we guide the search process???

General approach of informed search: Best-first search: node is selected for expansion based on an evaluation function f(n) in TREE-SEARCH(). Idea: evaluation function measures distance to the goal. Choose node which appears best Implementation: fringe is queue sorted in decreasing order of desirability. Special cases: greedy search, A* search 7

[dictionary] A rule of thumb, simplification, or educated guess that reduces or limits the search for solutions in domains that are difficult and poorly understood. h(n) = estimated cost of the cheapest path from node n to goal node. If n is goal then h(n)=0 How to derive? (more information later) 8

Best-known form of best-first search. Idea: avoid expanding paths that are already expensive. Evaluation function f(n)=g(n) + h(n) g(n) the cost (so far) to reach the node. h(n) estimated cost to get from the node to the closest goal. f(n) estimated total cost of path through n to goal. 9

A* search uses an admissible heuristic A heuristic is admissible if it never overestimates the cost to reach the goal (~optimistic). Formally: 1. h(n) <= h*(n) where h*(n) is the true cost from n 2. h(n) >= 0 so h(g)=0 for any goal G. e.g. h SLD (n) never overestimates the actual road distance Theorem: If h(n) is admissible, A * using BEST-FIRST- SEARCH() with selector function f(n)=h(n) is optimal. 10

Suppose a suboptimal goal G 2 in the queue. Let n be an unexpanded node on a shortest to optimal goal G. f(g 2 ) = g(g 2 ) since h(g 2 )=0 > g(g) since G 2 is suboptimal >= f(n) since h is admissible Since f(g 2 ) > f(n), A* will never select G 2 for expansion (i.e. for checking, but note that G 2 can be inside the queue). 2/21/2018 A.I. 11

A heuristic is consistent if If h is consistent, we have h(n) c(n,a,n') h(n') f (n') g(n') h(n') g(n) c(n,a,n') h(n') g(n) h(n) f (n) i.e. f(n) is non-decreasing along any path. Theorem: If h(n) is consistent, A* using GRAPH-SEARCH is optimal 12

A* expands nodes in order of increasing f value Contours can be drawn in state space Uniform-cost search adds circles. F-contours are gradually Added: 1) nodes with f(n)<c* 2) Some nodes on the goal Contour (f(n)=c*). Contour i has all nodes with f=f i, where f i < f i+1. 2/21/2018 A.I. 13

Completeness: YES Since bands of increasing f are added Unless there are infinitly many nodes with f<f(g) 14

Completeness: YES Time complexity: Number of nodes expanded is still exponential in the length of the solution. 15

Completeness: YES Time complexity: (exponential with path length) Space complexity: It keeps all generated nodes in memory Hence space is the major problem not time 16

Completeness: YES Time complexity: (exponential with path length) Space complexity:(all nodes are stored) Optimality: YES Cannot expand f i+1 until f i is finished. A* expands all nodes with f(n)< C* A* expands some nodes with f(n)=c* A* expands no nodes with f(n)>c* Also optimally efficient (not including ties) 17

E.g for the 8-puzzle Avg. solution cost is about 22 steps (branching factor +/- 3) Exhaustive search to depth 22: 3.1 x 10 10 states. A good heuristic function can reduce the search process. 2/21/2018 A.I. 18

E.g for the 8-puzzle knows two commonly used heuristics h 1 = the number of misplaced tiles h 1 (s)=8 h 2 = the sum of the distances of the tiles from their goal positions (manhattan distance). h 2 (s)=3+1+2+2+2+3+3+2=18 2/21/2018 A.I. 19

Effective branching factor b* Is the branching factor that a uniform tree of depth d would have in order to contain N+1 nodes. N 1 1 b * (b*) 2... (b*) d Measure is fairly constant for sufficiently hard problems. Can thus provide a good guide to the heuristic s overall usefulness. A good value of b* is 1. 20

1200 random problems with solution lengths from 2 to 24. If h 2 (n) >= h 1 (n) for all n (both admissible) then h 2 dominates h 1 and is better for search 21

Admissible heuristics can be derived from the exact solution cost of a relaxed version of the problem: Relaxed 8-puzzle for h 1 : a tile can move anywhere As a result, h 1 (n) gives the shortest solution Relaxed 8-puzzle for h 2 : a tile can move to any adjacent square. As a result, h 2 (n) gives the shortest solution. The optimal solution cost of a relaxed problem is no greater than the optimal solution cost of the real problem. ABSolver found a useful heuristic for the Rubic cube. 22

Admissible heuristics can also be derived from the solution cost of a subproblem of a given problem. This cost is a lower bound on the cost of the real problem. Pattern databases store the exact solution for every possible subproblem instance. The complete heuristic is constructed using the patterns in the DB 2/21/2018 A.I. 23

Another way to find an admissible heuristic is through learning from experience: Experience = solving lots of 8-puzzles An inductive learning algorithm can be used to predict costs for other states that arise during search. 24

Heuristic function Admissible heuristics and A* Suggested reading Prieditis: Machine Discovery of Effective Admissible Heuristics, 1993 25