SlideShare a Scribd company logo
HEURISTIC SEARCH
TECHNIQUES
Dr.M.Karthika
Assistant Professor/ IT
MTNC,Madurai.
WHAT IS A HEURISTIC?
4/4/2023 2
WHAT IS A HEURISTIC SEARCH?
• A Heuristic is a technique to solve a problem faster than classic
methods, or to find an approximate solution when classic methods
cannot.
• A Heuristic (or a heuristic function) takes a look at search algorithms. At
each branching step, it evaluates the available information and makes a
decision on which branch to follow.
• It does so by ranking alternatives. The Heuristic is any device that is
often effective but will not guarantee work in every case.
• This is a kind of a shortcut as we often trade one of optimality,
completeness, accuracy, or precision for speed. 4/4/2023 3
4/4/2023 4
WHY DO WE NEED HEURISTICS?
• To produce a solution , in a reasonable amount of time. It
doesn’t have to be the best- an approximate solution will do
since this is fast enough.
• Reduce the polynomial number for most problems that are
exponential. And in situations where we can’t find known
algorithms.
• Heuristic Techniques may be weak methods because they
are vulnerable to combinatorial explosion. 4/4/2023 5
• Other names for these are Blind Search, Uninformed Search, and
Blind Control Strategy.
• These aren’t always possible since they demand much time or
memory.
• They search the entire state space for a solution and use an arbitrary
ordering of operations.
• Examples of these are Breadth First Search (BFS) and Depth First
Search (DFS).
DIRECT HEURISTIC SEARCH TECHNIQUES IN AI
4/4/2023 6
WEAK HEURISTIC SEARCH TECHNIQUES IN AI
• Other names for these are Informed Search, Heuristic Search, and
Heuristic Control Strategy.
• These are effective if applied correctly to the right types of tasks and
usually demand domain-specific information.
• Examples are Best First Search (BFS) and A*.
• Best-First Search
• A* Search
• Bidirectional Search
• Tabu Search
• Beam Search
• Simulated Annealing
• Hill Climbing
• Constraint Satisfaction Problems
4/4/2023 7
HEURISTIC ALGORITHMS
4/4/2023 8
HILL CLIMBING – ANOTHER EXAMPLE
• Problem: You have just arrived in Washington, D.C. You’re in your car, trying to get
downtown to the Washington Monument.
4/4/2023 9
FEATURES OF HILL CLIMBING IN AI
• Generate and Test variant: Hill Climbing is the variant of
Generate and Test method. The Generate and Test method
produce feedback which helps to decide which direction to
move in the search space.
• Greedy approach: Hill-climbing algorithm search moves in
the direction which optimizes the cost.
• No backtracking: It does not backtrack the search space, as it
does not remember the previous states.
4/4/2023 10
PROBLEMS WITH HILL CLIMBING IN AI
Three issues Addressed
• Local Maximum- All neighboring states have values worse than the current. The
greedy approach means we won’t be moving to a worse state. This terminates the
process even though there may have been a better solution. As a workaround, we
use backtracking.
• Plateau- All neighbors to it have the same value. This makes it impossible to choose
a direction. To avoid this, we randomly make a big jump.
• Ridge- At a ridge, movement in all possible directions is downward. This makes it
look like a peak and terminates the process. To avoid this, we may use two or more
rules before testing.
4/4/2023 11
STATE-SPACE DIAGRAM ANALYSIS
4/4/2023 12
GENERATE AND TEST SEARCH
• Is a heuristic search technique based on Depth First Search with Backtracking
which guarantees to find a solution if done systematically and there exists a
solution.
• In this technique, all the solutions are generated and tested for the best solution.
• It ensures that the best solution is checked against all possible generated solutions.
• It is also known as British Museum Search Algorithm as it’s like looking for an
exhibit at random or finding an object in the British Museum by wandering
randomly.
4/4/2023 13
GENERATE AND TEST SEARCH
Step:1 Generate a possible solution. For
example, generating a particular point in
the problem space or generating a path for
a start state.
Step:2Test to see if this is a actual solution
by comparing the chosen point or the
endpoint of the chosen path to the set of
acceptable goal states
Step:3 If a solution is found, quit.
Otherwise go to Step 1
4/4/2023 14
TYPES OF HILL CLIMBING IN AI
4/4/2023 15
SIMPLE HILL CLIMBING
• Examines one neighboring node at a time and selects the first one that optimizes the
current cost to be the next node.
• Algorithm:
1. Evaluate initial state- if goal state, stop and return success. Else, make initial state
current.
2. Loop until the solution reached or until no new operators left to apply to current
state:
a. Select new operator to apply to the current producing new state.
b. Evaluate new state:
• If a goal state, stop and return success.
• If better than the current state, make it current state, proceed.
• Even if not better than the current state, continue until the solution
reached.
3. Exit.
4/4/2023 16
FEATURES:
• Less time consuming
• Less optimal solution and the solution is not
guaranteed
4/4/2023 17
STEEPEST-ASCENT HILL CLIMBING:
• The steepest-Ascent algorithm is a variation of simple hill climbing algorithm. This
algorithm examines all the neighboring nodes of the current state and selects one
neighbor node which is closest to the goal state. This algorithm consumes more time
as it searches for multiple neighbors
4/4/2023 18
ALGORITHM FOR STEEPEST-ASCENT HILL
CLIMBING
• Step 1: Evaluate the initial state, if it is goal state then return success and stop, else
make current state as initial state.
• Step 2: Loop until a solution is found or the current state does not change.
• Let SUCC be a state such that any successor of the current state will be better than it.
• For each operator that applies to the current state:
• Apply the new operator and generate a new state.
• Evaluate the new state.
• If it is goal state, then return it and quit, else compare it to the SUCC.
• If it is better than SUCC, then set new state as SUCC.
• If the SUCC is better than the current state, then set current state to SUCC.
• Step 3: Exit.
4/4/2023 19
ANNEALING
• Annealing is a thermal process for obtaining low energy
states of a solid in a heat bath.
• The process contains two steps:
• Increase the temperature of the heat bath to a maximum value at
which the solid melts.
• Decrease carefully the temperature of the heat bath until the
particles arrange themselves in the ground state of the solid.
Ground state is a minimum energy state of the solid.
• The ground state of the solid is obtained only if the
maximum temperature is high enough and the cooling is
done slowly.
4/4/2023 20
SIMULATED ANNEALING
• Simulated annealing maintains a current assignment of values to variables.
• At each step, it picks a variable at random, then picks a value at random. If
assigning that value to the variable is an improvement or does not increase the
number of conflicts, the algorithm accepts the assignment and there is a new
current assignment.
• Otherwise, it accepts the assignment with some probability, depending on the
temperature and how much worse it is than the current assignment. If the change is
not accepted, the current assignment is unchanged.
4/4/2023 21
• To control how many worsening steps are accepted, there is a positive real-valued
temperature T.
• Suppose A is the current assignment of a value to each variable. Suppose that h(A) is
the evaluation of assignment A to be minimized.
• For solving constraints, h is typically the number of conflicts. Simulated annealing
selects a neighbor at random, which gives a new assignment A'. If h(A') ≤ h(A), it
accepts the assignment and A' becomes the new assignment. Otherwise, the
assignment is only accepted randomly with probability
• e(h(A)-h(A'))/T.
• Thus, if h(A') is close to h(A), the assignment is more likely to be accepted. If the
temperature is high, the exponent will be close to zero, and so the probability will be
close to 1. As the temperature approaches zero, the exponent approaches -∞, and the
probability approaches zero.
4/4/2023 22
BEST FIRST SEARCH
• OR Graphs
• The A* Algorithm
4/4/2023 23
OR GRAPHS
• BFS uses the concept of a Priority queue and heuristic search.
• To search the graph space, the BFS method uses two lists for tracking
the traversal.
• An ‘Open’ list that keeps track of the current ‘immediate’ nodes
available for traversal and a ‘CLOSED’ list that keeps track of the
nodes already traversed.
4/4/2023 24
BEST FIRST SEARCH ALGORITHM
• Create 2 empty lists: OPEN and CLOSED
• Start from the initial node (say N) and put it in the ‘ordered’ OPEN list
• Repeat the next steps until the GOAL node is reached
• If the OPEN list is empty, then EXIT the loop returning ‘False’
• Select the first/top node (say N) in the OPEN list and move it to the CLOSED list. Also,
capture the information of the parent node
• If N is a GOAL node, then move the node to the Closed list and exit the loop returning ‘True’.
The solution can be found by backtracking the path
• If N is not the GOAL node, expand node N to generate the ‘immediate’ next nodes linked to
node N and add all those to the OPEN list
• Reorder the nodes in the OPEN list in ascending order according to an evaluation function f(n)
4/4/2023 25
4/4/2023 26
ADVANTAGES AND DISADVANTAGES OF
BEST FIRST SEARCH
• Advantages:
1. Can switch between BFS and DFS, thus gaining the advantages of
both.
2. More efficient when compared to DFS.
• Disadvantages:
1. Chances of getting stuck in a loop are higher.
4/4/2023 27
A* SEARCH ALGORITHM
A* search is the most commonly known form of best-first search. It uses heuristic function h(n),
and cost to reach the node n from the start state g(n). It has combined features of UCS and
greedy best-first search, by which it solve the problem efficiently.
A* search algorithm finds the shortest path through the search space using the heuristic
function. This search algorithm expands less search tree and provides optimal result faster. A*
algorithm is similar to UCS except that it uses g(n)+h(n) instead of g(n).
In A* search algorithm, we use search heuristic as well as the cost to reach the node. Hence we
can combine both costs as following, and this sum is called as a fitness number.
Example
4/4/2023 28
ALGORITHM
Step1: Place the starting node in the OPEN list.
Step 2: Check if the OPEN list is empty or not, if the list is empty then return failure and
stops.
Step 3: Select the node from the OPEN list which has the smallest value of evaluation
function (g+h), if node n is goal node then return success and stop, otherwise
Step 4: Expand node n and generate all of its successors, and put n into the closed list.
For each successor n', check whether n' is already in the OPEN or CLOSED list, if not
then compute evaluation function for n' and place into Open list.
Step 5: Else if node n' is already in OPEN and CLOSED, then it should be attached to the
back pointer which reflects the lowest g(n') value.
Step 6: Return to Step 2.
4/4/2023 29
Advantages:
• A* search algorithm is the best algorithm than other search algorithms.
• A* search algorithm is optimal and complete.
• This algorithm can solve very complex problems.
Disadvantages:
• It does not always produce the shortest path as it mostly based on heuristics and
approximation.
• A* search algorithm has some complexity issues.
• The main drawback of A* is memory requirement as it keeps all generated nodes in the
memory, so it is not practical for various large-scale problems.
4/4/2023 30
THANK YOU
4/4/2023 31

More Related Content

What's hot

I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...
I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...
I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...
vikas dhakane
 
AI_Session 15 Alpha–Beta Pruning.pptx
AI_Session 15 Alpha–Beta Pruning.pptxAI_Session 15 Alpha–Beta Pruning.pptx
AI_Session 15 Alpha–Beta Pruning.pptx
Asst.prof M.Gokilavani
 
Problem Solving
Problem Solving Problem Solving
Problem Solving
Amar Jukuntla
 
Uninformed search /Blind search in AI
Uninformed search /Blind search in AIUninformed search /Blind search in AI
Uninformed search /Blind search in AI
Kirti Verma
 
Heuristic Search Techniques Unit -II.ppt
Heuristic Search Techniques Unit -II.pptHeuristic Search Techniques Unit -II.ppt
Heuristic Search Techniques Unit -II.ppt
karthikaparthasarath
 
I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...
I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...
I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...
vikas dhakane
 
I.BEST FIRST SEARCH IN AI
I.BEST FIRST SEARCH IN AII.BEST FIRST SEARCH IN AI
I.BEST FIRST SEARCH IN AI
vikas dhakane
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial Intelligence
Syed Zaid Irshad
 
Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}
FellowBuddy.com
 
Adversarial search
Adversarial searchAdversarial search
Adversarial searchNilu Desai
 
AI search techniques
AI search techniquesAI search techniques
AI search techniques
Omar Isaid
 
Hillclimbing search algorthim #introduction
Hillclimbing search algorthim #introductionHillclimbing search algorthim #introduction
Hillclimbing search algorthim #introduction
Mohamed Gad
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial Intelligence
Jay Nagar
 
Forward Backward Chaining
Forward Backward ChainingForward Backward Chaining
Forward Backward Chaining
QAU ISLAMABAD,PAKISTAN
 
I. Mini-Max Algorithm in AI
I. Mini-Max Algorithm in AII. Mini-Max Algorithm in AI
I. Mini-Max Algorithm in AI
vikas dhakane
 
hill climbing algorithm in artificial intelligence
hill climbing algorithm in artificial intelligencehill climbing algorithm in artificial intelligence
hill climbing algorithm in artificial intelligence
Rahul Gupta
 
Fuzzy logic
Fuzzy logicFuzzy logic
Fuzzy logic
Babu Appat
 
Knowledge Representation & Reasoning
Knowledge Representation & ReasoningKnowledge Representation & Reasoning
Knowledge Representation & ReasoningSajid Marwat
 

What's hot (20)

I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...
I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...
I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...
 
AI_Session 15 Alpha–Beta Pruning.pptx
AI_Session 15 Alpha–Beta Pruning.pptxAI_Session 15 Alpha–Beta Pruning.pptx
AI_Session 15 Alpha–Beta Pruning.pptx
 
Problem Solving
Problem Solving Problem Solving
Problem Solving
 
Uninformed search /Blind search in AI
Uninformed search /Blind search in AIUninformed search /Blind search in AI
Uninformed search /Blind search in AI
 
Heuristic Search Techniques Unit -II.ppt
Heuristic Search Techniques Unit -II.pptHeuristic Search Techniques Unit -II.ppt
Heuristic Search Techniques Unit -II.ppt
 
I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...
I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...
I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...
 
I.BEST FIRST SEARCH IN AI
I.BEST FIRST SEARCH IN AII.BEST FIRST SEARCH IN AI
I.BEST FIRST SEARCH IN AI
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial Intelligence
 
Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}
 
Adversarial search
Adversarial searchAdversarial search
Adversarial search
 
Ontology engineering
Ontology engineering Ontology engineering
Ontology engineering
 
AI search techniques
AI search techniquesAI search techniques
AI search techniques
 
Hillclimbing search algorthim #introduction
Hillclimbing search algorthim #introductionHillclimbing search algorthim #introduction
Hillclimbing search algorthim #introduction
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial Intelligence
 
Forward Backward Chaining
Forward Backward ChainingForward Backward Chaining
Forward Backward Chaining
 
I. Mini-Max Algorithm in AI
I. Mini-Max Algorithm in AII. Mini-Max Algorithm in AI
I. Mini-Max Algorithm in AI
 
Hill climbing
Hill climbingHill climbing
Hill climbing
 
hill climbing algorithm in artificial intelligence
hill climbing algorithm in artificial intelligencehill climbing algorithm in artificial intelligence
hill climbing algorithm in artificial intelligence
 
Fuzzy logic
Fuzzy logicFuzzy logic
Fuzzy logic
 
Knowledge Representation & Reasoning
Knowledge Representation & ReasoningKnowledge Representation & Reasoning
Knowledge Representation & Reasoning
 

Similar to Heuristic Search Techniques Unit -II.ppt

Informed Search Techniques new kirti L 8.pptx
Informed Search Techniques new kirti L 8.pptxInformed Search Techniques new kirti L 8.pptx
Informed Search Techniques new kirti L 8.pptx
Kirti Verma
 
Heuristc Search Techniques
Heuristc Search TechniquesHeuristc Search Techniques
Heuristc Search Techniques
Jismy .K.Jose
 
Artificial Intelligence_Anjali_Kumari_26900122059.pptx
Artificial Intelligence_Anjali_Kumari_26900122059.pptxArtificial Intelligence_Anjali_Kumari_26900122059.pptx
Artificial Intelligence_Anjali_Kumari_26900122059.pptx
CCBProduction
 
AI3391 Session 11 Hill climbing algorithm.pptx
AI3391 Session 11 Hill climbing algorithm.pptxAI3391 Session 11 Hill climbing algorithm.pptx
AI3391 Session 11 Hill climbing algorithm.pptx
Asst.prof M.Gokilavani
 
AI_Session 9 Hill climbing algorithm.pptx
AI_Session 9 Hill climbing algorithm.pptxAI_Session 9 Hill climbing algorithm.pptx
AI_Session 9 Hill climbing algorithm.pptx
Asst.prof M.Gokilavani
 
Artificial Intelligence - Hill climbing.
Artificial Intelligence - Hill climbing.Artificial Intelligence - Hill climbing.
Artificial Intelligence - Hill climbing.
StephenTec
 
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
 
HILL CLIMBING FOR ELECTRONICS AND COMMUNICATION ENG
HILL CLIMBING FOR ELECTRONICS AND COMMUNICATION ENGHILL CLIMBING FOR ELECTRONICS AND COMMUNICATION ENG
HILL CLIMBING FOR ELECTRONICS AND COMMUNICATION ENG
neelamsanjeevkumar
 
Heuristic search
Heuristic searchHeuristic search
Heuristic search
NivethaS35
 
Problem solving in Artificial Intelligence.pptx
Problem solving in Artificial Intelligence.pptxProblem solving in Artificial Intelligence.pptx
Problem solving in Artificial Intelligence.pptx
kitsenthilkumarcse
 
Ch19_Response_Surface_Methodology.pptx
Ch19_Response_Surface_Methodology.pptxCh19_Response_Surface_Methodology.pptx
Ch19_Response_Surface_Methodology.pptx
SriSusilawatiIslam
 
informed search.pptx
informed search.pptxinformed search.pptx
informed search.pptx
SoundariyaSathish
 
Heuristic search
Heuristic searchHeuristic search
Heuristic search
NivethaS35
 
Heuristic or informed search
Heuristic or informed searchHeuristic or informed search
Heuristic or informed search
HamzaJaved64
 
Hill climbing algorithm
Hill climbing algorithmHill climbing algorithm
Hill climbing algorithm
Dr. C.V. Suresh Babu
 
Hill climbing algorithm in artificial intelligence
Hill climbing algorithm in artificial intelligenceHill climbing algorithm in artificial intelligence
Hill climbing algorithm in artificial intelligence
sandeep54552
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial Intelligence
Rajamanickam Gomathijayam
 
chapter 3.pptx
chapter 3.pptxchapter 3.pptx
chapter 3.pptx
DejeneDay
 
05-constraint-satisfaction-problems-(us).ppt
05-constraint-satisfaction-problems-(us).ppt05-constraint-satisfaction-problems-(us).ppt
05-constraint-satisfaction-problems-(us).ppt
sky54012
 

Similar to Heuristic Search Techniques Unit -II.ppt (20)

Informed Search Techniques new kirti L 8.pptx
Informed Search Techniques new kirti L 8.pptxInformed Search Techniques new kirti L 8.pptx
Informed Search Techniques new kirti L 8.pptx
 
Heuristc Search Techniques
Heuristc Search TechniquesHeuristc Search Techniques
Heuristc Search Techniques
 
Artificial Intelligence_Anjali_Kumari_26900122059.pptx
Artificial Intelligence_Anjali_Kumari_26900122059.pptxArtificial Intelligence_Anjali_Kumari_26900122059.pptx
Artificial Intelligence_Anjali_Kumari_26900122059.pptx
 
AI3391 Session 11 Hill climbing algorithm.pptx
AI3391 Session 11 Hill climbing algorithm.pptxAI3391 Session 11 Hill climbing algorithm.pptx
AI3391 Session 11 Hill climbing algorithm.pptx
 
AI_Session 9 Hill climbing algorithm.pptx
AI_Session 9 Hill climbing algorithm.pptxAI_Session 9 Hill climbing algorithm.pptx
AI_Session 9 Hill climbing algorithm.pptx
 
Artificial Intelligence - Hill climbing.
Artificial Intelligence - Hill climbing.Artificial Intelligence - Hill climbing.
Artificial Intelligence - Hill climbing.
 
Heuristic Searching Algorithms Artificial Intelligence.pptx
Heuristic Searching Algorithms Artificial Intelligence.pptxHeuristic Searching Algorithms Artificial Intelligence.pptx
Heuristic Searching Algorithms Artificial Intelligence.pptx
 
HILL CLIMBING FOR ELECTRONICS AND COMMUNICATION ENG
HILL CLIMBING FOR ELECTRONICS AND COMMUNICATION ENGHILL CLIMBING FOR ELECTRONICS AND COMMUNICATION ENG
HILL CLIMBING FOR ELECTRONICS AND COMMUNICATION ENG
 
Heuristic search
Heuristic searchHeuristic search
Heuristic search
 
Problem solving in Artificial Intelligence.pptx
Problem solving in Artificial Intelligence.pptxProblem solving in Artificial Intelligence.pptx
Problem solving in Artificial Intelligence.pptx
 
Ch19_Response_Surface_Methodology.pptx
Ch19_Response_Surface_Methodology.pptxCh19_Response_Surface_Methodology.pptx
Ch19_Response_Surface_Methodology.pptx
 
informed search.pptx
informed search.pptxinformed search.pptx
informed search.pptx
 
Heuristic search
Heuristic searchHeuristic search
Heuristic search
 
Heuristic or informed search
Heuristic or informed searchHeuristic or informed search
Heuristic or informed search
 
Hill climbing algorithm
Hill climbing algorithmHill climbing algorithm
Hill climbing algorithm
 
AI Lesson 10
AI Lesson 10AI Lesson 10
AI Lesson 10
 
Hill climbing algorithm in artificial intelligence
Hill climbing algorithm in artificial intelligenceHill climbing algorithm in artificial intelligence
Hill climbing algorithm in artificial intelligence
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial Intelligence
 
chapter 3.pptx
chapter 3.pptxchapter 3.pptx
chapter 3.pptx
 
05-constraint-satisfaction-problems-(us).ppt
05-constraint-satisfaction-problems-(us).ppt05-constraint-satisfaction-problems-(us).ppt
05-constraint-satisfaction-problems-(us).ppt
 

More from karthikaparthasarath

BASIC COMPUTER ORGANIZATION unit 1.pptx
BASIC COMPUTER ORGANIZATION unit 1.pptxBASIC COMPUTER ORGANIZATION unit 1.pptx
BASIC COMPUTER ORGANIZATION unit 1.pptx
karthikaparthasarath
 
Fundamentals of Computers MCQS.docx
Fundamentals of Computers MCQS.docxFundamentals of Computers MCQS.docx
Fundamentals of Computers MCQS.docx
karthikaparthasarath
 
Software Engineering Question Bank.docx
Software Engineering Question Bank.docxSoftware Engineering Question Bank.docx
Software Engineering Question Bank.docx
karthikaparthasarath
 
BASIC COMPUTER ORGANIZATION unit 1.pptx
BASIC COMPUTER ORGANIZATION unit 1.pptxBASIC COMPUTER ORGANIZATION unit 1.pptx
BASIC COMPUTER ORGANIZATION unit 1.pptx
karthikaparthasarath
 
ATTACKER TECHNIQUES AND MOTIVATION.pptx
ATTACKER TECHNIQUES AND MOTIVATION.pptxATTACKER TECHNIQUES AND MOTIVATION.pptx
ATTACKER TECHNIQUES AND MOTIVATION.pptx
karthikaparthasarath
 
Unit - I cyber security fundamentals part -1.pptx
Unit - I cyber security fundamentals part -1.pptxUnit - I cyber security fundamentals part -1.pptx
Unit - I cyber security fundamentals part -1.pptx
karthikaparthasarath
 
BUilt in Functions and Simple programs in R.pdf
BUilt in Functions and Simple programs in R.pdfBUilt in Functions and Simple programs in R.pdf
BUilt in Functions and Simple programs in R.pdf
karthikaparthasarath
 
simple programs.docx
simple programs.docxsimple programs.docx
simple programs.docx
karthikaparthasarath
 
UNIT III Process Synchronization.docx
UNIT III Process Synchronization.docxUNIT III Process Synchronization.docx
UNIT III Process Synchronization.docx
karthikaparthasarath
 
Android Lab Mannual 18SUITSP5.docx
Android Lab Mannual 18SUITSP5.docxAndroid Lab Mannual 18SUITSP5.docx
Android Lab Mannual 18SUITSP5.docx
karthikaparthasarath
 
Activity playfair cipher.pptx
Activity playfair cipher.pptxActivity playfair cipher.pptx
Activity playfair cipher.pptx
karthikaparthasarath
 
Activity Hill Cipher.pptx
Activity  Hill Cipher.pptxActivity  Hill Cipher.pptx
Activity Hill Cipher.pptx
karthikaparthasarath
 
Activity Caesar Cipher.pptx
Activity Caesar Cipher.pptxActivity Caesar Cipher.pptx
Activity Caesar Cipher.pptx
karthikaparthasarath
 
Cyber Security Unit I Part -I.pptx
Cyber Security Unit I Part -I.pptxCyber Security Unit I Part -I.pptx
Cyber Security Unit I Part -I.pptx
karthikaparthasarath
 
Unit I Q&A.docx
Unit I Q&A.docxUnit I Q&A.docx
Unit I Q&A.docx
karthikaparthasarath
 
Unit 1 QB.docx
Unit 1 QB.docxUnit 1 QB.docx
Unit 1 QB.docx
karthikaparthasarath
 
cyber security.pptx
cyber security.pptxcyber security.pptx
cyber security.pptx
karthikaparthasarath
 
UNIT I - Part 1.pptx
UNIT I - Part 1.pptxUNIT I - Part 1.pptx
UNIT I - Part 1.pptx
karthikaparthasarath
 
UNIT II - CPU SCHEDULING.docx
UNIT II - CPU SCHEDULING.docxUNIT II - CPU SCHEDULING.docx
UNIT II - CPU SCHEDULING.docx
karthikaparthasarath
 

More from karthikaparthasarath (19)

BASIC COMPUTER ORGANIZATION unit 1.pptx
BASIC COMPUTER ORGANIZATION unit 1.pptxBASIC COMPUTER ORGANIZATION unit 1.pptx
BASIC COMPUTER ORGANIZATION unit 1.pptx
 
Fundamentals of Computers MCQS.docx
Fundamentals of Computers MCQS.docxFundamentals of Computers MCQS.docx
Fundamentals of Computers MCQS.docx
 
Software Engineering Question Bank.docx
Software Engineering Question Bank.docxSoftware Engineering Question Bank.docx
Software Engineering Question Bank.docx
 
BASIC COMPUTER ORGANIZATION unit 1.pptx
BASIC COMPUTER ORGANIZATION unit 1.pptxBASIC COMPUTER ORGANIZATION unit 1.pptx
BASIC COMPUTER ORGANIZATION unit 1.pptx
 
ATTACKER TECHNIQUES AND MOTIVATION.pptx
ATTACKER TECHNIQUES AND MOTIVATION.pptxATTACKER TECHNIQUES AND MOTIVATION.pptx
ATTACKER TECHNIQUES AND MOTIVATION.pptx
 
Unit - I cyber security fundamentals part -1.pptx
Unit - I cyber security fundamentals part -1.pptxUnit - I cyber security fundamentals part -1.pptx
Unit - I cyber security fundamentals part -1.pptx
 
BUilt in Functions and Simple programs in R.pdf
BUilt in Functions and Simple programs in R.pdfBUilt in Functions and Simple programs in R.pdf
BUilt in Functions and Simple programs in R.pdf
 
simple programs.docx
simple programs.docxsimple programs.docx
simple programs.docx
 
UNIT III Process Synchronization.docx
UNIT III Process Synchronization.docxUNIT III Process Synchronization.docx
UNIT III Process Synchronization.docx
 
Android Lab Mannual 18SUITSP5.docx
Android Lab Mannual 18SUITSP5.docxAndroid Lab Mannual 18SUITSP5.docx
Android Lab Mannual 18SUITSP5.docx
 
Activity playfair cipher.pptx
Activity playfair cipher.pptxActivity playfair cipher.pptx
Activity playfair cipher.pptx
 
Activity Hill Cipher.pptx
Activity  Hill Cipher.pptxActivity  Hill Cipher.pptx
Activity Hill Cipher.pptx
 
Activity Caesar Cipher.pptx
Activity Caesar Cipher.pptxActivity Caesar Cipher.pptx
Activity Caesar Cipher.pptx
 
Cyber Security Unit I Part -I.pptx
Cyber Security Unit I Part -I.pptxCyber Security Unit I Part -I.pptx
Cyber Security Unit I Part -I.pptx
 
Unit I Q&A.docx
Unit I Q&A.docxUnit I Q&A.docx
Unit I Q&A.docx
 
Unit 1 QB.docx
Unit 1 QB.docxUnit 1 QB.docx
Unit 1 QB.docx
 
cyber security.pptx
cyber security.pptxcyber security.pptx
cyber security.pptx
 
UNIT I - Part 1.pptx
UNIT I - Part 1.pptxUNIT I - Part 1.pptx
UNIT I - Part 1.pptx
 
UNIT II - CPU SCHEDULING.docx
UNIT II - CPU SCHEDULING.docxUNIT II - CPU SCHEDULING.docx
UNIT II - CPU SCHEDULING.docx
 

Recently uploaded

Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 

Recently uploaded (20)

Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 

Heuristic Search Techniques Unit -II.ppt

  • 2. WHAT IS A HEURISTIC? 4/4/2023 2
  • 3. WHAT IS A HEURISTIC SEARCH? • A Heuristic is a technique to solve a problem faster than classic methods, or to find an approximate solution when classic methods cannot. • A Heuristic (or a heuristic function) takes a look at search algorithms. At each branching step, it evaluates the available information and makes a decision on which branch to follow. • It does so by ranking alternatives. The Heuristic is any device that is often effective but will not guarantee work in every case. • This is a kind of a shortcut as we often trade one of optimality, completeness, accuracy, or precision for speed. 4/4/2023 3
  • 5. WHY DO WE NEED HEURISTICS? • To produce a solution , in a reasonable amount of time. It doesn’t have to be the best- an approximate solution will do since this is fast enough. • Reduce the polynomial number for most problems that are exponential. And in situations where we can’t find known algorithms. • Heuristic Techniques may be weak methods because they are vulnerable to combinatorial explosion. 4/4/2023 5
  • 6. • Other names for these are Blind Search, Uninformed Search, and Blind Control Strategy. • These aren’t always possible since they demand much time or memory. • They search the entire state space for a solution and use an arbitrary ordering of operations. • Examples of these are Breadth First Search (BFS) and Depth First Search (DFS). DIRECT HEURISTIC SEARCH TECHNIQUES IN AI 4/4/2023 6
  • 7. WEAK HEURISTIC SEARCH TECHNIQUES IN AI • Other names for these are Informed Search, Heuristic Search, and Heuristic Control Strategy. • These are effective if applied correctly to the right types of tasks and usually demand domain-specific information. • Examples are Best First Search (BFS) and A*. • Best-First Search • A* Search • Bidirectional Search • Tabu Search • Beam Search • Simulated Annealing • Hill Climbing • Constraint Satisfaction Problems 4/4/2023 7
  • 9. HILL CLIMBING – ANOTHER EXAMPLE • Problem: You have just arrived in Washington, D.C. You’re in your car, trying to get downtown to the Washington Monument. 4/4/2023 9
  • 10. FEATURES OF HILL CLIMBING IN AI • Generate and Test variant: Hill Climbing is the variant of Generate and Test method. The Generate and Test method produce feedback which helps to decide which direction to move in the search space. • Greedy approach: Hill-climbing algorithm search moves in the direction which optimizes the cost. • No backtracking: It does not backtrack the search space, as it does not remember the previous states. 4/4/2023 10
  • 11. PROBLEMS WITH HILL CLIMBING IN AI Three issues Addressed • Local Maximum- All neighboring states have values worse than the current. The greedy approach means we won’t be moving to a worse state. This terminates the process even though there may have been a better solution. As a workaround, we use backtracking. • Plateau- All neighbors to it have the same value. This makes it impossible to choose a direction. To avoid this, we randomly make a big jump. • Ridge- At a ridge, movement in all possible directions is downward. This makes it look like a peak and terminates the process. To avoid this, we may use two or more rules before testing. 4/4/2023 11
  • 13. GENERATE AND TEST SEARCH • Is a heuristic search technique based on Depth First Search with Backtracking which guarantees to find a solution if done systematically and there exists a solution. • In this technique, all the solutions are generated and tested for the best solution. • It ensures that the best solution is checked against all possible generated solutions. • It is also known as British Museum Search Algorithm as it’s like looking for an exhibit at random or finding an object in the British Museum by wandering randomly. 4/4/2023 13
  • 14. GENERATE AND TEST SEARCH Step:1 Generate a possible solution. For example, generating a particular point in the problem space or generating a path for a start state. Step:2Test to see if this is a actual solution by comparing the chosen point or the endpoint of the chosen path to the set of acceptable goal states Step:3 If a solution is found, quit. Otherwise go to Step 1 4/4/2023 14
  • 15. TYPES OF HILL CLIMBING IN AI 4/4/2023 15
  • 16. SIMPLE HILL CLIMBING • Examines one neighboring node at a time and selects the first one that optimizes the current cost to be the next node. • Algorithm: 1. Evaluate initial state- if goal state, stop and return success. Else, make initial state current. 2. Loop until the solution reached or until no new operators left to apply to current state: a. Select new operator to apply to the current producing new state. b. Evaluate new state: • If a goal state, stop and return success. • If better than the current state, make it current state, proceed. • Even if not better than the current state, continue until the solution reached. 3. Exit. 4/4/2023 16
  • 17. FEATURES: • Less time consuming • Less optimal solution and the solution is not guaranteed 4/4/2023 17
  • 18. STEEPEST-ASCENT HILL CLIMBING: • The steepest-Ascent algorithm is a variation of simple hill climbing algorithm. This algorithm examines all the neighboring nodes of the current state and selects one neighbor node which is closest to the goal state. This algorithm consumes more time as it searches for multiple neighbors 4/4/2023 18
  • 19. ALGORITHM FOR STEEPEST-ASCENT HILL CLIMBING • Step 1: Evaluate the initial state, if it is goal state then return success and stop, else make current state as initial state. • Step 2: Loop until a solution is found or the current state does not change. • Let SUCC be a state such that any successor of the current state will be better than it. • For each operator that applies to the current state: • Apply the new operator and generate a new state. • Evaluate the new state. • If it is goal state, then return it and quit, else compare it to the SUCC. • If it is better than SUCC, then set new state as SUCC. • If the SUCC is better than the current state, then set current state to SUCC. • Step 3: Exit. 4/4/2023 19
  • 20. ANNEALING • Annealing is a thermal process for obtaining low energy states of a solid in a heat bath. • The process contains two steps: • Increase the temperature of the heat bath to a maximum value at which the solid melts. • Decrease carefully the temperature of the heat bath until the particles arrange themselves in the ground state of the solid. Ground state is a minimum energy state of the solid. • The ground state of the solid is obtained only if the maximum temperature is high enough and the cooling is done slowly. 4/4/2023 20
  • 21. SIMULATED ANNEALING • Simulated annealing maintains a current assignment of values to variables. • At each step, it picks a variable at random, then picks a value at random. If assigning that value to the variable is an improvement or does not increase the number of conflicts, the algorithm accepts the assignment and there is a new current assignment. • Otherwise, it accepts the assignment with some probability, depending on the temperature and how much worse it is than the current assignment. If the change is not accepted, the current assignment is unchanged. 4/4/2023 21
  • 22. • To control how many worsening steps are accepted, there is a positive real-valued temperature T. • Suppose A is the current assignment of a value to each variable. Suppose that h(A) is the evaluation of assignment A to be minimized. • For solving constraints, h is typically the number of conflicts. Simulated annealing selects a neighbor at random, which gives a new assignment A'. If h(A') ≤ h(A), it accepts the assignment and A' becomes the new assignment. Otherwise, the assignment is only accepted randomly with probability • e(h(A)-h(A'))/T. • Thus, if h(A') is close to h(A), the assignment is more likely to be accepted. If the temperature is high, the exponent will be close to zero, and so the probability will be close to 1. As the temperature approaches zero, the exponent approaches -∞, and the probability approaches zero. 4/4/2023 22
  • 23. BEST FIRST SEARCH • OR Graphs • The A* Algorithm 4/4/2023 23
  • 24. OR GRAPHS • BFS uses the concept of a Priority queue and heuristic search. • To search the graph space, the BFS method uses two lists for tracking the traversal. • An ‘Open’ list that keeps track of the current ‘immediate’ nodes available for traversal and a ‘CLOSED’ list that keeps track of the nodes already traversed. 4/4/2023 24
  • 25. BEST FIRST SEARCH ALGORITHM • Create 2 empty lists: OPEN and CLOSED • Start from the initial node (say N) and put it in the ‘ordered’ OPEN list • Repeat the next steps until the GOAL node is reached • If the OPEN list is empty, then EXIT the loop returning ‘False’ • Select the first/top node (say N) in the OPEN list and move it to the CLOSED list. Also, capture the information of the parent node • If N is a GOAL node, then move the node to the Closed list and exit the loop returning ‘True’. The solution can be found by backtracking the path • If N is not the GOAL node, expand node N to generate the ‘immediate’ next nodes linked to node N and add all those to the OPEN list • Reorder the nodes in the OPEN list in ascending order according to an evaluation function f(n) 4/4/2023 25
  • 27. ADVANTAGES AND DISADVANTAGES OF BEST FIRST SEARCH • Advantages: 1. Can switch between BFS and DFS, thus gaining the advantages of both. 2. More efficient when compared to DFS. • Disadvantages: 1. Chances of getting stuck in a loop are higher. 4/4/2023 27
  • 28. A* SEARCH ALGORITHM A* search is the most commonly known form of best-first search. It uses heuristic function h(n), and cost to reach the node n from the start state g(n). It has combined features of UCS and greedy best-first search, by which it solve the problem efficiently. A* search algorithm finds the shortest path through the search space using the heuristic function. This search algorithm expands less search tree and provides optimal result faster. A* algorithm is similar to UCS except that it uses g(n)+h(n) instead of g(n). In A* search algorithm, we use search heuristic as well as the cost to reach the node. Hence we can combine both costs as following, and this sum is called as a fitness number. Example 4/4/2023 28
  • 29. ALGORITHM Step1: Place the starting node in the OPEN list. Step 2: Check if the OPEN list is empty or not, if the list is empty then return failure and stops. Step 3: Select the node from the OPEN list which has the smallest value of evaluation function (g+h), if node n is goal node then return success and stop, otherwise Step 4: Expand node n and generate all of its successors, and put n into the closed list. For each successor n', check whether n' is already in the OPEN or CLOSED list, if not then compute evaluation function for n' and place into Open list. Step 5: Else if node n' is already in OPEN and CLOSED, then it should be attached to the back pointer which reflects the lowest g(n') value. Step 6: Return to Step 2. 4/4/2023 29
  • 30. Advantages: • A* search algorithm is the best algorithm than other search algorithms. • A* search algorithm is optimal and complete. • This algorithm can solve very complex problems. Disadvantages: • It does not always produce the shortest path as it mostly based on heuristics and approximation. • A* search algorithm has some complexity issues. • The main drawback of A* is memory requirement as it keeps all generated nodes in the memory, so it is not practical for various large-scale problems. 4/4/2023 30