Artificial Intelligence. Informed search methods

Similar documents
Introduction to Artificial Intelligence. Informed Search

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

Informed search algorithms

Informed search algorithms. Chapter 4, Sections 1 2 1

Artificial Intelligence: Search Part 2: Heuristic search

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

PROBLEM SOLVING AND SEARCH IN ARTIFICIAL INTELLIGENCE

COMP219: Artificial Intelligence. Lecture 10: Heuristic Search

COMP219: Artificial Intelligence. Lecture 10: Heuristic Search

CS:4420 Artificial Intelligence

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

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

CS414-Artificial Intelligence

Informed search algorithms

Informed Search and Exploration

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

COSC343: Artificial Intelligence

Informed search algorithms

Introduction to Artificial Intelligence (G51IAI)

Solving Problems using Search

Informed Search Algorithms. Chapter 4

Informed Search and Exploration

Artificial Intelligence

Searching and NetLogo

Planning, Execution & Learning 1. Heuristic Search Planning

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

Informed Search and Exploration

TDT4136 Logic and Reasoning Systems

Robot Programming with Lisp

Problem solving and search

Informed search methods

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

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

Artificial Intelligence CS 6364

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

Solving Problems by Searching

Problem solving and search

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

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,

Foundations of Artificial Intelligence

Foundations of Artificial Intelligence

Automated Planning & Artificial Intelligence

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

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

4. Solving Problems by Searching

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

Artificial Intelligence

Solving Problems by Searching. Artificial Intelligence Santa Clara University 2016

Summary. Search CSL302 - ARTIFICIAL INTELLIGENCE 1

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

Artificial Intelligence

Informed Search and Exploration

Informatics 2D: Tutorial 2 (Solutions)

AGENTS AND ENVIRONMENTS. What is AI in reality?

AGENTS AND ENVIRONMENTS. What is AI in reality?

Outline. Best-first search

CS 771 Artificial Intelligence. Informed Search

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

Problem solving and search

Outline. Best-first search

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

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

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

Artificial Intelligence

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

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

Informed search algorithms. Chapter 4

Clustering (Un-supervised Learning)

PEAS: Medical diagnosis system

Informed search algorithms

Lecture 4: Informed/Heuristic Search

Shortest path using A Algorithm

Artificial Intelligence. 2. Informed Search

Informed search algorithms

Artificial Intelligence: Search Part 1: Uninformed graph search

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

Seminar: Search and Optimization

Foundations of 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 (heuristic) search (cont). Constraint-satisfaction search.

CS 380: Artificial Intelligence Lecture #4

ARTIFICIAL INTELLIGENCE. Informed search

Optimal Control and Dynamic Programming

Informed Search and Exploration for Agents

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

Informed Search (Ch )

Informed/Heuristic Search

Solving Problems by Searching

Solving Problems by Searching

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

Chapter 3 Solving Problems by Searching Informed (heuristic) search strategies More on heuristics

DFS. Depth-limited Search

Artificial Intelligence

EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS

CS 5100: Founda.ons of Ar.ficial Intelligence

Artificial Intelligence

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

Solving problems by searching

Problem solving and search

Transcription:

Artificial Intelligence Informed search methods

In which we see how information about the state space can prevent algorithms from blundering about in the dark. 2

Uninformed vs. Informed Search Uninformed search strategies Find solutions to problems by systematically generating new states and testing for goal Most are incredibly inefficient Informed search strategies Use problem-specific knowledge Find solutions more efficiently 3

Informed Search Informed search strategy One that uses problem-specific knowledge beyond the problem definition itself General approach is called Best First search Node selected for expansion based on an evaluation function Measuring a distance to goal Node with lowest evaluation is selected 4

Techniques Best-first search Expand minimum cost nodes first Greedy search Minimize estimated cost to reach goal A* search Estimated total costs through node n to goal: (actual cost to reach n) + (estimated cost from n to goal) Iterative improvement algorithms Continually moves in the direction of increasing value Hill climbing searches 5

Best-First Search Methods 6

