SlideShare a Scribd company logo
Heuristic Search
Chapter 9.
2
Outline
 Using Evaluation Functions
 A General Graph-Searching Algorithm
– Algorithm A*
– Iterative-Deepening A*
 Heuristic Functions and Search Efficiency
3
8-puzzle problem
– state description
 3-by-3 array: each cell contains one of 1-8 or blank symbol
– two state transition descriptions
 84 moves: one of 1-8 numbers moves up, down, right, or left
 4 moves: one black symbol moves up, down, right, or left
– The number of nodes in the state-space graph:
 9! ( = 362,880 )
57
461
382
567
48
321
4
9.1 Using Evaluation Functions
 Best-first search (BFS) = Heuristic search
– proceeds preferentially using heuristics
– Basic idea
 Heuristic evaluation function : based on information
specific to the problem domain
 Expand next that node, n, having the smallest value of
 Terminate when the node to be expanded next is a goal
node
 Eight-puzzle
– The number of tiles out of places: measure of the
goodness of a state description
fˆ
)(ˆ nf
goal)with(comapredplaceofouttilesofnumber)(ˆ nf
5
9.1 Using Evaluation Functions (2)
6
Using Evaluation Functions (3)
– Preference to early path: add “depth factor”  Figure 9.2
– : estimate of the depth of n
the length of the shortest path from the start to n
– : heuristic evaluation of node n
^ ^ ^
( ) ( ) ( )f n g n h n 
^
( )g n
^
( )h n
7 )(ˆ)(ˆ)(ˆngSearch UsiHeuristic9.2Figure nhngnf 
8
Using Evaluation Functions (4)
 Questions
– How to settle on evaluation functions for guiding BFS?
– What are some properties of BFS?
– Does BFS always result in finding good paths to a goal
node?
9
A General Graph-Searching Algorithm
 GRAPHSEARCH: general graph-searching algorithm
1. Create a search tree, Tr, with the start node n0  put n0 on
ordered list OPEN
2. Create empty list CLOSED
3. If OPEN is empty, exit with failure
4. Select the first node n on OPEN  remove it  put it on CLOSED
5. If n is a goal node, exit successfully: obtain solution by tracing a
path backward along the arcs from n to n0 in Tr
6. Expand n, generating a set M of successors + install M as
successors of n by creating arcs from n to each member of M
7. Reorder the list OPEN: by arbitrary scheme or heuristic merit
8. Go to step 3
10
A General Graph-Searching Algorithm
 Breadth-first search
– New nodes are put at the end of OPEN (FIFO)
– Nodes are not reordered
 Depth-first search
– New nodes are put at the beginning of OPEN (LIFO)
 Best-first (heuristic) search
– OPEN is reordered according to the heuristic merit of the
nodes
11
9.2.1 Algorithm A*
 Algorithm A*
– Reorders the nodes on OPEN according to increasing values of
 Some additional notation
– h(n): the actual cost of the minimal cost path between n and a goal
node
– g(n): the cost of a minimal cost path from n0 to n
– f(n) = g(n) + h(n): the cost of a minimal cost path from n0 to a goal
node over all paths via node n
– f(n0 ) = h(n0 ): the cost of a minimal cost path from n0 to a goal node
– : estimate of h(n)
– : the cost of the lowest-cost path found by A* so far to n
fˆ
)(ˆ nh
)(ˆ ng
n0 n G
12
9.2.1 Algorithm A* (2)
 Algorithm A*
– If = 0: uniform-cost search
– When the graph being searched is not a tree?
 more than one sequence of actions that can lead to the same
world state from the starting state
– In 8-puzzle problem
 Actions are reversible: implicit graph is not a tree
 Ignore loops in creating 8-puzzle search tree: don’t include the
parent of a node among its successors
 Step 6
– Expand n, generating a set M of successors that are not
already parents (ancestors) of n + install M as
successors of n by creating arcs from n to each
member of M
hˆ
13
Figure 9.3
Heuristic
Search
Notation
14
9.2.1 Algorithm A* (3)
 Modification of A* to prevent duplicate search effort
– G
 search graph generated by A*
 structure of nodes and arcs generated by A*
– Tr
 subgraph of G
 tree of best (minimal cost) paths
– Keep the search graph
 subsequent search may find shorter paths
 the paths use some of the arcs in the earlier search graph,
not in the earlier search tree
15
Figure 9.4 Search Graphs and Trees Produced by a Search Procedure
16
9.2.1 Algorithm A* (4)
 A* that maintains the search graph
1. Create a search graph, G, consisting solely of the start node,
n0  put n0 on a list OPEN
2. Create a list CLOSED: initially empty
3. If OPEN is empty, exit with failure
4. Select the first node on OPEN  remove it from OPEN 
put it on CLOSED: node n
5. If n is a goal node, exit successfully: obtain solution by
tracing a path along the pointers from n to n0 in G
6. Expand node n, generating the set, M, of its successors that
are not already ancestors of n in G install these members
of M as successors of n in G
17
9.2.1 Algorithm A* (5)
7. Establish a pointer to n from each of those members of M that
were not already in G  add these members of M to OPEN
 for each member, m, redirect its pointer to n if the best path
to m found so far is through n  for each member of M already
on CLOSED, redirect the pointers of each of its descendants in
G
8. Reorder the list OPEN in order of increasing values
9. Go to step 3
– Redirecting pointers of descendants of nodes
 Save subsequent search effort
fˆ
18
9.2.2 Admissibility
 Conditions that guarantee A* always finds minimal cost paths
– Each node in the graph has a finite number of successors
– All arcs in the graph have costs greater than some positive
amount 
– For all nodes in the search graph.
 Theorem 9.1
– Under the conditions on graphs and on , and
providing there is a path with finite cost from n0 to a
goal node, algorithm A* is guaranteed to terminate
with a minimal-cost path to a goal
)()(ˆ nhnh 
hˆ
19
9.2.2 Admissibility of A* (2)
 Lemma 9.1
– At every step before termination of A*, there is always a node, n*,
on OPEN with the following properties
 n* is on an optimal path to a goal
 A* has found an optimal path to n*

– Proof : by mathematical induction
 Base case
– at the beginning of search, n0 is on OPEN and on an optimal
path to the goal
– A* has found this path
–
– n0 : n* of the lemma at this stage
)(*)(ˆ
0nfnf 
)()(ˆ)(ˆbecause)()(ˆ
00000 nfnhnfnfnf 
20
9.2.2 Admissibility of A* (3)
 Induction step
– assume the conclusions of the lemma at the time m nodes have been expanded ( )
– prove the conclusions true at the time m+1 nodes have been expanded
0m
21
9.2.2 Admissibility of A* (4)
 Now prove relation
)()(_____)(
)()()(_____)(
)()(ˆ__)()(___)()(
___)(ˆ)(ˆ)(ˆ
0
*
0
****
******
***
nfnfbecausenf
nhngnfbecausenf
nhnhandngngbecausenhng
definitionbynhngnf




22
9.2.2 Admissibility of A* (5)
 Continuing the proof of the theorem
– A* must terminate
 If not, g(n) value will eventually exceed f(n0).
– A* terminates in an optimal path
 A* has found an optimal path to n* in Open set.
 Admissible
– Algorithm that is guaranteed to find an optimal path to the goal
– With the 3 conditions of the theorem, A* is admissible
– Any function not overestimating h is admissiblehˆ
23
9.2.2 Admissibility of A* (6)
 Theorem 9.2
– If is more informed than , then at the termination of their
searches on any graph having a path from n0 to a goal node,
every node expanded by is also expanded by
– expands at least as many nodes as does
– is more efficient
*
2A
*
2A
*
1A
*
1A
*
1A *
2A
*
2A
24
Relationships Among Search Algorithm
 Figure 9.6
– : uniform-cost search
–
breadth-first search
– uniform-cost/breadth-first search
admissible
0ˆ h
)(depth)(ˆ)(ˆ nngnf 
25
9.2.3 The Consistency Condition
 Consistency condition
– nj is a successor of ni
–
– : cost of the arc from ni to nj
– Rewriting
– A type of triangle inequality
),()(ˆ)(ˆ
jiji nncnhnh 
),( ji nnc
),()(ˆ)(ˆ
jiji nncnhnh  ),()(ˆ)(ˆ
jiij nncnhnh 
Figure 9.7
The Consistency Condition
26
9.2.3 The Consistency Condition (2)
– Implies that values of the nodes are monotonically
nondecreasing as we move away from the start node
– Consistency condition on is often called the monotone
condition on
– Theorem 9.3
 If the consistency condition on is satisfied, then when A*
expands a node n, it has already found an optimal path to n
fˆ
)(ˆ)(ˆ
ij nfnf 
),()(ˆ)(ˆ)(ˆ)(ˆ
),()(ˆ)(ˆ
jijijj
jiij
nncngnhngnh
nncnhnh


),()(ˆ)(ˆ jiij nncngng 
fˆ
hˆ
hˆ
27
9.2.3 The Consistency Condition (3)
 Argument for the admissibility of A* under the consistency condition
– Monotonicity of : search expands outward along contours of
increasing values
– The first goal node selected will be a goal node having a minimal
– For any goal node, ng,
– The first goal node selected will be one having minimal
– Whenever a goal node, ng, is selected for expansion, we have found an
optimal path to that goal node ( )
– The first goal node selected will be one for which the algorithm has
found an optimal path
fˆ
fˆ
fˆ
)(ˆ)(ˆ
gg ngnf 
gˆ
)()(ˆ gg ngng 
28
9.2.4 Iterative-Deepening A*
 Breadth-first search
– Exponentially growing memory requirements
 Iterative deepening search
– Memory grows linearly with the depth of the goal
– Parallel implementation of IDA*: further efficiencies gain
 IDA*
– Cost cut off in the first search:
– Depth-first search with backtracking
– If the search terminates at a goal node: minimal-cost path
– Otherwise
 increase the cut-off value and start another search
 The lowest values of the nodes visited (not expanded) in the
previous search is used as the new cut-off value in the next search
)(ˆ)(ˆ)(ˆ)(ˆ
0000 nhnhngnf 
fˆ
29
9.2.5 Recursive Best-First Search
 RBFS (recursive best-first search)
– uses slightly more memory than does IDA*
– generates fewer nodes than does IDA*
 Backing up value
– When a node n is expanded, computes values of
successors of n and recomputes values of n and all of
n’s ancestors
 Process of backing up
– Backed-up value, , of node m with successors
fˆ
fˆ
fˆ
)(ˆ mf im
)(ˆmin)(ˆ
i
m
mfmf
i

30
9.2.5 Recursive Best-First Search (2)
 Description
– One of successors of node n has the smallest over
all OPEN nodes, it is expanded in turn, and so on.
– When other OPEN node, n’, (not a successor of n) has the
lowest value of
 backtracks to the lowest common ancestor, node k
 kn: successor of node k on the path to n
 RBFS removes the subtree rooted at kn, from OPEN
 kn becomes an OPEN node with value (its backed-up
value)
 Search continues below that OPEN node with the lowest
value of
fˆ
fˆ
fˆ
fˆ
31
Figure 9.9 Recursive Best-First Search
32
9.3 Heuristic Functions & Search Efficiency
 Selection of heuristic function
– Crucial for the efficiency of A*
–
 assures admissibility
 Uniform-cost search  inefficient
– = the highest possible lower bound on h
 maintains admissibility
 expands the fewest nodes
 Using relaxed model
– functions are always admissible
0ˆ h
hˆ
hˆ
33
9.3 Heuristic Functions & Search Efficiency
 Selecting function
– must consider the amount of effort involved in calculating it
– Less relaxed model: better heuristic function (difficult in calculating)
– Trade off between the benefits gained by an accurate and the
cost of computing it
 Using instead of the lower bound of h
– increases efficiency at the expense of admissibility
– : easier to compute
 Modifying the relative weights of and in the evaluation function
– Large values of w: overemphasize the heuristic component
– Very small values of w: give the search a predominantly breadth-
first character
hˆ
hˆ
hˆ
hˆ
hˆgˆ
hwgf ˆˆˆ 
34
9.3 Heuristic Functions & Search Efficiency
 Simultaneous searches from both the start and a goal node
– Breadth-first search
 search frontiers meet between start and goal
 guaranteed to find an optimal path
– Heuristic search
 Two search frontiers might not meet to produce an optimal path
 Effective branching factor
– describes how sharply a search process is focused toward a goal
– B = the number of successors of each node in the tree having the
following properties
 Nonleaf node has the same number (B) of successors
 Leaf nodes are all of depth d
 Total number of nodes is N
N
B
BB
NBBB
d
d




)1(
)1(
...2
35 Figure 9.10 Bidirectional Searches
36 Figure 9.11 B Versus N for Various Values of d
37
9.3 Heuristic Functions & Search Efficiency
 3 important factors influencing the efficiency of algorithm A*
– The cost (or length) of the path found
– The number of nodes expanded in finding the path
– The computational cost required to compute
 Time complexity: O(n)
– Breadth-first search: O(Bd)
– Uniform-cost search ( ): O(BC/c)
 C: cost of an optimal solution
 c: cost of the least costly arc u
hˆ
0ˆ h

More Related Content

What's hot

Bellman ford algorithm
Bellman ford algorithmBellman ford algorithm
Bellman ford algorithm
MdSajjadulislamBappi
 
SPADE -
SPADE - SPADE -
SPADE -
Monica Dagadita
 
Kmeans
KmeansKmeans
Kmeans
Nikita Goyal
 
Random Forest Algorithm - Random Forest Explained | Random Forest In Machine ...
Random Forest Algorithm - Random Forest Explained | Random Forest In Machine ...Random Forest Algorithm - Random Forest Explained | Random Forest In Machine ...
Random Forest Algorithm - Random Forest Explained | Random Forest In Machine ...
Simplilearn
 
Backtracking-N Queens Problem-Graph Coloring-Hamiltonian cycle
Backtracking-N Queens Problem-Graph Coloring-Hamiltonian cycleBacktracking-N Queens Problem-Graph Coloring-Hamiltonian cycle
Backtracking-N Queens Problem-Graph Coloring-Hamiltonian cycle
varun arora
 
Bfs and dfs in data structure
Bfs and dfs in  data structure Bfs and dfs in  data structure
Bfs and dfs in data structure
Ankit Kumar Singh
 
Ch2 3-informed (heuristic) search
Ch2 3-informed (heuristic) searchCh2 3-informed (heuristic) search
Ch2 3-informed (heuristic) search
chandsek666
 
Decision trees
Decision treesDecision trees
Decision trees
Jagjit Wilku
 
Backtracking & branch and bound
Backtracking & branch and boundBacktracking & branch and bound
Backtracking & branch and bound
Vipul Chauhan
 
Astar algorithm
Astar algorithmAstar algorithm
Astar algorithm
Shuqing Zhang
 
Branch and bound
Branch and boundBranch and bound
Branch and bound
Acad
 
Data Mining:Concepts and Techniques, Chapter 8. Classification: Basic Concepts
Data Mining:Concepts and Techniques, Chapter 8. Classification: Basic ConceptsData Mining:Concepts and Techniques, Chapter 8. Classification: Basic Concepts
Data Mining:Concepts and Techniques, Chapter 8. Classification: Basic Concepts
Salah Amean
 
State Space Representation and Search
State Space Representation and SearchState Space Representation and Search
State Space Representation and Search
Hitesh Mohapatra
 
AI 6 | Adversarial Search
AI 6 | Adversarial SearchAI 6 | Adversarial Search
AI 6 | Adversarial Search
Mohammad Imam Hossain
 
Uniformed tree searching
Uniformed tree searching Uniformed tree searching
Uniformed tree searching
Ayaelshiwi
 
Lecture 14 Heuristic Search-A star algorithm
Lecture 14 Heuristic Search-A star algorithmLecture 14 Heuristic Search-A star algorithm
Lecture 14 Heuristic Search-A star algorithm
Hema Kashyap
 
Evaluation of Snort using Rules for DARPA 1999 Dataset
Evaluation of Snort using Rules for DARPA 1999 DatasetEvaluation of Snort using Rules for DARPA 1999 Dataset
Evaluation of Snort using Rules for DARPA 1999 Dataset
IJCSIS Research Publications
 
Bayesian Deep Learning
Bayesian Deep LearningBayesian Deep Learning
Bayesian Deep Learning
RayKim51
 
Bayes theorem and Naive Bayes algorithm
Bayes theorem and Naive Bayes algorithmBayes theorem and Naive Bayes algorithm
Bayes theorem and Naive Bayes algorithm
Luis Serrano
 
Backtracking
Backtracking  Backtracking
Backtracking
Vikas Sharma
 

What's hot (20)

Bellman ford algorithm
Bellman ford algorithmBellman ford algorithm
Bellman ford algorithm
 
SPADE -
SPADE - SPADE -
SPADE -
 
Kmeans
KmeansKmeans
Kmeans
 
Random Forest Algorithm - Random Forest Explained | Random Forest In Machine ...
Random Forest Algorithm - Random Forest Explained | Random Forest In Machine ...Random Forest Algorithm - Random Forest Explained | Random Forest In Machine ...
Random Forest Algorithm - Random Forest Explained | Random Forest In Machine ...
 
Backtracking-N Queens Problem-Graph Coloring-Hamiltonian cycle
Backtracking-N Queens Problem-Graph Coloring-Hamiltonian cycleBacktracking-N Queens Problem-Graph Coloring-Hamiltonian cycle
Backtracking-N Queens Problem-Graph Coloring-Hamiltonian cycle
 
Bfs and dfs in data structure
Bfs and dfs in  data structure Bfs and dfs in  data structure
Bfs and dfs in data structure
 
Ch2 3-informed (heuristic) search
Ch2 3-informed (heuristic) searchCh2 3-informed (heuristic) search
Ch2 3-informed (heuristic) search
 
Decision trees
Decision treesDecision trees
Decision trees
 
Backtracking & branch and bound
Backtracking & branch and boundBacktracking & branch and bound
Backtracking & branch and bound
 
Astar algorithm
Astar algorithmAstar algorithm
Astar algorithm
 
Branch and bound
Branch and boundBranch and bound
Branch and bound
 
Data Mining:Concepts and Techniques, Chapter 8. Classification: Basic Concepts
Data Mining:Concepts and Techniques, Chapter 8. Classification: Basic ConceptsData Mining:Concepts and Techniques, Chapter 8. Classification: Basic Concepts
Data Mining:Concepts and Techniques, Chapter 8. Classification: Basic Concepts
 
State Space Representation and Search
State Space Representation and SearchState Space Representation and Search
State Space Representation and Search
 
AI 6 | Adversarial Search
AI 6 | Adversarial SearchAI 6 | Adversarial Search
AI 6 | Adversarial Search
 
Uniformed tree searching
Uniformed tree searching Uniformed tree searching
Uniformed tree searching
 
Lecture 14 Heuristic Search-A star algorithm
Lecture 14 Heuristic Search-A star algorithmLecture 14 Heuristic Search-A star algorithm
Lecture 14 Heuristic Search-A star algorithm
 
Evaluation of Snort using Rules for DARPA 1999 Dataset
Evaluation of Snort using Rules for DARPA 1999 DatasetEvaluation of Snort using Rules for DARPA 1999 Dataset
Evaluation of Snort using Rules for DARPA 1999 Dataset
 
Bayesian Deep Learning
Bayesian Deep LearningBayesian Deep Learning
Bayesian Deep Learning
 
Bayes theorem and Naive Bayes algorithm
Bayes theorem and Naive Bayes algorithmBayes theorem and Naive Bayes algorithm
Bayes theorem and Naive Bayes algorithm
 
Backtracking
Backtracking  Backtracking
Backtracking
 

Viewers also liked

Hill climbing
Hill climbingHill climbing
Hill climbing
Mohammad Faizan
 
Solving problems by searching
Solving problems by searchingSolving problems by searching
Solving problems by searching
Luigi Ceccaroni
 
Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}
FellowBuddy.com
 
