Heuristic Search Introduction to Artificial Intelligence

Slides:



Advertisements
Similar presentations
Informed search algorithms
Advertisements

Lights Out Issues Questions? Comment from me.
Informed search algorithms
Review: Search problem formulation
Informed Search Algorithms
Notes Dijstra’s Algorithm Corrected syllabus.
Informed search strategies
Informed search algorithms
An Introduction to Artificial Intelligence
A* Search. 2 Tree search algorithms Basic idea: Exploration of state space by generating successors of already-explored states (a.k.a.~expanding states).
Problem Solving: Informed Search Algorithms Edmondo Trentin, DIISM.
Solving Problem by Searching
1 Heuristic Search Chapter 4. 2 Outline Heuristic function Greedy Best-first search Admissible heuristic and A* Properties of A* Algorithm IDA*
Review: Search problem formulation
A* Search Introduction to AI. What is an A* Search? A greedy search method minimizes the cost to the goal by using an heuristic function, h(n). It works.
CS 460 Spring 2011 Lecture 3 Heuristic Search / Local Search.
Problem Solving and Search in AI Heuristic Search
CSC344: AI for Games Lecture 4: Informed search
Rutgers CS440, Fall 2003 Heuristic search Reading: AIMA 2 nd ed., Ch
Graphs II Robin Burke GAM 376. Admin Skip the Lua topic.
Dr.Abeer Mahmoud ARTIFICIAL INTELLIGENCE (CS 461D) Dr. Abeer Mahmoud Computer science Department Princess Nora University Faculty of Computer & Information.
INTRODUÇÃO AOS SISTEMAS INTELIGENTES Prof. Dr. Celso A.A. Kaestner PPGEE-CP / UTFPR Agosto de 2011.
Informed search algorithms
Informed search algorithms Chapter 4. Outline Best-first search Greedy best-first search A * search Heuristics Memory Bounded A* Search.
Informed search algorithms
2013/10/17 Informed search A* algorithm. Outline 2 Informed = use problem-specific knowledge Which search strategies? Best-first search and its variants.
Informed search algorithms Chapter 4. Outline Best-first search Greedy best-first search A * search Heuristics.
1 Shanghai Jiao Tong University Informed Search and Exploration.
Informed search algorithms Chapter 4. Best-first search Idea: use an evaluation function f(n) for each node –estimate of "desirability"  Expand most.
ISC 4322/6300 – GAM 4322 Artificial Intelligence Lecture 3 Informed Search and Exploration Instructor: Alireza Tavakkoli September 10, 2009 University.
Informed search strategies Idea: give the algorithm “hints” about the desirability of different states – Use an evaluation function to rank nodes and select.
Informed searching. Informed search Blind search algorithms do not consider any information about the states and the goals Often there is extra knowledge.
Informed Search Strategies Lecture # 8 & 9. Outline 2 Best-first search Greedy best-first search A * search Heuristics.
Chapter 4 Informed/Heuristic Search
Review: Tree search Initialize the frontier using the starting state While the frontier is not empty – Choose a frontier node to expand according to search.
CSC3203: AI for Games Informed search (1) Patrick Olivier
Informed Search I (Beginning of AIMA Chapter 4.1)
1 Kuliah 4 : Informed Search. 2 Outline Best-First Search Greedy Search A* Search.
Informed Search and Heuristics Chapter 3.5~7. Outline Best-first search Greedy best-first search A * search Heuristics.
4/11/2005EE562 EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS Lecture 4, 4/11/2005 University of Washington, Department of Electrical Engineering Spring 2005.
A General Introduction to Artificial Intelligence.
Feng Zhiyong Tianjin University Fall  Best-first search  Greedy best-first search  A * search  Heuristics  Local search algorithms  Hill-climbing.
Best-first search Idea: use an evaluation function f(n) for each node –estimate of "desirability"  Expand most desirable unexpanded node Implementation:
Pengantar Kecerdasan Buatan 4 - Informed Search and Exploration AIMA Ch. 3.5 – 3.6.
Heuristic Search Foundations of Artificial Intelligence.
Chapter 3.5 and 3.6 Heuristic Search Continued. Review:Learning Objectives Heuristic search strategies –Best-first search –A* algorithm Heuristic functions.
CPSC 420 – Artificial Intelligence Texas A & M University Lecture 5 Lecturer: Laurie webster II, M.S.S.E., M.S.E.e., M.S.BME, Ph.D., P.E.
Romania. Romania Problem Initial state: Arad Goal state: Bucharest Operators: From any node, you can visit any connected node. Operator cost, the.
Chapter 3 Solving problems by searching. Search We will consider the problem of designing goal-based agents in observable, deterministic, discrete, known.
Chapter 3.5 Heuristic Search. Learning Objectives Heuristic search strategies –Best-first search –A* algorithm Heuristic functions.
Review: Tree search Initialize the frontier using the starting state
Last time: Problem-Solving
Artificial Intelligence (CS 370D)
Introduction to Artificial Intelligence
Artificial Intelligence Problem solving by searching CSC 361
Discussion on Greedy Search and A*
Discussion on Greedy Search and A*
Informed search algorithms
CS 4100 Artificial Intelligence
Artificial Intelligence Informed Search Algorithms
COMP 8620 Advanced Topics in AI
Informed search algorithms
Informed search algorithms
Artificial Intelligence
CSE 473 University of Washington
HW 1: Warmup Missionaries and Cannibals
HW 1: Warmup Missionaries and Cannibals
Artificial Intelligence
Solving Problems by Searching
Informed Search.
Presentation transcript:

