Department of Computer Science

Slides:



Advertisements
Similar presentations
Informed Search Algorithms
Advertisements

Problem Solving: Informed Search Algorithms Edmondo Trentin, DIISM.
Informed Search Methods Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 4 Spring 2004.
Types of Algorithms.
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*
Informed Search Methods How can we make use of other knowledge about the problem to improve searching strategy? Map example: Heuristic: Expand those nodes.
Problem Solving and Search in AI Heuristic Search
CSC344: AI for Games Lecture 4: Informed search
5-Nov-2003 Heuristic Search Techniques What do you do when the search space is very large or infinite? We’ll study three more AI search algorithms: Backtracking.
Informed Search Idea: be smart about what paths to try.
Dr.Abeer Mahmoud ARTIFICIAL INTELLIGENCE (CS 461D) Dr. Abeer Mahmoud Computer science Department Princess Nora University Faculty of Computer & Information.
Dr. Naveed Ahmad Assistant Professor Department of Computer Science University of Peshawar.
Informed search strategies Idea: give the algorithm “hints” about the desirability of different states – Use an evaluation function to rank nodes and select.
Informed Search Methods. Informed Search  Uninformed searches  easy  but very inefficient in most cases of huge search tree  Informed searches  uses.
Informed Search Strategies Lecture # 8 & 9. Outline 2 Best-first search Greedy best-first search A * search Heuristics.
Heuristic Search: A* 1 CPSC 322 – Search 4 January 19, 2011 Textbook §3.6 Taught by: Vasanth.
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.
G5AIAI Introduction to AI Graham Kendall Heuristic Searches.
For Monday Read chapter 4 exercise 1 No homework.
Romania. Romania Problem Initial state: Arad Goal state: Bucharest Operators: From any node, you can visit any connected node. Operator cost, the.
Chap 4: Searching Techniques Artificial Intelligence Dr.Hassan Al-Tarawneh.
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.
Informed Search Methods
Review: Tree search Initialize the frontier using the starting state
Greedy Algorithms.
Last time: Problem-Solving
Artificial Intelligence (CS 370D)
Heuristic Search A heuristic is a rule for choosing a branch in a state space search that will most likely lead to a problem solution Heuristics are used.
For Monday Chapter 6 Homework: Chapter 3, exercise 7.
Heuristic Search Introduction to Artificial Intelligence
Informed Search and Exploration
Artificial Intelligence Problem solving by searching CSC 361
Chap 4: Searching Techniques Artificial Intelligence Dr.Hassan Al-Tarawneh.
HW #1 Due 29/9/2008 Write Java Applet to solve Goats and Cabbage “Missionaries and cannibals” problem with the following search algorithms: Breadth first.
The A* Algorithm Héctor Muñoz-Avila.
Discussion on Greedy Search and A*
Discussion on Greedy Search and A*
Lecture 1B: Search.
Types of Algorithms.
CS 4100 Artificial Intelligence
Artificial Intelligence Informed Search Algorithms
EA C461 – Artificial Intelligence
Informed search algorithms
Advanced Analysis of Algorithms
Informed search algorithms
Artificial Intelligence
Informed search algorithms
Graph Searching.
CSE 473 University of Washington
Chap 4: Searching Techniques
Types of Algorithms.
Announcements This Friday Project 1 due Talk by Jeniya Tabassum
HW 1: Warmup Missionaries and Cannibals
CSC 380: Design and Analysis of Algorithms
Informed Search Idea: be smart about what paths to try.
State-Space Searches.
State-Space Searches.
HW 1: Warmup Missionaries and Cannibals
Artificial Intelligence
Reading: Chapter 4.5 HW#2 out today, due Oct 5th
Solving Problems by Searching
Artificial Intelligence: Theory and Practice Ch. 3. Search
State-Space Searches.
Informed Search Idea: be smart about what paths to try.
Informed Search.
“If I Only had a Brain” Search
Presentation transcript:

Department of Computer Science Lecture 4 Informed Search Yaohang Li Department of Computer Science ODU Reading for Next Class: Chapter 3, Russell and Norvig

Review Last Class This Class Next Class Implementation of Blind Search Algorithm Breadth-first search Depth-first search Uniform-cost search Analysis of Blind Search Algorithm This Class Discussion of Assignment 1 Heuristic Search Next Class Local Search

Heuristic Search Best-first Search A node is selected for expansion based on an evaluation function, f(n) The node with the lowest evaluation is selected Implemented using a priority queue Best-first Search is not an accurate name The node may not be actually the best It is “Seemingly Best” Heuristic Function h(n) = estimated cost of the cheapest path from node n to a goal node

