1 Kuliah 4 : Informed Search. 2 Outline Best-First Search Greedy Search A* Search.

Slides:



Advertisements
Similar presentations
Lights Out Issues Questions? Comment from me.
Advertisements

Review: Search problem formulation
Informed Search Algorithms
Notes Dijstra’s Algorithm Corrected syllabus.
Informed search algorithms
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*
EIE426-AICV 1 Blind and Informed Search Methods Filename: eie426-search-methods-0809.ppt.
Search Strategies CPS4801. Uninformed Search Strategies Uninformed search strategies use only the information available in the problem definition Breadth-first.
Problem Solving by Searching
Informed search.
SE Last time: Problem-Solving Problem solving: Goal formulation Problem formulation (states, operators) Search for solution Problem formulation:
Review: Search problem formulation
Artificial Intelligence
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
CS 561, Session 6 1 Last time: Problem-Solving Problem solving: Goal formulation Problem formulation (states, operators) Search for solution Problem formulation:
Rutgers CS440, Fall 2003 Heuristic search Reading: AIMA 2 nd ed., Ch
Artificial Intelligence Problem solving by searching CSC 361 Prof. Mohamed Batouche Computer Science Department CCIS – King Saud University Riyadh, Saudi.
Dr.Abeer Mahmoud ARTIFICIAL INTELLIGENCE (CS 461D) Dr. Abeer Mahmoud Computer science Department Princess Nora University Faculty of Computer & Information.
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.
CHAPTER 4: INFORMED SEARCH & EXPLORATION Prepared by: Ece UYKUR.
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.
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.
Informed Search Include specific knowledge to efficiently conduct the search and find the solution.
For Friday Finish reading chapter 4 Homework: –Lisp handout 4.
For Monday Read chapter 4, section 1 No homework..
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)
Artificial Intelligence Problem solving by searching.
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.
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.
Introduction to Artificial Intelligence (G51IAI)
Chapter 3.5 and 3.6 Heuristic Search Continued. Review:Learning Objectives Heuristic search strategies –Best-first search –A* algorithm Heuristic functions.
G5AIAI Introduction to AI Graham Kendall Heuristic Searches.
Artificial Intelligence Lecture No. 8 Dr. Asad Ali Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
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.
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.
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)
Heuristic Search Introduction to Artificial Intelligence
Artificial Intelligence Problem solving by searching CSC 361
Discussion on Greedy Search and A*
Discussion on Greedy Search and A*
CS 4100 Artificial Intelligence
Informed search algorithms
Informed search algorithms
Artificial Intelligence
HW 1: Warmup Missionaries and Cannibals
HW 1: Warmup Missionaries and Cannibals
Artificial Intelligence
Informed Search.
Presentation transcript:

1 Kuliah 4 : Informed Search

2 Outline Best-First Search Greedy Search A* Search

3 Uninformed (Blind) Search Uninformed (blind) Searches are normally very inefficient. Adding domain knowledge can improve the search process.

4 A Start Goal Suppose we know that node A is very promising Why not expand it right away?

5 Informed (Heuristic) Search Explore the node that is most “likely” to be the nearest to a goal state. Informed search algorithms choose the next node to expand using an evaluation function that estimates the merit of expanding the node. To focus search, the evaluation function must incorporate some heuristic that estimates the cost of the path from a state to the closest goal state.

6 Best-First Search Idea: use an evaluation function f(n) for each node Estimate of desirability Expand most desirable unexpanded node Implementation: fringe is queue sorted by descreasing order of desirability Greedy search A* search

7 An Implementation of Best-First Search function BEST-FIRST-SEARCH (problem, eval-fn) returns a solution sequence, or failure queuing-fn = a function that sorts nodes by eval-fn return GENERAL-SEARCH (problem,queuing-fn)

8 Greedy Search Estimation function : h(n) = estimate of cost from n to goal (heuristic) For example : h SLD (n) = straight-line distance from n to Bucharest Greedy search expands first the node that appears to be closest to the goal, according to h(n). f(n) = h(n)

9 Romania with step costs in km

10 Greedy Best-First Search Example Queue: ((Arad 366))

11 Greedy Best-First Search Example Queue: ((Sibiu 253) (Timisoara 329) (Zerind 374)) Now expand Sibiu and add its successors to tree.

12 Greedy Best-First Search Example Queue: ((Fagaras 178) (Rimnicu 193) (Timisoara 329) (Arad 366) (Zerind 374) (Oradea 380)) Fagaras has the lowest h, so it is the next node to be expanded.

