Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
34 views
128 pages
Best First Search
Uploaded by
anshul.saini0803
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download
Save
Save Best First Search For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
34 views
128 pages
Best First Search
Uploaded by
anshul.saini0803
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save Best First Search For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 128
Search
Fullscreen
Chapter 3 Best First Search iBest First Search « So far, we have assumed that all the edges have the same cost, and that an optimal solution is a shortest path from the initial state to a goal state. » Let’s generalize the model to allow individual edges with arbitrary costs associated with them. » We'll use the following denotations: Jength - number of edges in the path cost - sum of the edge costs on the pathBest First Search Best First Search is an entire class of search algorithms, each of which employ a cost function. The cost function : froma NOdE to its COSt. Example: a sum of the edge costs from the root to the node. We assume that a lower cost node is a better node. The different best-first search algorithms differ primarily in their cost function.Best First Search Best-first search employs two lists of nodes: = Open list ¢ contains those nodes that have been generated but not yet expanded. » Closed list contains those nodes that have already been completely expandedBest First Search Initially, just the root node is included on the Open list, and the Closed list is empty. At each cycle of the algorithm, an Open node of lowest cost is expanded, moved to Closed, and its children are inserted back to Open. The Open list is maintained as a priority queue. The algorithm terminates when a goal node is chosen for expansion, or there are no more nodes remaining in Open list.Example of Best First Search » One example of Best First Search is breadth first search. = The cost here is a depth of the node below the root. » depth first search is not considered to be best- first-search, because it does not maintain Open and Closed lists, in order to run in linear space.Uniform Cost Search = Let g(n) be the sum of the edges costs from root to node n. If g(n) is our overall cost function, then the best first search becomes Uniform Cost Search, also known as_ Dijkstra’s_ single-source-shortest-path algorithm . «= Initially the root node is placed in Open with a cost of zero. At each step, the next node n to be expanded is an Open node whose cost g(n) is lowest among all Open nodes.Example of Uniform Cost Search » Assume an example tree with different edge costs, represented by numbers next to the edges. a @® Notations for this example: — generated node — expanded nodeExample of Uniform Cost Search 2 OsExample of Uniform Cost Search te) re rnExample of Uniform Cost Search “| ooExample of Uniform Cost Search (c) a , ) @ @ Closed list: (Sfelp & Ls e) Open list: Q alo wl | = |ta =Example of Uniform Cost Search 2 Closed list: (Sfelbla & Ls e) Oo ea [o} Open list:Example of Uniform Cost Search wed” 2 - @ @ © Closed list: (Sfelblalet Open list: g EES) [es]=nExample of Uniform Cost Search 2 ce) o : @ Ce) Closed list: falelbla Open list: aq aExample of Uniform Cost Search 2 @ 7m reat Closed list: (4 dleltiaf Open list:Uniform Cost Search » We consider Uniform Cost Search to be brute force search, because it doesn’t use a heuristic function. = Questions to ask: ¢ Whether Uniform cost always terminates? ¢ Whether it is guaranteed to find a goal state?Uniform Cost Search - Termination « The algorithm will find a goal node or report that there is no goal node under following conditions: @ the problem space is finite ¢ there must exist a path to a goal with finite length and finite cost there must not be any infinitely long paths of finite cost » Wewill assume that all the edges have a minimum non-zero edge cost e to a solve a problem of infinite chains of nodes with zero-cost edges. Then, UCS will eventually reach a goal of finite cost If one exists In the graph.Uniform Cost Search - Solution Quality = Theorem 3.1 : Jn a graph where all edges have a minimum positive cost, and in which a finite path exists to a goal node, uniform-cost search will return a lowest-cost path to a goal node. « Steps of proof ¢ show that if Open contains a node on an optimal path to a goal before a node expansion, then it must contain one after the node expansion ¢ show that if there is a path to a goal node, the algorithm will eventually find it ¢ show that the first time a goal node is chosen for expansion, the algorithm terminates and returns the path to that node as the solutionUniform Cost Search - Time Complexity » Inthe worst case every edge has the minimum edge e. ¢ cis the cost of optimal solution, so once all nodes of cost
%TSP
Gis the optimal solution.Admissible, Consistent and Monotonic Heuristics = Admissible: if we define h*(n) as the exact lowest cost from node nto a goal, a heuristic function h(n) is admissible if and only if Vn h(n) < h(n) = Consistent: this quality is similar to the triangle inequality of all metrics. If c(n,m) is the cost of a shortest path from node n to node m, then a heuristic function h(x) is consistent if ¥n,m h(n) < c(n,m) + h(m)Consistent heuristic h(n) < c(n,m) + h(m) {h(n)-h(m)|
c will be expanded. Some nodes n whose cost f(n) = c will be expanded. Thus, f(n) < c is a sufficient condition for A* to expand node n, and f(n) scis a necessary condition.2 . . * Time optimality of A = Theorem 3.3 : For a given consistent (admissible) heuristic function, every admissible algorithm must expand all nodes surely expanded by A*. » Intuition: If anode m with f(m)
bis also a constant ) Thus, the asymptotic time complexity of A* using a heuristic that has constant absolute error is linear in the solution depth.Constant Relative Error » A much more realistic assumption for measurements of heuristic functions, is constant relative error. We assume that the absolute error is a bounded percentage of the quantity being estimated. h(n) =a. h*(n) Let's repeat the above analysis with the new heuristic model g(n)=x+y h*(n)=y+d-x h(n) =o (y +d- x) f(n) = g(n) + h(n) =x+y +a (y+d-x)
max (h(n)) , D(x) =1 A way to view D(x) is that it is the probability that a state is chosen randomly and uniformly from all states in the problem space has h(n)
h(parent) -1. @ the solid boxes represent “fertile” nodes which will be expanded. @ the dotted boxes represent “sterile” nodes that will not be expanded, because their total cost exceeds the optimal solution cost. @ the thick diagonal! line separates the fertile nodes from the sterile nodes. In this particular example, the maximum value of the heuristic is 4, and the depth of solution d is 8 moves. We chose 3 for the heuristic value of the initial state.Nodes Expanded as a Function of Depth » We will count the number of node expansions, which is the number of fertile nodes in the graph. The number of nodes generated is simply 6 times the number expanded. » There is a single state at depth 0. This root node generates b children, whose heuristic value range from 2 to 4, inclusive. Each of these nodes generate b nodes, whose heuristic value will range from 1 to 4, giving a total of b* nodes at depth 2. Since the goal is assumed to be at depth 8, in the worst case, all nodes n whose total cost f(n) = g(n) + h(n) < 8 will be expanded.Since 4 is a maximum heuristic value, all nodes down to depth 8 - 4 = 4 will be expanded, as in brute force search. Down to this depth, the number of nodes at depth d will be b%. Note that P(4) = 1, and hence b*P(4) = b*. » In general, down to depth d - m, where m is max heuristic value, all nodes are expanded.Nodes Expanded as a Function of Depth « The nodes expanded at depth 5 are fertile nodes, which are those with f(n) = g(n) + h(n) =5+h(n)<8 = h(n) <3. In equilibrium distribution, the fraction of nodes at depth 5 with h(n) < 3 is P(3). Since all nodes at depth 4 are expanded, the total number of nodes at depth 5 is b®°, and the number of fertile nodes at depth 5 is bSP(3). » While there are nodes at depth 6 with all possible heuristic values, their distribution in no longer equal to the equilibrium distribution. The number of nodes at depth 6 with h(n) < 2 is completely unaffected by this pruning and is the same as it would be in a brute force search at depth 6, or b®P(2).Nodes Expanded as a Function of Depth - Due to consistency of the heuristic function, all the possible parents of fertile nodes are themselves fertile. Thus, the number of nodes with each heuristic value to the left of the diagonal line is the same as it would be in a brute force search to the same depth. » If the heuristic were inconsistent, then the distribution of fertile nodes would change at every level where pruning occurred, making analysis much more complex. « Ingeneral, the number of fertile nodes at depth jis b’P(d - I) Q d >" b'P(d—i)The Heuristic Branching Factor » Heuristic branching factor = number of nodes generated in a search to depth d number of nodes generated in a search to depth d - 1 « The heuristic branching factor is the same as the brute-force branching factor b. » This analysis contradicts the abstract model: ¢ abstract model: the effect of the heuristic function is to reduce the heuristic branching factor and the overall complexity from O(b2) to O(a), a
You might also like
Ai Lect3 Search2
PDF
No ratings yet
Ai Lect3 Search2
135 pages
Search Problems
PDF
No ratings yet
Search Problems
50 pages
Unit 5 - Informed Search
PDF
No ratings yet
Unit 5 - Informed Search
48 pages
Informed Search
PDF
No ratings yet
Informed Search
75 pages
Ai Lect 03
PDF
No ratings yet
Ai Lect 03
46 pages
Set 3: Informed Heuristic Search: ICS 271 Fall 2014 Kalev Kask
PDF
No ratings yet
Set 3: Informed Heuristic Search: ICS 271 Fall 2014 Kalev Kask
78 pages
Informed Search Strategies: Artificial Intelligence
PDF
No ratings yet
Informed Search Strategies: Artificial Intelligence
72 pages
InformedSearch 6pp
PDF
No ratings yet
InformedSearch 6pp
7 pages
AI Coursebook - Ch3 - Informed Search
PDF
No ratings yet
AI Coursebook - Ch3 - Informed Search
32 pages
Lecture-3.1 Heuristic Search
PDF
No ratings yet
Lecture-3.1 Heuristic Search
131 pages
Heuristic
PDF
No ratings yet
Heuristic
44 pages
UNIT I Informed Search
PDF
No ratings yet
UNIT I Informed Search
76 pages
Week-5 - Informed Search Strategies
PDF
No ratings yet
Week-5 - Informed Search Strategies
66 pages
L4&5 - 2022
PDF
No ratings yet
L4&5 - 2022
45 pages
Lecture 3
PDF
No ratings yet
Lecture 3
67 pages
Lec04 Informed Search
PDF
No ratings yet
Lec04 Informed Search
59 pages
Lec03-Informed Search
PDF
No ratings yet
Lec03-Informed Search
56 pages
Chapter 3 - Part - 5
PDF
No ratings yet
Chapter 3 - Part - 5
55 pages
Lec05 Greedy Astar S
PDF
No ratings yet
Lec05 Greedy Astar S
57 pages
Admissible Search
PDF
No ratings yet
Admissible Search
49 pages
BIM309 AI Week5a
PDF
No ratings yet
BIM309 AI Week5a
41 pages
L04 Problem Solving As Search II
PDF
No ratings yet
L04 Problem Solving As Search II
41 pages
5-Heuristic Search Greedy Search-08!01!2025
PDF
No ratings yet
5-Heuristic Search Greedy Search-08!01!2025
58 pages
Chapter 4
PDF
No ratings yet
Chapter 4
75 pages
Ai 11
PDF
No ratings yet
Ai 11
15 pages
5 Heuristic Best First A Star
PDF
No ratings yet
5 Heuristic Best First A Star
39 pages
4 Informed Search
PDF
No ratings yet
4 Informed Search
84 pages
Module 3
PDF
No ratings yet
Module 3
33 pages
Informed Search
PDF
No ratings yet
Informed Search
65 pages
Informed Search
PDF
No ratings yet
Informed Search
49 pages
ITSC6121 Lecture 3 Informed Search A Search and Heuristics PPTX
PDF
No ratings yet
ITSC6121 Lecture 3 Informed Search A Search and Heuristics PPTX
61 pages
L04 Problem Solving As Search Informed
PDF
No ratings yet
L04 Problem Solving As Search Informed
49 pages
Lecture 3
PDF
No ratings yet
Lecture 3
35 pages
Informed (Heuristic) Search Strategies: Dept. of Computer Science Faculty of Science and Technology
PDF
No ratings yet
Informed (Heuristic) Search Strategies: Dept. of Computer Science Faculty of Science and Technology
19 pages
cs188 Fa23 Lec03
PDF
No ratings yet
cs188 Fa23 Lec03
60 pages
2024 Slide3 InformedSearch Eng
PDF
No ratings yet
2024 Slide3 InformedSearch Eng
67 pages
Chapter 3
PDF
No ratings yet
Chapter 3
39 pages
03 Heuristic Search
PDF
No ratings yet
03 Heuristic Search
67 pages
Lecture 3 - Informed Search
PDF
No ratings yet
Lecture 3 - Informed Search
75 pages
INFORMED - SEARCH Updated
PDF
No ratings yet
INFORMED - SEARCH Updated
87 pages
Last Time: Breadth-First Search Solution Depth-First Search Solution
PDF
No ratings yet
Last Time: Breadth-First Search Solution Depth-First Search Solution
86 pages
Uniform-Cost Search As A Special Case of A Search A Technical Deep Dive
PDF
No ratings yet
Uniform-Cost Search As A Special Case of A Search A Technical Deep Dive
3 pages
Lec03 - Informed Search
PDF
No ratings yet
Lec03 - Informed Search
69 pages
IA c03 NoAnim
PDF
No ratings yet
IA c03 NoAnim
38 pages
AI Lecture 04 (Informed Search)
PDF
No ratings yet
AI Lecture 04 (Informed Search)
31 pages
CS 331: Artificial Intelligence: Informed Search
PDF
No ratings yet
CS 331: Artificial Intelligence: Informed Search
64 pages
03 InformedHeuristicSearch
PDF
No ratings yet
03 InformedHeuristicSearch
80 pages
CS 188: Artificial Intelligence: Informed Search
PDF
No ratings yet
CS 188: Artificial Intelligence: Informed Search
69 pages
Slide 4
PDF
No ratings yet
Slide 4
82 pages
Informed Search: CS 4804 Fall 2020
PDF
No ratings yet
Informed Search: CS 4804 Fall 2020
27 pages
CS-IA - 2 Cour 2
PDF
No ratings yet
CS-IA - 2 Cour 2
35 pages
Advance AI Lec 2
PDF
No ratings yet
Advance AI Lec 2
75 pages
Informed Searches: Associate Professor Email
PDF
No ratings yet
Informed Searches: Associate Professor Email
40 pages
Ai 2
PDF
No ratings yet
Ai 2
32 pages
04 Informed Search
PDF
No ratings yet
04 Informed Search
6 pages
SP14 CS188 Lecture 3 - Informed Search
PDF
No ratings yet
SP14 CS188 Lecture 3 - Informed Search
64 pages
Ch2 3 Informed (Heuristic) Search1 - 0
PDF
No ratings yet
Ch2 3 Informed (Heuristic) Search1 - 0
82 pages
Module 3-Contents: Informed (Heuristic) Search Strategies
PDF
No ratings yet
Module 3-Contents: Informed (Heuristic) Search Strategies
209 pages
Bfs
PDF
No ratings yet
Bfs
10 pages
Unit 1
PDF
No ratings yet
Unit 1
11 pages
Unit-2 Branch and Bound Techniques
PDF
No ratings yet
Unit-2 Branch and Bound Techniques
7 pages
Unit-2 Part 1
PDF
No ratings yet
Unit-2 Part 1
4 pages
Unit-1 Part 2
PDF
No ratings yet
Unit-1 Part 2
8 pages