Best-First Search Try to expand node that is closest to goal Use evaluation function to estimate how desirable Open set Priority queue implementation Insert expanded nodes in decreasing order of desirability (most desirable first) Special cases Greedy search: expand node closest to goal A* search: expand node on least-cost solution path 7

Greedy Search Simplest best-first search strategy Minimize estimated cost to reach goal Evaluation function h(n) (heuristic) Estimate of cost from node n to goal Require h(n) = 0 if n is goal e.g., For a road map, h SLD (n) = straight-line distance from city n to Bucharest Greedy search expands the node that appears to be closest to the goal Takes the biggest bite out of remaining cost to reach goal Each step tries to get as close to goal as possible Though, not considers if its action will be the best in the long run 8

Romania Step Costs in km 71 Oradea Neamt 87 75 Zerind 151 Iasi 118 140 Timisoara 111 70 75 Debreta 80 Sibiu Fagaras Lugoj Mehadia 120 99 Rimnicu Vilcea 97 146 138 Craiova Pitesti 211 101 85 90 Bucharest Giurgiu 92 142 98 Urziceni Vaslui Hirsova 86 Eforie 9

Straight-Line Distance to Bucharest 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 100 Rimnicu Vilcea 193 Sibiu 253 Timisoara 329 Urziceni 80 Vaslui 199 Zerind 374 10

Greedy Search Example: Romania 366 Open = { (366) } 11

Greedy Search Example: Romania 366 Zerind Sibu Timisoara 374 253 329 Open = { Sibu(253), Timisoara(329), Zerind(374) } 12

Greedy Search Example: Romania 366 Zerind Sibu Timisoara 374 253 329 Oradea Fagaras Rimnicu Vilcea 366 380 176 193 Open = { Fagaras(176), RimnicuVilcea(193), Timisoara(329), (366), Zerind(374), Oradea(380) } 13

Greedy Search Example: Romania 366 Zerind Sibu Timisoara 374 253 329 Oradea Fagaras Rimnicu Vilcea 366 380 176 193 Sibiu Bucharest 253 0 Open = { Bucharest(0), Fagaras(176), RimnicuVilcea(193), Sibu(253), Timisoara(329), (366), Zerind(374), Oradea(380) } 14

Greedy Search Example: Romania 366 Zerind Sibu Timisoara 374 253 329 Oradea Fagaras Rimnicu Vilcea 366 380 176 193 Sibiu Bucharest 253 0 15

Properties of Greedy Search Not complete (can be bad) Can get stuck in loops Go from Iasi to Fagaras: Iasi Neamt Iasi Neamt (only 1 link) Complete if check for repeated states Time (can be bad) O(b m ), m=maximum depth (worst case, like DFS) Space (can be bad) O(b m ), keeps all nodes in memory (worst case) Not optimal (can be bad) Heuristic is an estimate But a good heuristic can give dramatic improvement! 16

A* Search Minimizes total estimated path cost Avoids expanding paths already expensive Evaluation function f(n) = g(n) + h(n) Actual cost to reach node n so far g(n) Estimated cost from n to goal h(n) Estimated total cost through n to goal f(n) = g(n) + h(n) A* search uses admissible heuristic i.e., h(n) h*(n) where h*(n) is true cost from n to goal e.g., h SLD (n) never overestimates actual distance 17

A* Search Example: Romania Open = { (366) } 366 g(n): cost so far f(n)=g(n)+h(n) = cost so far + estimated cost to goal 18

A* Search Example: Romania 75 366 140 118 Open = { Sibu(393), Timisoara(447), Zerind(449) } Zerind Sibu Timisoara 449 393 447 f(zerind)=75 + 374=449 g(n): cost so far f(n)=g(n)+h(n) = cost so far + estimated cost to goal 19

A* Search Example: Romania 75 Zerind Sibu 366 140 118 Timisoara 449 393 447 140 151 99 80 Open = { RimnicuVilcea(413), Fagaras(415), Timisoara(447), Zerind(449), (646), Oradea(671) } Oradea Fagaras Rimnicu Vilcea 646 671 415 413 f(fagaras)=(140+99) + 176=415 g(n): cost so far f(n)=g(n)+h(n) = cost so far + estimated cost to goal 20