04 search heuristic
04 search heuristic04 search heuristic
04 search heuristic
Nour Zeineddine
 
Informed and Uninformed search Strategies
Informed and Uninformed search StrategiesInformed and Uninformed search Strategies
Informed and Uninformed search Strategies
Amey Kerkar
 
Chapter 2 (final)
Chapter 2 (final)Chapter 2 (final)
Chapter 2 (final)
Nateshwar Kamlesh
 
simple
simplesimple
simple
avy2cess
 
Solving problems by searching Informed (heuristics) Search
Solving problems by searching Informed (heuristics) SearchSolving problems by searching Informed (heuristics) Search
Solving problems by searching Informed (heuristics) Search
matele41
 
Heuristic Search
Heuristic SearchHeuristic Search
Heuristic Search
butest
 
Jarrar: Informed Search
Jarrar: Informed Search  Jarrar: Informed Search
Jarrar: Informed Search
Mustafa Jarrar
 
What is artificial intelligence
What is artificial intelligenceWhat is artificial intelligence
What is artificial intelligence
Shreya Chakraborty
 
AI search techniques
AI search techniquesAI search techniques
AI search techniques
Omar Isaid
 
Artificial Intelligence: Knowledge Engineering
Artificial Intelligence: Knowledge EngineeringArtificial Intelligence: Knowledge Engineering
Artificial Intelligence: Knowledge Engineering
The Integral Worm
 