Heuristic Search Introduction to Artificial Intelligence Dr. Robin Burke

Review We can turn (certain classes of) problems into state spaces We can use search to find solutions DFS BFS IDS But what about operator cost?

Example: path planning v1 v2 states = positions initial state v5 goal state v6 start v3 v4 v5 v6 v7 target

Search Tree n1: v5, init n2: v7, n1 n3: v4, n1 n4: v1, n1 n11: v2, n4

Graph with costs v2 v1 v5 v4 v3 v6 v7 1 1 3 4 1 start 6 2 1 4 3 1 5 target

Search Tree n1: v5, init, 0 n2: v7, n1, 3 n3: v4, n1, 6 n4: v1, n1, 1

Possible solutions Costs 4, 6, 6, 7, 9, 12, 15 worst is almost 4x best shortest path is not lowest-cost

Uniform-cost search Simple idea Don’t want use the least cost option Don’t want to use the least cost operation at a given node why not? Concentrate on lowest-cost path so far Djikstra’s algorithm

Search algorithm Given Algorithm a set of nodes N a successor function f that takes a node n returns all of the nodes S reachable from n in a single action Algorithm sort N by path cost, select cheapest path s = state(n) p = path(n) S = f(s) for all s’, a  S if s is solution, done if s is illegal, discard if on closed list, ignore this path, must be costlier else create new node na = <s’, (n,a)> N = N – n + na repeat

Basic idea Don’t consider any paths of cost k Implementation until you’ve considered paths of cost < k Implementation need a priority queue path cost = inverse priority nodes with lowest path cost come first possible data structure heap

open closed path: v5, v1, v2, v4, v6 n1: v5, init, 0 n2: v7, n1, 3

Properties of Uniform-Cost Search Complete? Yes Time? O(b(1+C/e)) where C is the cost of the best path e is the minimum action cost Space? same Optimal?

Heuristic search What if we can measure our distance to a solution? We don’t have to guess about the “right” direction perhaps not perfect Example Straight-line distance on a map

Example

Heuristic Suggests paths that are likely to lead in the right direction unlike uniform-cost algorithm Example start in Arad (366) cheapest edge to Zerind but Zerind is actually farther (374) better choice Sibiu (253) even though the edge is longer

Idea Greedy best-first search Same priority queue as before maximize the heuristic at each step Same priority queue as before but prioritize by heuristic the closer the better

Greedy best-first search example

Greedy best-first search example

Greedy best-first search example

Greedy best-first search example

Properties of greedy best-first search Complete? No – can get stuck in loops Mehadia -> Dobreta -> Mehadia ... if road to Craiova missing Time? O(bm), but a good heuristic can give dramatic improvement Space? O(bm) -- keeps all nodes in memory Optimal? There is a shorter path to Bucharest via Fagaras = 450 via Rimnicu Vilcea = 418

A* search Idea: avoid expanding paths that are already expensive Evaluation function f(n) = g(n) + h(n) g(n) = cost so far to reach n h(n) = estimated cost from n to goal f(n) = estimated total cost of path through n to goal

A* search example

A* search example

A* search example

A* search example

A* search example

A* search example

Admissible heuristics A heuristic h(n) is admissible if for every node n, h(n) ≤ h*(n), where h*(n) is the true cost to reach the goal state from n. An admissible heuristic never overestimates the cost to reach the goal, i.e., it is optimistic Example: hSLD(n) (never overestimates the actual road distance) If h(n) is admissible, A* is optimal (see book for proof)

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 Exponential unless there are infinitely many nodes with f ≤ f(G) Time? Exponential Space? Keeps all nodes in memory Optimal?

Search demo

Admissible heuristics E.g., for the 8-puzzle: h1(n) = number of misplaced tiles h2(n) = total Manhattan distance (i.e., no. of squares from desired location of each tile) h1(S) = ? h2(S) = ?

Admissible heuristics E.g., for the 8-puzzle: h1(n) = number of misplaced tiles h2(n) = total Manhattan distance (i.e., no. of squares from desired location of each tile) h1(S) = ? 8 h2(S) = ? 3+1+2+2+2+3+3+2 = 18

Dominance If h2(n) ≥ h1(n) for all n (both admissible) then h2 dominates h1 h2 is better for search Typical search costs (average number of nodes expanded): d=12 IDS = 3,644,035 nodes A*(h1) = 227 nodes A*(h2) = 73 nodes d=24 IDS = too many nodes A*(h1) = 39,135 nodes A*(h2) = 1,641 nodes

Relaxed problems A problem with fewer restrictions on the actions is called a relaxed problem The cost of an optimal solution to a relaxed problem is an admissible heuristic for the original problem If the rules of the 8-puzzle are relaxed so that a tile can move anywhere, then h1(n) gives the shortest solution If the rules are relaxed so that a tile can move to any adjacent square, then h2(n) gives the shortest solution

Practical Programming assignment using AIMA search code link on course page Download and compile Take a look at search demos for eight-puzzle, etc.

Tuesday Reading Ch. 4.3-4.6