A* Search Example: Romania 75 366 140 118 Open = { Fagaras(415), Pitesti(417), Timisoara(447), Zerind(449), Craiova(526), Sibu(553), (646), Oradea(671) } Zerind Sibu Timisoara 449 393 447 140 151 99 80 Oradea Fagaras Rimnicu Vilcea 646 671 415 413 146 97 80 Craiova Pitesti Sibiu 526 417 553 g(n): cost so far f(n)=g(n)+h(n) = cost so far + estimated cost to goal 21

A* Search Example: Romania 75 366 140 118 Open = { Pitesti(417), Timisoara(447), Bucharest(450), Zerind(449), Craiova(526), Sibu(553), Sibu(591), (646), Oradea(671) } Zerind Sibu Timisoara 449 393 447 140 151 99 80 Oradea Fagaras Rimnicu Vilcea 646 671 415 413 99 211 146 97 80 Sibiu Bucharest 591 450 Craiova Pitesti Sibiu 526 417 553 g(n): cost so far f(n)=g(n)+h(n) = cost so far + estimated cost to goal 22

A* Search Example: Romania 75 366 140 118 Open = { Bucharest(418), Timisoara(447), Bucharest(450), Zerind(449), Craiova(526), Sibu(553), Sibu(591), RimnicuVilcea(607), Craiova(615), (646), Oradea(671) } Zerind Sibu Timisoara 449 393 447 140 151 99 80 Oradea Fagaras Rimnicu Vilcea 646 671 415 413 99 211 146 97 80 Sibiu Bucharest 591 450 Craiova Pitesti Sibiu 526 417 553 97 138 101 Rimnicu Vilcea g(n): cost so far f(n)=g(n)+h(n) = cost so far + estimated cost to goal Craiova Bucharest 607 615 418 23

A* Search Example: Romania 75 366 140 118 Recall that Greedy path was [, Sibu, Fagaras, Bucharest] = 450 Zerind Sibu Timisoara 449 393 447 140 151 99 80 Oradea Fagaras Rimnicu Vilcea 646 671 415 413 99 211 146 97 80 Sibiu Bucharest 591 450 Craiova Pitesti Sibiu 526 417 553 97 138 101 Rimnicu Vilcea g(n): cost so far f(n)=g(n)+h(n) = cost so far + estimated cost to goal Craiova Bucharest 607 615 418 24

Admissible Heuristics (Not over-estimate path cost) 8-puzzle h 1 (n) = number of misplaced tiles Must move each misplaced tile at least once h 2 (n) = total Manhattan distance (city block) Number of squares from desired tile location (Horiz+Vert) 5 4 6 1 8 1 2 8 3 4 7 3 2 Start State 7 6 5 Goal State 25

Admissible Heuristics 5 4 1 2 3 6 1 8 8 4 7 3 2 Start State 7 6 5 Goal State h 1 (Start) = 7 (# tiles misplaced) h 2 (Start) = 2+3+3+2+4+2+0+2=18 (total Manhattan distance) [Typical solution about 20 steps, though varies with initial state] 26

Heuristic Dominance If h 2 (n) h 1 (n) for all n (both admissible) Then h 2 dominates h 1, and h 2 is better for search As the larger h 2 is closer to the optimal/true total cost h*, then A* using h 2 will expand fewer nodes (on average) 27

Properties of A* Complete (good) Unless infinitely many nodes Time and space (not good) Still exponential in worst case (keeps all nodes in memory) Strongly depends on choice of heuristic Optimal (good) Expands fewest nodes Gaming: Sim City traffic 28

Summary Informed search strategies Best-first search Expand minimum cost nodes first Greedy search Minimize estimated cost to reach goal A* search Estimated total costs through n to goal (actual cost to reach n) + (estimated cost from n to goal) Admissible heuristic never overestimates actual distance to goal 29