Amit ppt
Amit pptAmit ppt
Amit ppt
amitp26
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
chandsek666
 
Artificial Intelligence -- Search Algorithms
Artificial Intelligence-- Search Algorithms Artificial Intelligence-- Search Algorithms
Artificial Intelligence -- Search Algorithms
Syed Ahmed
 
Introduction to Artificial Intelligence
Introduction to Artificial Intelligence Introduction to Artificial Intelligence
Introduction to Artificial Intelligence
Mustafa Jarrar
 
Search algorithms for discrete optimization
Search algorithms for discrete optimizationSearch algorithms for discrete optimization
Search algorithms for discrete optimization
Sally Salem
 
A Star Heuristic Search
A Star Heuristic SearchA Star Heuristic Search
A Star Heuristic Search
Muna Hamdi
 
Jarrar: Un-informed Search
Jarrar: Un-informed SearchJarrar: Un-informed Search
Jarrar: Un-informed Search
Mustafa Jarrar
 

Viewers also liked (20)

Hill climbing
Hill climbingHill climbing
Hill climbing
 
Solving problems by searching
Solving problems by searchingSolving problems by searching
Solving problems by searching
 
Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}
 
04 search heuristic
04 search heuristic04 search heuristic
04 search heuristic
 
Informed and Uninformed search Strategies
Informed and Uninformed search StrategiesInformed and Uninformed search Strategies
Informed and Uninformed search Strategies
 
Chapter 2 (final)
Chapter 2 (final)Chapter 2 (final)
Chapter 2 (final)
 
simple
simplesimple
simple
 
Solving problems by searching Informed (heuristics) Search
Solving problems by searching Informed (heuristics) SearchSolving problems by searching Informed (heuristics) Search
Solving problems by searching Informed (heuristics) Search
 
