Overview. Path Cost Function. Real Life Problems. COMP219: Artificial Intelligence. Lecture 10: Heuristic Search

Similar documents
COMP219: Artificial Intelligence. Lecture 10: Heuristic Search

COMP219: Artificial Intelligence. Lecture 10: Heuristic Search

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

Introduction to Artificial Intelligence. Informed Search

Artificial Intelligence. Informed search methods

Informed search algorithms

Informed search algorithms

Informed search algorithms. Chapter 4, Sections 1 2 1

COSC343: Artificial Intelligence

Artificial Intelligence: Search Part 2: Heuristic search

PROBLEM SOLVING AND SEARCH IN ARTIFICIAL INTELLIGENCE

CS414-Artificial Intelligence

Artificial Intelligence, CS, Nanjing University Spring, 2018, Yang Yu. Lecture 3: Search 2.

CS:4420 Artificial Intelligence

Introduction to Artificial Intelligence (G51IAI)

Princess Nora University Faculty of Computer & Information Systems ARTIFICIAL INTELLIGENCE (CS 370D) Computer Science Department

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

Informed Search and Exploration

Solving Problems using Search

Planning, Execution & Learning 1. Heuristic Search Planning

Problem solving and search

Informed Search Algorithms. Chapter 4

Informed Search and Exploration

Informed search algorithms

Artificial Intelligence

Searching and NetLogo

TDT4136 Logic and Reasoning Systems

Problem solving and search

Informed search methods

CS486/686 Lecture Slides (c) 2015 P.Poupart

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

Lecture Plan. Best-first search Greedy search A* search Designing heuristics. Hill-climbing. 1 Informed search strategies. Informed strategies

CS486/686 Lecture Slides (c) 2014 P.Poupart

Solving Problems by Searching

Robot Programming with Lisp

Informed Search and Exploration

Graphs vs trees up front; use grid too; discuss for BFS, DFS, IDS, UCS Cut back on A* optimality detail; a bit more on importance of heuristics,

Week 3: Path Search. COMP9414/ 9814/ 3411: Artificial Intelligence. Motivation. Example: Romania. Romania Street Map. Russell & Norvig, Chapter 3.

Foundations of Artificial Intelligence

Algorithm. December 7, Shortest path using A Algorithm. Phaneendhar Reddy Vanam. Introduction. History. Components of A.

COMP219: Artificial Intelligence. Lecture 7: Search Strategies

4. Solving Problems by Searching

AGENTS AND ENVIRONMENTS. What is AI in reality?

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

Foundations of Artificial Intelligence

Solving Problems by Searching. Artificial Intelligence Santa Clara University 2016

Informed Search. Topics. Review: Tree Search. What is Informed Search? Best-First Search

16.1 Introduction. Foundations of Artificial Intelligence Introduction Greedy Best-first Search 16.3 A Weighted A. 16.

AGENTS AND ENVIRONMENTS. What is AI in reality?

Artificial Intelligence CS 6364

Artificial Intelligence

Automated Planning & Artificial Intelligence

Problem Solving and Search. Geraint A. Wiggins Professor of Computational Creativity Department of Computer Science Vrije Universiteit Brussel

CS-E4800 Artificial Intelligence

Informed Search and Exploration

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

Route planning / Search Movement Group behavior Decision making

PEAS: Medical diagnosis system

Clustering (Un-supervised Learning)

Artificial Intelligence: Search Part 1: Uninformed graph search

Shortest path using A Algorithm

Seminar: Search and Optimization

Informatics 2D: Tutorial 2 (Solutions)

Summary. Search CSL302 - ARTIFICIAL INTELLIGENCE 1

Problem solving and search

Informed (heuristic) search (cont). Constraint-satisfaction search.

Artificial Intelligence, CS, Nanjing University Spring, 2018, Yang Yu. Lecture 2: Search 1.

Solving Problems by Searching

Solving Problems by Searching

Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany, Course on Artificial Intelligence,

CS 771 Artificial Intelligence. Informed Search

Foundations of Artificial Intelligence

Artificial Intelligence

Artificial Intelligence

Complete the quizzes in the "Problem Set 1" unit in the Introduction to Artificial Intelligence course from Udacity:

Informed Search (Ch )

Outline. Best-first search

Outline. Best-first search

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

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

Optimal Control and Dynamic Programming

Artificial Intelligence

Artificial Intelligence. 2. Informed Search

Contents. Foundations of Artificial Intelligence. General Algorithm. Best-First Search

Informed search algorithms

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

Informed search algorithms

CS 5100: Founda.ons of Ar.ficial Intelligence

Ar#ficial)Intelligence!!

Search. Intelligent agents. Problem-solving. Problem-solving agents. Road map of Romania. The components of a problem. that will take me to the goal!

Problem solving and search

Solving problems by searching

Problem-solving agents. Solving Problems by Searching. Outline. Example: Romania. Chapter 3

CSC384: Intro to Artificial Intelligence Search III

DFS. Depth-limited Search

Informed Search and Exploration for Agents

Lecture 4: Informed/Heuristic Search

Introduction to Artificial Intelligence (G51IAI) Dr Rong Qu. Blind Searches

CS 380: Artificial Intelligence Lecture #4

CS:4420 Artificial Intelligence

Transcription:

COMP219: Artificial Intelligence Lecture 10: Heuristic Search Overview Last time Depth-limited, iterative deepening and bi-directional search Avoiding repeated states Today Show how applying knowledge of the problem can help Introduce uniform cost search: dependent on the cost of each node Introduce heuristics: rules of thumb Introduce heuristic search Greedy search A* search Learning outcome covered today: Identify, contrast and apply to simple examples the major search techniques that have been developed for problem-solving in AI 1 2 Real Life Problems Whatever search technique we use, we have exponential time complexity Tweaks to the algorithm will not reduce this to polynomial We need problem specific knowledge to guide the search Simplest form of problem specific knowledge is heuristics Usual implementation in search is via an evaluation function which indicates desirability of expanding a node Path Cost Function Recall: we have a path cost function, which gives the cost of each path. This is comprised of the step costs of each action on the path. 3 4

Finding The Best Paths Why not expand the cheapest path first? Intuition: cheapest is likely to be best! Performance is like breadth-first search but we use the minimum cost path rather than the shallowest to expand Uniform cost search orders the agenda as a priority queue using the lowest path cost of a node Cheapest First Choose Zerind Choose Timisoara Choose Sibiu Choose Oradea Choose Rimnicu Vilcea Choose Lugoj Choose Fagaras Choose Mehadia 146 75 Choose Pitesti 239 140 118 229 299 220 317 450 418 5 374 366 6 General Algorithm for Uniform Cost Search agenda = initial state; while agenda not empty do take node from agenda such that g(node) = min { g(n) n in agenda} if node is goal state then return solution; new nodes = apply operations to node; add new nodes to the agenda; Properties of Uniform Cost Search Uniform cost search guaranteed to find cheapest solution assuming path costs grow monotonically, i.e. the cost of a path never decreases as we move along it In other words, adding another step to the solution makes it more costly, i.e. g(successor(n)) > g(n). If path costs don t grow monotonically, then exhaustive search is required Still requires many nodes to be examined 7 8

Informed Strategies Use problem-specific knowledge More efficient than blind search The most promising path first! Rather than trying all possible search paths, you try to focus on paths that seem to be getting you nearer your target/goal state Greedy Search Most heuristics estimate cost of cheapest path from node to solution We have a heuristic function, h : Nodes R which estimates the distance from the node to the goal h can be any function but should have h(n) = 0 if n is a goal Example: In route finding, heuristic might be straight line distance from node to destination Greedy search expands the node that appears to be closest to goal 9 10 Romania Example Straight-line distance to Bucharest Arad 366 Bucharest 0 Craiova 160 Dobreta 242 Eforie 161 Fagaras 176 Giurgiu 77 Hirsova 151 Iasi 226 Lugoj 244 Mehadia 241 Neamt 234 Oradea 380 Pitesti 98 Rimnicu Vilcea 193 Sibiu 253 Timisoara 329 Urziceni 80 Vaslui 199 Zerind 374 366 Choose Sibiu 374 329 Greedy Search Example 380 193 Choose Fagaras 253 176 0 NOT the cheapest path BUT far less effort 11 12

Search Tree Exercise 13 14 General Algorithm for Greedy Search agenda = initial state; while agenda not empty do take node from agenda such that h(node) = min { h(n) n in agenda} if node is goal state then return solution; new nodes = apply operations to node; add new nodes to the agenda; Properties of Greedy Search Greedy search finds solutions quickly Doesn t always find the best May not find a solution if there is one (incomplete) Susceptible to false starts Only looking at current node. Ignores past! Short sighted 15 16

A* Search A* is a very efficient search strategy Basic idea is to combine uniform cost search and greedy search We look at the cost so far and the estimated cost to goal Gives heuristic f: f(n) = g(n) + h(n) where g(n) is path cost of n h(n) is expected cost of cheapest solution from n Aims to minimise overall cost Choose Sibiu 75+374 0+366 118+329 A* Search Example Choose Rimnicu Vilcea 413 < 415 291+380 140+253 220+193 317+100 239+176 418+0 Choose Fagaras 415 < 417 450+0 Choose Pitesti 418 < 450 Cheapest route found all open nodes > 418 17 455+160 18 Search Tree General Algorithm for A* Search agenda = initial state; while agenda not empty do take node from agenda such that f(node) = min { f(n) n in agenda} where f(n) = g(n) + h(n) if node is goal state then return solution; new nodes = apply operations to node; add new nodes to the agenda; 19 20

Properties of A* Search Complete, provided only finitely many nodes with f < f(g) an admissible heuristic is used Never overestimates the distance i.e., h(n) < true(n) where true(n) is the true cost from n Also require h(n) 0, so h(g) = 0 for any goal G Exponential time Keeps all nodes in memory Optimal Admissible Heuristics Example - for the 8-puzzle: h 1 (n) = number of misplaced tiles h 2 (n) = total Manhattan distance (i.e., no. of squares from desired location of each tile) Start State Goal State 21 22 Exercise Importance of the Heuristic Choice Typical search costs: d = 14 IDS = 3,473,941 nodes A*(h 1 ) = 539 nodes A*(h 2 ) = 113 nodes d = 24 IDS 54,000,000,000 nodes A*(h 1 ) = 39,135 nodes A*(h 2 ) = 1,641 nodes 23 24

Summary Heuristic functions estimate costs of shortest paths Good heuristics can dramatically reduce search cost Greedy best-first search expands lowest h incomplete and not always optimal A* search expands lowest g + h complete and optimal also optimally efficient Next week Search in complex environments (partial observation) and in game playing 25