13 Greedy Best-First Search Example Queue: ((Bucharest 0) (Rimnicu 193) (Sibiu 253) (Timisoara 329) (Arad 366) (Zerind 374) (Oradea 380)) Goal generated! Path found is Arad  Sibiu  Fagaras  Bucharest

14 Example 1 : Road Map Imagine the problem of finding a route on a road map and that the NET below is the road map: D E G S A B C F

15 Example 1 : Road Map Define h(T) = the straight-line distance from T to G DE G S ABC F The estimate can be wrong!

16 Example 2 : 8-puzzle f1(T) = the number correctly placed tiles on the board: f1 =

17 Example 2 : 8-puzzle f2(T) = number or incorrectly placed tiles on board: gives (rough!) estimate of how far we are from goal f2 = Most often, ‘distance to goal’ heuristics are more useful !

18 Example 2 : 8-puzzle Manhattan Distance f3(T) = the sum of ( the horizontal + vertical distance that each tile is away from its final destination): gives a better estimate of distance from the goal node f3 = =

19 Properties of Greedy Search It is not complete. Can get stuck in loops. Complete if search space is finite and there are checks for repeated states. It is not optimal. Time complexity: O(b m ), where b is the branching factor and m is the max depth of the search space. Same worst-case time complexity as depth-first. Space complexity: O(b m ). Keeps all nodes in memory. Worse than O(bm) for depth- first. Actual performance of greedy search is a function of the accuracy of h.

20 What’s wrong with Greedy Search ? Arad Sibiu h = 253 Rimnicu h = 193 Pitesti h = 98 Bucharest h = 0 h = Fagaras looks better to greedy search than Rimnicu because it doesn’t take distance already covered into account! Path through Fagaras has cost 450. Path through Rimnicu has cost 418! Yet, greedy search chose the former.

21 A* Search Idea: Avoid expanding paths that are already expensive. Uses estimated total cost, f(n), of the cheapest solution path through node n, as a measure of the merit of node n. Thus, f(n) is the evaluation function for A*. f(n) = g(n) + h(n) where g(n) = path cost from start node to node n. h(n) = estimated cost of path from n to closest goal node. This must NEVER overestimate the actual cost. [Note, if h(n) = 0 this is uniform-cost search.]

22 A* in action h = 366 g = 0 f=366 Sibiu h = 253 g = 140 f = 393 Timisoara h = 329 g = 118 f = 447 Zerind h = 374 g = 75 f = 449 Arad Queue: ((Sibiu 393) (Timisoara 447) (Zerind 449)) Queue: ((Arad 366)) Sibiu will be expanded next because it has the lowest f.

23 A* in action h = 366 g = 0 f=366 Sibiu h = 253 g = 140 f =393 Timisoara h = 329 g = 118 f = 447 Zerind h = 374 g = 75 f = 449 Arad h=366 g=380 f=646 Fagaras h = 178 g = 239 f = 417 Oradea h = 380 g = 146 f = 526 Rimnicu h = 193 g = 220 f = 413 Rimnicu will be expanded next. Example to be continued in class. Queue: ((Rimnicu 413) (Fagaras 417) (Timisoara 447) (Zerind 449) (Oradea 526) (Arad 646))

24 Properties of A* Search Complete ? Yes, unless infinitely many nodes with f  f(G) Time ?Exponential in [(relative error in h) x (length of solution)] Space ?Keeps all nodes in memory Optimal ? Yes – cannot expand f i+1 until f i is finished

25 8-Puzzle Ngoal h 1 (N) = number of misplaced tiles = 6 is admissible h 2 (N) = sum of distances of each tile to goal = 13 is admissible

26 8-Puzzle f(N) = h(N) = number of misplaced tiles Goal

27 8-Puzzle f(N) = g(N) + h(N) with h(N) = number of misplaced tiles

28 D E G S A B C F Exercise From S to G with : Uniform Cost Search Greedy Search A* Search DE G S ABC F Straight line distance

29 Answer : Search Tree S AD BDEA CEEBBF DFBFCEACG GCGF G

30 Uniform Cost SearchSA D B D A E E BBF B FC E A C G G G FC C E D F G At each step, select the node with the lowest accumulated cost. S-D-E-F-G

31 Greedy Search A A D E S BF G S-D-E-F-G

32 AD = = 12.9 S S AD A E = = 12.9 X S AD A E B F = = 13.0 X S AD A E B F G = 13.0 STOP! X A* example: road map Rute : S-D-E-F-G = 13