Heuristic Search
Heuristic SearchHeuristic Search
Heuristic Search
 
Jarrar: Informed Search
Jarrar: Informed Search  Jarrar: Informed Search
Jarrar: Informed Search
 
What is artificial intelligence
What is artificial intelligenceWhat is artificial intelligence
What is artificial intelligence
 
AI search techniques
AI search techniquesAI search techniques
AI search techniques
 
Artificial Intelligence: Knowledge Engineering
Artificial Intelligence: Knowledge EngineeringArtificial Intelligence: Knowledge Engineering
Artificial Intelligence: Knowledge Engineering
 
Amit ppt
Amit pptAmit ppt
Amit ppt
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
 
Artificial Intelligence -- Search Algorithms
Artificial Intelligence-- Search Algorithms Artificial Intelligence-- Search Algorithms
Artificial Intelligence -- Search Algorithms
 
Introduction to Artificial Intelligence
Introduction to Artificial Intelligence Introduction to Artificial Intelligence
Introduction to Artificial Intelligence
 
Search algorithms for discrete optimization
Search algorithms for discrete optimizationSearch algorithms for discrete optimization
Search algorithms for discrete optimization
 
A Star Heuristic Search
A Star Heuristic SearchA Star Heuristic Search
A Star Heuristic Search
 
Jarrar: Un-informed Search
Jarrar: Un-informed SearchJarrar: Un-informed Search
Jarrar: Un-informed Search
 

Similar to 09 heuristic search

A* Search Algorithm
A* Search AlgorithmA* Search Algorithm
A* Search Algorithm
vikas dhakane
 
Unit 3 Informed Search Strategies.pptx
Unit  3 Informed Search Strategies.pptxUnit  3 Informed Search Strategies.pptx
Unit 3 Informed Search Strategies.pptx
DrYogeshDeshmukh1
 
Heuristic Searching: A* Search
Heuristic Searching: A* SearchHeuristic Searching: A* Search
Heuristic Searching: A* Search
IOSR Journals
 
AI3391 ARTIFICIAL INTELLIGENCE UNIT II notes.pdf
AI3391 ARTIFICIAL INTELLIGENCE UNIT II notes.pdfAI3391 ARTIFICIAL INTELLIGENCE UNIT II notes.pdf
AI3391 ARTIFICIAL INTELLIGENCE UNIT II notes.pdf
Asst.prof M.Gokilavani
 
FADML 10 PPC Solving NP-Hard Problems.pdf
FADML 10 PPC Solving NP-Hard Problems.pdfFADML 10 PPC Solving NP-Hard Problems.pdf
FADML 10 PPC Solving NP-Hard Problems.pdf
Yelah1
 
A* algorithm
A* algorithmA* algorithm
A* algorithm
Komal Samdariya
 
CS3491-AI and ML lab manual cs3491 r2021
CS3491-AI and ML lab manual    cs3491 r2021CS3491-AI and ML lab manual    cs3491 r2021
CS3491-AI and ML lab manual cs3491 r2021
parvathy Mookambiga
 
Game Paper
Game PaperGame Paper
Game Paper
Siddharth Gupta
 
Straight Line Distance Heuristic
Straight Line Distance HeuristicStraight Line Distance Heuristic
Straight Line Distance Heuristic
ahmad bassiouny
 
Searchadditional2
Searchadditional2Searchadditional2
Searchadditional2
chandsek666
 
Jarrar.lecture notes.aai.2011s.ch4.informedsearch
Jarrar.lecture notes.aai.2011s.ch4.informedsearchJarrar.lecture notes.aai.2011s.ch4.informedsearch
Jarrar.lecture notes.aai.2011s.ch4.informedsearch
PalGov
 
informed_search.pdf
informed_search.pdfinformed_search.pdf
informed_search.pdf
SankarTerli
 
Searching Algorithm
Searching AlgorithmSearching Algorithm
Searching Algorithm
Sagacious IT Solution
 
Adsa u2 ver 1.0.
Adsa u2 ver 1.0.Adsa u2 ver 1.0.
Adsa u2 ver 1.0.
Dr. C.V. Suresh Babu
 
A star algorithms
A star algorithmsA star algorithms
A star algorithms
sandeep54552
 
A* and Min-Max Searching Algorithms in AI , DSA.pdf
A* and Min-Max Searching Algorithms in AI , DSA.pdfA* and Min-Max Searching Algorithms in AI , DSA.pdf
A* and Min-Max Searching Algorithms in AI , DSA.pdf
CS With Logic
 
Analysis of Pathfinding Algorithms
Analysis of Pathfinding AlgorithmsAnalysis of Pathfinding Algorithms
Analysis of Pathfinding Algorithms
SigSegVSquad
 
Heuristic Searching Algorithms Artificial Intelligence.pptx
Heuristic Searching Algorithms Artificial Intelligence.pptxHeuristic Searching Algorithms Artificial Intelligence.pptx
Heuristic Searching Algorithms Artificial Intelligence.pptx
Swagat Praharaj
 
Presentation - Bi-directional A-star search
Presentation - Bi-directional A-star searchPresentation - Bi-directional A-star search
Presentation - Bi-directional A-star search
Mohammad Saiful Islam
 
HEURISTIC SEARCH and other technique.pptx
HEURISTIC SEARCH and other technique.pptxHEURISTIC SEARCH and other technique.pptx
HEURISTIC SEARCH and other technique.pptx
rakeshkumar12020604
 

Similar to 09 heuristic search (20)

A* Search Algorithm
A* Search AlgorithmA* Search Algorithm
A* Search Algorithm
 
Unit 3 Informed Search Strategies.pptx
Unit  3 Informed Search Strategies.pptxUnit  3 Informed Search Strategies.pptx
Unit 3 Informed Search Strategies.pptx
 
Heuristic Searching: A* Search
Heuristic Searching: A* SearchHeuristic Searching: A* Search
Heuristic Searching: A* Search
 
AI3391 ARTIFICIAL INTELLIGENCE UNIT II notes.pdf
AI3391 ARTIFICIAL INTELLIGENCE UNIT II notes.pdfAI3391 ARTIFICIAL INTELLIGENCE UNIT II notes.pdf
AI3391 ARTIFICIAL INTELLIGENCE UNIT II notes.pdf
 
FADML 10 PPC Solving NP-Hard Problems.pdf
FADML 10 PPC Solving NP-Hard Problems.pdfFADML 10 PPC Solving NP-Hard Problems.pdf
FADML 10 PPC Solving NP-Hard Problems.pdf
 
A* algorithm
A* algorithmA* algorithm
A* algorithm
 
CS3491-AI and ML lab manual cs3491 r2021
CS3491-AI and ML lab manual    cs3491 r2021CS3491-AI and ML lab manual    cs3491 r2021
CS3491-AI and ML lab manual cs3491 r2021
 
Game Paper
Game PaperGame Paper
Game Paper
 
Straight Line Distance Heuristic
Straight Line Distance HeuristicStraight Line Distance Heuristic
Straight Line Distance Heuristic
 
Searchadditional2
Searchadditional2Searchadditional2
Searchadditional2
 
Jarrar.lecture notes.aai.2011s.ch4.informedsearch
Jarrar.lecture notes.aai.2011s.ch4.informedsearchJarrar.lecture notes.aai.2011s.ch4.informedsearch
Jarrar.lecture notes.aai.2011s.ch4.informedsearch
 
informed_search.pdf
informed_search.pdfinformed_search.pdf
informed_search.pdf
 
Searching Algorithm
Searching AlgorithmSearching Algorithm
Searching Algorithm
 
Adsa u2 ver 1.0.
Adsa u2 ver 1.0.Adsa u2 ver 1.0.
Adsa u2 ver 1.0.
 