Greedy Best-First Search Strategy Try to expand the node that is closest to the goal The node is likely to lead to a solution quickly Evaluation function is the heuristic function f(n)=h(n) Analysis Similar to the DFS Keep track of the path from the root to the current node

Example: Route Finding

Example: Route Finding Heuristic Function Using the straight-line distance We need to know the straight-line distance to the goal state Suppose our goal is Bucharest

Stages in a Greedy Best-First

Analysis of Greedy Best-first Search How about from Iasi to Fagaras in our example? Requirement of Greedy Best-first Search We need additional information Straight line distance in our route-finding example Discussion Heuristic may cause unnecessary nodes to be expanded May be in an infinite path Similar to DFS Incomplete Not Optimal Worse case time and space complexity: O(bm) Conclusion Good Heuristic is the Key The complexity can be reduced substantially Bad Heuristic can make the problem worse

Another Example of Greedy Best-First Search 8-puzzle Develop a useful heuristic function

h(N) = number of misplaced tiles = 6 Heuristic Function Function h(N) that estimates the cost of the cheapest path from node N to goal node. Example: 8-puzzle 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 h(N) = number of misplaced tiles = 6 goal N

h(N) = sum of the distances of every tile to its goal position Heuristic Function Function h(N) that estimates the cost of the cheapest path from node N to goal node. Example: 8-puzzle 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 h(N) = sum of the distances of every tile to its goal position = 2 + 3 + 0 + 1 + 3 + 0 + 3 + 1 = 13 goal N

f(N) = h(N) = number of misplaced tiles 8-Puzzle f(N) = h(N) = number of misplaced tiles 3 4 3 4 5 3 3 4 2 4 4 2 1

f(N) = h(N) =  distances of tiles to goal 8-Puzzle f(N) = h(N) =  distances of tiles to goal 6 4 5 3 2 5 4 2 1

Example of a Better Evaluation Function f(N) = (sum of distances of each tile to its goal) + 3 x (sum of score functions for each tile) where score function for a non-central tile is 2 if it is not followed by the correct tile in clockwise order and 0 otherwise 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 f(N) = 2 + 3 + 0 + 1 + 3 + 0 + 3 + 1 3x(2 + 2 + 2 + 2 + 2 + 0 + 2) = 49 goal N

Greedy Algorithms Step-by-step algorithms Sometimes works well for optimization problems A greedy algorithm works in phases. At each phase: You take the best you can get right now, without regard for future consequences You hope that by choosing a local optimum at each step, you will end up at a global optimum

Example: Counting money Suppose you want to count out a certain amount of money, using the fewest possible bills and coins A greedy algorithm would do this would be: At each step, take the largest possible bill or coin that does not overshoot Example: To make $6.39, you can choose: a $5 bill a $1 bill, to make $6 a 25¢ coin, to make $6.25 A 10¢ coin, to make $6.35 four 1¢ coins, to make $6.39 For US money, the greedy algorithm always gives the optimum solution

A failure of the greedy algorithm In some (fictional) monetary system, “krons” come in 1 kron, 7 kron, and 10 kron coins Using a greedy algorithm to count out 15 krons, you would get A 10 kron piece Five 1 kron pieces, for a total of 15 krons This requires six coins A better solution would be to use two 7 kron pieces and one 1 kron piece This only requires three coins The greedy algorithm results in a solution, but not in an optimal solution

Uniform Cost Search vs. Greedy Best First Search Same Strategy Implementation A priority queue Difference Uniform Cost Search Cares for the path cost Expand nodes with the lowest path cost Greedy Best First Search Cares for the heuristic Expand nodes with the lowest heuristic value Thinking Can we combine this two search strategies? A* Search

A* Search Goal Evaluation function Minimizing the total estimated solution cost Evaluation function f(n) Estimated cost of the cheapest solution through n f(n)=g(n)+h(n) g(n) History Gives the path cost from the start node to node n h(n) Estimated cost of the cheapest path from n to the goal Heuristic function

Example: Route Finding A* Search Heuristic Function Using the straight-line distance Path Cost Function Using the path cost from the graph

Progress in A* Search

Progress in A* Search (Continue)

Analysis of A* Search Completeness and Optimality Drawback Provided that the heuristic function h(n) satisfies certain conditions, A* search is both complete and optimal A* is optimal if h(n) is an admissible heuristic Admissible heuristic Provided that h(n) never overestimates the cost to reach the goal Nature optimistic Thinking the cost of solving the problem is less than it actually is Drawback Space requirement Keep all generated nodes in memory Easy to run out of memory Not practical for many large-scale problems

Summary Heuristics and Heuristic Functions Heuristic Algorithm Greedy Algorithm A* Algorithm

What I want you to do Review Chapter 3 Work on your assignment Organize your project team