A star algorithms
A star algorithmsA star algorithms
A star algorithms
 
A* and Min-Max Searching Algorithms in AI , DSA.pdf
A* and Min-Max Searching Algorithms in AI , DSA.pdfA* and Min-Max Searching Algorithms in AI , DSA.pdf
A* and Min-Max Searching Algorithms in AI , DSA.pdf
 
Analysis of Pathfinding Algorithms
Analysis of Pathfinding AlgorithmsAnalysis of Pathfinding Algorithms
Analysis of Pathfinding Algorithms
 
Heuristic Searching Algorithms Artificial Intelligence.pptx
Heuristic Searching Algorithms Artificial Intelligence.pptxHeuristic Searching Algorithms Artificial Intelligence.pptx
Heuristic Searching Algorithms Artificial Intelligence.pptx
 
Presentation - Bi-directional A-star search
Presentation - Bi-directional A-star searchPresentation - Bi-directional A-star search
Presentation - Bi-directional A-star search
 
HEURISTIC SEARCH and other technique.pptx
HEURISTIC SEARCH and other technique.pptxHEURISTIC SEARCH and other technique.pptx
HEURISTIC SEARCH and other technique.pptx
 

More from Tianlu Wang

L7 er2
L7 er2L7 er2
L7 er2
Tianlu Wang
 
L8 design1
L8 design1L8 design1
L8 design1
Tianlu Wang
 
L9 design2
L9 design2L9 design2
L9 design2
Tianlu Wang
 
14 pro resolution
14 pro resolution14 pro resolution
14 pro resolution
Tianlu Wang
 
13 propositional calculus
13 propositional calculus13 propositional calculus
13 propositional calculus
Tianlu Wang
 
12 adversal search
12 adversal search12 adversal search
12 adversal search
Tianlu Wang
 
11 alternative search
11 alternative search11 alternative search
11 alternative search
Tianlu Wang
 
10 2 sum
10 2 sum10 2 sum
10 2 sum
Tianlu Wang
 
22 planning
22 planning22 planning
22 planning
Tianlu Wang
 
21 situation calculus
21 situation calculus21 situation calculus
21 situation calculus
Tianlu Wang
 
20 bayes learning
20 bayes learning20 bayes learning
20 bayes learning
Tianlu Wang
 
19 uncertain evidence
19 uncertain evidence19 uncertain evidence
19 uncertain evidence
Tianlu Wang
 
18 common knowledge
18 common knowledge18 common knowledge
18 common knowledge
Tianlu Wang
 
17 2 expert systems
17 2 expert systems17 2 expert systems
17 2 expert systems
Tianlu Wang
 
17 1 knowledge-based system
17 1 knowledge-based system17 1 knowledge-based system
17 1 knowledge-based system
Tianlu Wang
 
16 2 predicate resolution
16 2 predicate resolution16 2 predicate resolution
16 2 predicate resolution
Tianlu Wang
 
16 1 predicate resolution
16 1 predicate resolution16 1 predicate resolution
16 1 predicate resolution
Tianlu Wang
 
15 predicate
15 predicate15 predicate
15 predicate
Tianlu Wang
 
08 uninformed search
08 uninformed search08 uninformed search
08 uninformed search
Tianlu Wang
 
07 plan agent
07 plan agent07 plan agent
07 plan agent
Tianlu Wang
 

More from Tianlu Wang (20)

L7 er2
L7 er2L7 er2
L7 er2
 
L8 design1
L8 design1L8 design1
L8 design1
 
L9 design2
L9 design2L9 design2
L9 design2
 
14 pro resolution
14 pro resolution14 pro resolution
14 pro resolution
 
13 propositional calculus
13 propositional calculus13 propositional calculus
13 propositional calculus
 
12 adversal search
12 adversal search12 adversal search
12 adversal search
 
11 alternative search
11 alternative search11 alternative search
11 alternative search
 
10 2 sum
10 2 sum10 2 sum
10 2 sum
 
22 planning
22 planning22 planning
22 planning
 
21 situation calculus
21 situation calculus21 situation calculus
21 situation calculus
 
20 bayes learning
20 bayes learning20 bayes learning
20 bayes learning
 
19 uncertain evidence
19 uncertain evidence19 uncertain evidence
19 uncertain evidence
 
18 common knowledge
18 common knowledge18 common knowledge
18 common knowledge
 
17 2 expert systems
17 2 expert systems17 2 expert systems
17 2 expert systems
 
17 1 knowledge-based system
17 1 knowledge-based system17 1 knowledge-based system
17 1 knowledge-based system
 
16 2 predicate resolution
16 2 predicate resolution16 2 predicate resolution
16 2 predicate resolution
 
16 1 predicate resolution
16 1 predicate resolution16 1 predicate resolution
16 1 predicate resolution
 
15 predicate
15 predicate15 predicate
15 predicate
 
08 uninformed search
08 uninformed search08 uninformed search
08 uninformed search
 
07 plan agent
07 plan agent07 plan agent
07 plan agent
 

Recently uploaded

一比一原版加拿大多伦多大学毕业证(uoft毕业证书)如何办理
一比一原版加拿大多伦多大学毕业证(uoft毕业证书)如何办理一比一原版加拿大多伦多大学毕业证(uoft毕业证书)如何办理
一比一原版加拿大多伦多大学毕业证(uoft毕业证书)如何办理
taqyea
 
FinalFinalSelf-PortraiturePowerPoint.pptx
FinalFinalSelf-PortraiturePowerPoint.pptxFinalFinalSelf-PortraiturePowerPoint.pptx
FinalFinalSelf-PortraiturePowerPoint.pptx
abbieharman
 
storyboard: Victor and Verlin discussing about top hat
storyboard: Victor and Verlin discussing about top hatstoryboard: Victor and Verlin discussing about top hat
storyboard: Victor and Verlin discussing about top hat
LyneSun
 
❼❷⓿❺❻❷❽❷❼❽ Dpboss Matka ! Fix Satta Matka ! Matka Result ! Matka Guessing ! ...
❼❷⓿❺❻❷❽❷❼❽  Dpboss Matka ! Fix Satta Matka ! Matka Result ! Matka Guessing ! ...❼❷⓿❺❻❷❽❷❼❽  Dpboss Matka ! Fix Satta Matka ! Matka Result ! Matka Guessing ! ...
❼❷⓿❺❻❷❽❷❼❽ Dpboss Matka ! Fix Satta Matka ! Matka Result ! Matka Guessing ! ...
❼❷⓿❺❻❷❽❷❼❽ Dpboss Kalyan Satta Matka Guessing Matka Result Main Bazar chart
 
This is a test powerpoint!!!!!!!!!!!!!!!
This is a test powerpoint!!!!!!!!!!!!!!!This is a test powerpoint!!!!!!!!!!!!!!!
This is a test powerpoint!!!!!!!!!!!!!!!
briannedpegg
 
哪里购买美国乔治城大学毕业证硕士学位证书原版一模一样
哪里购买美国乔治城大学毕业证硕士学位证书原版一模一样哪里购买美国乔治城大学毕业证硕士学位证书原版一模一样
哪里购买美国乔治城大学毕业证硕士学位证书原版一模一样
tc73868
 
Portfolio of my work as my passion and skills
Portfolio of my work as my passion and skillsPortfolio of my work as my passion and skills
Portfolio of my work as my passion and skills
waljorylypil626
 
Dino Ranch Storyboard / Kids TV Advertising
Dino Ranch Storyboard / Kids TV AdvertisingDino Ranch Storyboard / Kids TV Advertising
Dino Ranch Storyboard / Kids TV Advertising
Alessandro Occhipinti
 
➒➌➎➏➑➐➋➑➐➐ Dpboss Matka Guessing Satta Matka Kalyan panel Chart Indian Matka ...
➒➌➎➏➑➐➋➑➐➐ Dpboss Matka Guessing Satta Matka Kalyan panel Chart Indian Matka ...➒➌➎➏➑➐➋➑➐➐ Dpboss Matka Guessing Satta Matka Kalyan panel Chart Indian Matka ...
➒➌➎➏➑➐➋➑➐➐ Dpboss Matka Guessing Satta Matka Kalyan panel Chart Indian Matka ...
➒➌➎➏➑➐➋➑➐➐Dpboss Matka Guessing Satta Matka Kalyan Chart Indian Matka
 
❼❷⓿❺❻❷❽❷❼❽ Dpboss Kalyan Satta Matka Guessing Matka Result Main Bazar chart
❼❷⓿❺❻❷❽❷❼❽ Dpboss Kalyan Satta Matka Guessing Matka Result Main Bazar chart❼❷⓿❺❻❷❽❷❼❽ Dpboss Kalyan Satta Matka Guessing Matka Result Main Bazar chart
❼❷⓿❺❻❷❽❷❼❽ Dpboss Kalyan Satta Matka Guessing Matka Result Main Bazar chart
❼❷⓿❺❻❷❽❷❼❽ Dpboss Kalyan Satta Matka Guessing Matka Result Main Bazar chart
 
My storyboard for a sword fight scene with lightsabers
My storyboard for a sword fight scene with lightsabersMy storyboard for a sword fight scene with lightsabers
My storyboard for a sword fight scene with lightsabers
AlejandroGuarnGutirr
 
➒➌➎➏➑➐➋➑➐➐ Dpboss Satta Matka Matka Guessing Kalyan Chart Indian Matka Satta ...
➒➌➎➏➑➐➋➑➐➐ Dpboss Satta Matka Matka Guessing Kalyan Chart Indian Matka Satta ...➒➌➎➏➑➐➋➑➐➐ Dpboss Satta Matka Matka Guessing Kalyan Chart Indian Matka Satta ...
➒➌➎➏➑➐➋➑➐➐ Dpboss Satta Matka Matka Guessing Kalyan Chart Indian Matka Satta ...
➒➌➎➏➑➐➋➑➐➐Dpboss Matka Guessing Satta Matka Kalyan Chart Indian Matka
 
一比一原版美国亚利桑那大学毕业证(ua毕业证书)如何办理
一比一原版美国亚利桑那大学毕业证(ua毕业证书)如何办理一比一原版美国亚利桑那大学毕业证(ua毕业证书)如何办理
一比一原版美国亚利桑那大学毕业证(ua毕业证书)如何办理
homgo
 
Domino Express Storyboard - TV Adv Toys 30"
Domino Express Storyboard - TV Adv Toys 30"Domino Express Storyboard - TV Adv Toys 30"
Domino Express Storyboard - TV Adv Toys 30"
Alessandro Occhipinti
 
2024 MATFORCE Youth Poster Contest Winners
2024 MATFORCE Youth Poster Contest Winners2024 MATFORCE Youth Poster Contest Winners
2024 MATFORCE Youth Poster Contest Winners
matforce
 
Codes n Conventions Website Media studies.pptx
Codes n Conventions Website Media studies.pptxCodes n Conventions Website Media studies.pptx
Codes n Conventions Website Media studies.pptx
ZackSpencer3
 
一比一原版(BC毕业证)波士顿学院毕业证如何办理
一比一原版(BC毕业证)波士顿学院毕业证如何办理一比一原版(BC毕业证)波士顿学院毕业证如何办理
一比一原版(BC毕业证)波士顿学院毕业证如何办理
40fortunate
 
In Focus_ The Evolution of Boudoir Photography in NYC.pdf
In Focus_ The Evolution of Boudoir Photography in NYC.pdfIn Focus_ The Evolution of Boudoir Photography in NYC.pdf
In Focus_ The Evolution of Boudoir Photography in NYC.pdf
Boudoir Photography by Your Hollywood Portrait
 
Complete Lab 123456789123456789123456789
Complete Lab 123456789123456789123456789Complete Lab 123456789123456789123456789
Complete Lab 123456789123456789123456789
vickyvikas51556
 
All the images mentioned in 'See What You're Missing'
All the images mentioned in 'See What You're Missing'All the images mentioned in 'See What You're Missing'
All the images mentioned in 'See What You're Missing'
Dave Boyle
 

Recently uploaded (20)

一比一原版加拿大多伦多大学毕业证(uoft毕业证书)如何办理
一比一原版加拿大多伦多大学毕业证(uoft毕业证书)如何办理一比一原版加拿大多伦多大学毕业证(uoft毕业证书)如何办理
一比一原版加拿大多伦多大学毕业证(uoft毕业证书)如何办理
 
FinalFinalSelf-PortraiturePowerPoint.pptx
FinalFinalSelf-PortraiturePowerPoint.pptxFinalFinalSelf-PortraiturePowerPoint.pptx
FinalFinalSelf-PortraiturePowerPoint.pptx
 
storyboard: Victor and Verlin discussing about top hat
storyboard: Victor and Verlin discussing about top hatstoryboard: Victor and Verlin discussing about top hat
storyboard: Victor and Verlin discussing about top hat
 
❼❷⓿❺❻❷❽❷❼❽ Dpboss Matka ! Fix Satta Matka ! Matka Result ! Matka Guessing ! ...
❼❷⓿❺❻❷❽❷❼❽  Dpboss Matka ! Fix Satta Matka ! Matka Result ! Matka Guessing ! ...❼❷⓿❺❻❷❽❷❼❽  Dpboss Matka ! Fix Satta Matka ! Matka Result ! Matka Guessing ! ...
❼❷⓿❺❻❷❽❷❼❽ Dpboss Matka ! Fix Satta Matka ! Matka Result ! Matka Guessing ! ...
 
This is a test powerpoint!!!!!!!!!!!!!!!
This is a test powerpoint!!!!!!!!!!!!!!!This is a test powerpoint!!!!!!!!!!!!!!!
This is a test powerpoint!!!!!!!!!!!!!!!
 
哪里购买美国乔治城大学毕业证硕士学位证书原版一模一样
哪里购买美国乔治城大学毕业证硕士学位证书原版一模一样哪里购买美国乔治城大学毕业证硕士学位证书原版一模一样
哪里购买美国乔治城大学毕业证硕士学位证书原版一模一样
 
Portfolio of my work as my passion and skills
Portfolio of my work as my passion and skillsPortfolio of my work as my passion and skills
Portfolio of my work as my passion and skills
 
Dino Ranch Storyboard / Kids TV Advertising
Dino Ranch Storyboard / Kids TV AdvertisingDino Ranch Storyboard / Kids TV Advertising
Dino Ranch Storyboard / Kids TV Advertising
 
➒➌➎➏➑➐➋➑➐➐ Dpboss Matka Guessing Satta Matka Kalyan panel Chart Indian Matka ...
➒➌➎➏➑➐➋➑➐➐ Dpboss Matka Guessing Satta Matka Kalyan panel Chart Indian Matka ...➒➌➎➏➑➐➋➑➐➐ Dpboss Matka Guessing Satta Matka Kalyan panel Chart Indian Matka ...
➒➌➎➏➑➐➋➑➐➐ Dpboss Matka Guessing Satta Matka Kalyan panel Chart Indian Matka ...
 
❼❷⓿❺❻❷❽❷❼❽ Dpboss Kalyan Satta Matka Guessing Matka Result Main Bazar chart
❼❷⓿❺❻❷❽❷❼❽ Dpboss Kalyan Satta Matka Guessing Matka Result Main Bazar chart❼❷⓿❺❻❷❽❷❼❽ Dpboss Kalyan Satta Matka Guessing Matka Result Main Bazar chart
❼❷⓿❺❻❷❽❷❼❽ Dpboss Kalyan Satta Matka Guessing Matka Result Main Bazar chart
 
My storyboard for a sword fight scene with lightsabers
My storyboard for a sword fight scene with lightsabersMy storyboard for a sword fight scene with lightsabers
My storyboard for a sword fight scene with lightsabers
 
➒➌➎➏➑➐➋➑➐➐ Dpboss Satta Matka Matka Guessing Kalyan Chart Indian Matka Satta ...
➒➌➎➏➑➐➋➑➐➐ Dpboss Satta Matka Matka Guessing Kalyan Chart Indian Matka Satta ...➒➌➎➏➑➐➋➑➐➐ Dpboss Satta Matka Matka Guessing Kalyan Chart Indian Matka Satta ...
➒➌➎➏➑➐➋➑➐➐ Dpboss Satta Matka Matka Guessing Kalyan Chart Indian Matka Satta ...
 
一比一原版美国亚利桑那大学毕业证(ua毕业证书)如何办理
一比一原版美国亚利桑那大学毕业证(ua毕业证书)如何办理一比一原版美国亚利桑那大学毕业证(ua毕业证书)如何办理
一比一原版美国亚利桑那大学毕业证(ua毕业证书)如何办理
 
Domino Express Storyboard - TV Adv Toys 30"
Domino Express Storyboard - TV Adv Toys 30"Domino Express Storyboard - TV Adv Toys 30"
Domino Express Storyboard - TV Adv Toys 30"
 
2024 MATFORCE Youth Poster Contest Winners
2024 MATFORCE Youth Poster Contest Winners2024 MATFORCE Youth Poster Contest Winners
2024 MATFORCE Youth Poster Contest Winners
 
Codes n Conventions Website Media studies.pptx
Codes n Conventions Website Media studies.pptxCodes n Conventions Website Media studies.pptx
Codes n Conventions Website Media studies.pptx
 
一比一原版(BC毕业证)波士顿学院毕业证如何办理
一比一原版(BC毕业证)波士顿学院毕业证如何办理一比一原版(BC毕业证)波士顿学院毕业证如何办理
一比一原版(BC毕业证)波士顿学院毕业证如何办理
 
In Focus_ The Evolution of Boudoir Photography in NYC.pdf
In Focus_ The Evolution of Boudoir Photography in NYC.pdfIn Focus_ The Evolution of Boudoir Photography in NYC.pdf
In Focus_ The Evolution of Boudoir Photography in NYC.pdf
 
Complete Lab 123456789123456789123456789
Complete Lab 123456789123456789123456789Complete Lab 123456789123456789123456789
Complete Lab 123456789123456789123456789
 
All the images mentioned in 'See What You're Missing'
All the images mentioned in 'See What You're Missing'All the images mentioned in 'See What You're Missing'
All the images mentioned in 'See What You're Missing'
 

09 heuristic search

  • 2. 2 Outline  Using Evaluation Functions  A General Graph-Searching Algorithm – Algorithm A* – Iterative-Deepening A*  Heuristic Functions and Search Efficiency
  • 3. 3 8-puzzle problem – state description  3-by-3 array: each cell contains one of 1-8 or blank symbol – two state transition descriptions  84 moves: one of 1-8 numbers moves up, down, right, or left  4 moves: one black symbol moves up, down, right, or left – The number of nodes in the state-space graph:  9! ( = 362,880 ) 57 461 382 567 48 321
  • 4. 4 9.1 Using Evaluation Functions  Best-first search (BFS) = Heuristic search – proceeds preferentially using heuristics – Basic idea  Heuristic evaluation function : based on information specific to the problem domain  Expand next that node, n, having the smallest value of  Terminate when the node to be expanded next is a goal node  Eight-puzzle – The number of tiles out of places: measure of the goodness of a state description fˆ )(ˆ nf goal)with(comapredplaceofouttilesofnumber)(ˆ nf
  • 5. 5 9.1 Using Evaluation Functions (2)
  • 6. 6 Using Evaluation Functions (3) – Preference to early path: add “depth factor”  Figure 9.2 – : estimate of the depth of n the length of the shortest path from the start to n – : heuristic evaluation of node n ^ ^ ^ ( ) ( ) ( )f n g n h n  ^ ( )g n ^ ( )h n
  • 8. 8 Using Evaluation Functions (4)  Questions – How to settle on evaluation functions for guiding BFS? – What are some properties of BFS? – Does BFS always result in finding good paths to a goal node?
  • 9. 9 A General Graph-Searching Algorithm  GRAPHSEARCH: general graph-searching algorithm 1. Create a search tree, Tr, with the start node n0  put n0 on ordered list OPEN 2. Create empty list CLOSED 3. If OPEN is empty, exit with failure 4. Select the first node n on OPEN  remove it  put it on CLOSED 5. If n is a goal node, exit successfully: obtain solution by tracing a path backward along the arcs from n to n0 in Tr 6. Expand n, generating a set M of successors + install M as successors of n by creating arcs from n to each member of M 7. Reorder the list OPEN: by arbitrary scheme or heuristic merit 8. Go to step 3
  • 10. 10 A General Graph-Searching Algorithm  Breadth-first search – New nodes are put at the end of OPEN (FIFO) – Nodes are not reordered  Depth-first search – New nodes are put at the beginning of OPEN (LIFO)  Best-first (heuristic) search – OPEN is reordered according to the heuristic merit of the nodes
  • 11. 11 9.2.1 Algorithm A*  Algorithm A* – Reorders the nodes on OPEN according to increasing values of  Some additional notation – h(n): the actual cost of the minimal cost path between n and a goal node – g(n): the cost of a minimal cost path from n0 to n – f(n) = g(n) + h(n): the cost of a minimal cost path from n0 to a goal node over all paths via node n – f(n0 ) = h(n0 ): the cost of a minimal cost path from n0 to a goal node – : estimate of h(n) – : the cost of the lowest-cost path found by A* so far to n fˆ )(ˆ nh )(ˆ ng n0 n G
  • 12. 12 9.2.1 Algorithm A* (2)  Algorithm A* – If = 0: uniform-cost search – When the graph being searched is not a tree?  more than one sequence of actions that can lead to the same world state from the starting state – In 8-puzzle problem  Actions are reversible: implicit graph is not a tree  Ignore loops in creating 8-puzzle search tree: don’t include the parent of a node among its successors  Step 6 – Expand n, generating a set M of successors that are not already parents (ancestors) of n + install M as successors of n by creating arcs from n to each member of M hˆ
  • 14. 14 9.2.1 Algorithm A* (3)  Modification of A* to prevent duplicate search effort – G  search graph generated by A*  structure of nodes and arcs generated by A* – Tr  subgraph of G  tree of best (minimal cost) paths – Keep the search graph  subsequent search may find shorter paths  the paths use some of the arcs in the earlier search graph, not in the earlier search tree
  • 15. 15 Figure 9.4 Search Graphs and Trees Produced by a Search Procedure
  • 16. 16 9.2.1 Algorithm A* (4)  A* that maintains the search graph 1. Create a search graph, G, consisting solely of the start node, n0  put n0 on a list OPEN 2. Create a list CLOSED: initially empty 3. If OPEN is empty, exit with failure 4. Select the first node on OPEN  remove it from OPEN  put it on CLOSED: node n 5. If n is a goal node, exit successfully: obtain solution by tracing a path along the pointers from n to n0 in G 6. Expand node n, generating the set, M, of its successors that are not already ancestors of n in G install these members of M as successors of n in G
  • 17. 17 9.2.1 Algorithm A* (5) 7. Establish a pointer to n from each of those members of M that were not already in G  add these members of M to OPEN  for each member, m, redirect its pointer to n if the best path to m found so far is through n  for each member of M already on CLOSED, redirect the pointers of each of its descendants in G 8. Reorder the list OPEN in order of increasing values 9. Go to step 3 – Redirecting pointers of descendants of nodes  Save subsequent search effort fˆ
  • 18. 18 9.2.2 Admissibility  Conditions that guarantee A* always finds minimal cost paths – Each node in the graph has a finite number of successors – All arcs in the graph have costs greater than some positive amount  – For all nodes in the search graph.  Theorem 9.1 – Under the conditions on graphs and on , and providing there is a path with finite cost from n0 to a goal node, algorithm A* is guaranteed to terminate with a minimal-cost path to a goal )()(ˆ nhnh  hˆ
  • 19. 19 9.2.2 Admissibility of A* (2)  Lemma 9.1 – At every step before termination of A*, there is always a node, n*, on OPEN with the following properties  n* is on an optimal path to a goal  A* has found an optimal path to n*  – Proof : by mathematical induction  Base case – at the beginning of search, n0 is on OPEN and on an optimal path to the goal – A* has found this path – – n0 : n* of the lemma at this stage )(*)(ˆ 0nfnf  )()(ˆ)(ˆbecause)()(ˆ 00000 nfnhnfnfnf 
  • 20. 20 9.2.2 Admissibility of A* (3)  Induction step – assume the conclusions of the lemma at the time m nodes have been expanded ( ) – prove the conclusions true at the time m+1 nodes have been expanded 0m
  • 21. 21 9.2.2 Admissibility of A* (4)  Now prove relation )()(_____)( )()()(_____)( )()(ˆ__)()(___)()( ___)(ˆ)(ˆ)(ˆ 0 * 0 **** ****** *** nfnfbecausenf nhngnfbecausenf nhnhandngngbecausenhng definitionbynhngnf    
  • 22. 22 9.2.2 Admissibility of A* (5)  Continuing the proof of the theorem – A* must terminate  If not, g(n) value will eventually exceed f(n0). – A* terminates in an optimal path  A* has found an optimal path to n* in Open set.  Admissible – Algorithm that is guaranteed to find an optimal path to the goal – With the 3 conditions of the theorem, A* is admissible – Any function not overestimating h is admissiblehˆ
  • 23. 23 9.2.2 Admissibility of A* (6)  Theorem 9.2 – If is more informed than , then at the termination of their searches on any graph having a path from n0 to a goal node, every node expanded by is also expanded by – expands at least as many nodes as does – is more efficient * 2A * 2A * 1A * 1A * 1A * 2A * 2A
  • 24. 24 Relationships Among Search Algorithm  Figure 9.6 – : uniform-cost search – breadth-first search – uniform-cost/breadth-first search admissible 0ˆ h )(depth)(ˆ)(ˆ nngnf 
  • 25. 25 9.2.3 The Consistency Condition  Consistency condition – nj is a successor of ni – – : cost of the arc from ni to nj – Rewriting – A type of triangle inequality ),()(ˆ)(ˆ jiji nncnhnh  ),( ji nnc ),()(ˆ)(ˆ jiji nncnhnh  ),()(ˆ)(ˆ jiij nncnhnh  Figure 9.7 The Consistency Condition
  • 26. 26 9.2.3 The Consistency Condition (2) – Implies that values of the nodes are monotonically nondecreasing as we move away from the start node – Consistency condition on is often called the monotone condition on – Theorem 9.3  If the consistency condition on is satisfied, then when A* expands a node n, it has already found an optimal path to n fˆ )(ˆ)(ˆ ij nfnf  ),()(ˆ)(ˆ)(ˆ)(ˆ ),()(ˆ)(ˆ jijijj jiij nncngnhngnh nncnhnh   ),()(ˆ)(ˆ jiij nncngng  fˆ hˆ hˆ
  • 27. 27 9.2.3 The Consistency Condition (3)  Argument for the admissibility of A* under the consistency condition – Monotonicity of : search expands outward along contours of increasing values – The first goal node selected will be a goal node having a minimal – For any goal node, ng, – The first goal node selected will be one having minimal – Whenever a goal node, ng, is selected for expansion, we have found an optimal path to that goal node ( ) – The first goal node selected will be one for which the algorithm has found an optimal path fˆ fˆ fˆ )(ˆ)(ˆ gg ngnf  gˆ )()(ˆ gg ngng 
  • 28. 28 9.2.4 Iterative-Deepening A*  Breadth-first search – Exponentially growing memory requirements  Iterative deepening search – Memory grows linearly with the depth of the goal – Parallel implementation of IDA*: further efficiencies gain  IDA* – Cost cut off in the first search: – Depth-first search with backtracking – If the search terminates at a goal node: minimal-cost path – Otherwise  increase the cut-off value and start another search  The lowest values of the nodes visited (not expanded) in the previous search is used as the new cut-off value in the next search )(ˆ)(ˆ)(ˆ)(ˆ 0000 nhnhngnf  fˆ
  • 29. 29 9.2.5 Recursive Best-First Search  RBFS (recursive best-first search) – uses slightly more memory than does IDA* – generates fewer nodes than does IDA*  Backing up value – When a node n is expanded, computes values of successors of n and recomputes values of n and all of n’s ancestors  Process of backing up – Backed-up value, , of node m with successors fˆ fˆ fˆ )(ˆ mf im )(ˆmin)(ˆ i m mfmf i 
  • 30. 30 9.2.5 Recursive Best-First Search (2)  Description – One of successors of node n has the smallest over all OPEN nodes, it is expanded in turn, and so on. – When other OPEN node, n’, (not a successor of n) has the lowest value of  backtracks to the lowest common ancestor, node k  kn: successor of node k on the path to n  RBFS removes the subtree rooted at kn, from OPEN  kn becomes an OPEN node with value (its backed-up value)  Search continues below that OPEN node with the lowest value of fˆ fˆ fˆ fˆ
  • 31. 31 Figure 9.9 Recursive Best-First Search
  • 32. 32 9.3 Heuristic Functions & Search Efficiency  Selection of heuristic function – Crucial for the efficiency of A* –  assures admissibility  Uniform-cost search  inefficient – = the highest possible lower bound on h  maintains admissibility  expands the fewest nodes  Using relaxed model – functions are always admissible 0ˆ h hˆ hˆ
  • 33. 33 9.3 Heuristic Functions & Search Efficiency  Selecting function – must consider the amount of effort involved in calculating it – Less relaxed model: better heuristic function (difficult in calculating) – Trade off between the benefits gained by an accurate and the cost of computing it  Using instead of the lower bound of h – increases efficiency at the expense of admissibility – : easier to compute  Modifying the relative weights of and in the evaluation function – Large values of w: overemphasize the heuristic component – Very small values of w: give the search a predominantly breadth- first character hˆ hˆ hˆ hˆ hˆgˆ hwgf ˆˆˆ 
  • 34. 34 9.3 Heuristic Functions & Search Efficiency  Simultaneous searches from both the start and a goal node – Breadth-first search  search frontiers meet between start and goal  guaranteed to find an optimal path – Heuristic search  Two search frontiers might not meet to produce an optimal path  Effective branching factor – describes how sharply a search process is focused toward a goal – B = the number of successors of each node in the tree having the following properties  Nonleaf node has the same number (B) of successors  Leaf nodes are all of depth d  Total number of nodes is N N B BB NBBB d d     )1( )1( ...2
  • 35. 35 Figure 9.10 Bidirectional Searches
  • 36. 36 Figure 9.11 B Versus N for Various Values of d
  • 37. 37 9.3 Heuristic Functions & Search Efficiency  3 important factors influencing the efficiency of algorithm A* – The cost (or length) of the path found – The number of nodes expanded in finding the path – The computational cost required to compute  Time complexity: O(n) – Breadth-first search: O(Bd) – Uniform-cost search ( ): O(BC/c)  C: cost of an optimal solution  c: cost of the least costly arc u hˆ 0ˆ h