SlideShare ist ein Scribd-Unternehmen logo
1 von 31
HEURISTIC SEARCH
TECHNIQUES
Dr.M.Karthika
Assistant Professor/ IT
MTNC,Madurai.
WHAT IS A HEURISTIC?
2/7/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. 2/7/2023 3
2/7/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. 2/7/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
2/7/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
2/7/2023 7
HEURISTIC ALGORITHMS
2/7/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.
2/7/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.
2/7/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.
2/7/2023 11
STATE-SPACE DIAGRAM ANALYSIS
2/7/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.
2/7/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
2/7/2023 14
TYPES OF HILL CLIMBING IN AI
2/7/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.
2/7/2023 16
FEATURES:
• Less time consuming
• Less optimal solution and the solution is not
guaranteed
2/7/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
2/7/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.
2/7/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.
2/7/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.
2/7/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.
2/7/2023 22
BEST FIRST SEARCH
• OR Graphs
• The A* Algorithm
2/7/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.
2/7/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)
2/7/2023 25
2/7/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.
2/7/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
2/7/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.
2/7/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.
2/7/2023 30
THANK YOU
2/7/2023 31

Weitere ähnliche Inhalte

Was ist angesagt?

Introduction Artificial Intelligence a modern approach by Russel and Norvig 1
Introduction Artificial Intelligence a modern approach by Russel and Norvig 1Introduction Artificial Intelligence a modern approach by Russel and Norvig 1
Introduction Artificial Intelligence a modern approach by Russel and Norvig 1Garry D. Lasaga
 
Heuristics Search Techniques in AI
Heuristics Search Techniques in AI Heuristics Search Techniques in AI
Heuristics Search Techniques in AI Bharat Bhushan
 
Production system in ai
Production system in aiProduction system in ai
Production system in aisabin kafle
 
Production System in AI
Production System in AIProduction System in AI
Production System in AIBharat Bhushan
 
Problem reduction AND OR GRAPH & AO* algorithm.ppt
Problem reduction AND OR GRAPH & AO* algorithm.pptProblem reduction AND OR GRAPH & AO* algorithm.ppt
Problem reduction AND OR GRAPH & AO* algorithm.pptarunsingh660
 
Artificial Intelligence Searching Techniques
Artificial Intelligence Searching TechniquesArtificial Intelligence Searching Techniques
Artificial Intelligence Searching TechniquesDr. C.V. Suresh Babu
 
Control Strategies in AI
Control Strategies in AI Control Strategies in AI
Control Strategies in AI Bharat Bhushan
 
Problem solving agents
Problem solving agentsProblem solving agents
Problem solving agentsMegha Sharma
 
AI_Session 10 Local search in continious space.pptx
AI_Session 10 Local search in continious space.pptxAI_Session 10 Local search in continious space.pptx
AI_Session 10 Local search in continious space.pptxAsst.prof M.Gokilavani
 
AI_Session 7 Greedy Best first search algorithm.pptx
AI_Session 7 Greedy Best first search algorithm.pptxAI_Session 7 Greedy Best first search algorithm.pptx
AI_Session 7 Greedy Best first search algorithm.pptxAsst.prof M.Gokilavani
 
Forward and Backward chaining in AI
Forward and Backward chaining in AIForward and Backward chaining in AI
Forward and Backward chaining in AIMegha Sharma
 
Issues in knowledge representation
Issues in knowledge representationIssues in knowledge representation
Issues in knowledge representationSravanthi Emani
 
I. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHMI. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHMvikas dhakane
 
Lecture 21 problem reduction search ao star search
Lecture 21 problem reduction search ao star searchLecture 21 problem reduction search ao star search
Lecture 21 problem reduction search ao star searchHema Kashyap
 

Was ist angesagt? (20)

Introduction Artificial Intelligence a modern approach by Russel and Norvig 1
Introduction Artificial Intelligence a modern approach by Russel and Norvig 1Introduction Artificial Intelligence a modern approach by Russel and Norvig 1
Introduction Artificial Intelligence a modern approach by Russel and Norvig 1
 
AI Lecture 3 (solving problems by searching)
AI Lecture 3 (solving problems by searching)AI Lecture 3 (solving problems by searching)
AI Lecture 3 (solving problems by searching)
 
Heuristics Search Techniques in AI
Heuristics Search Techniques in AI Heuristics Search Techniques in AI
Heuristics Search Techniques in AI
 
Production system in ai
Production system in aiProduction system in ai
Production system in ai
 
AI: Logic in AI
AI: Logic in AIAI: Logic in AI
AI: Logic in AI
 
Production System in AI
Production System in AIProduction System in AI
Production System in AI
 
Problem reduction AND OR GRAPH & AO* algorithm.ppt
Problem reduction AND OR GRAPH & AO* algorithm.pptProblem reduction AND OR GRAPH & AO* algorithm.ppt
Problem reduction AND OR GRAPH & AO* algorithm.ppt
 
Artificial Intelligence Searching Techniques
Artificial Intelligence Searching TechniquesArtificial Intelligence Searching Techniques
Artificial Intelligence Searching Techniques
 
Unit 1 chapter 1 Design and Analysis of Algorithms
Unit 1   chapter 1 Design and Analysis of AlgorithmsUnit 1   chapter 1 Design and Analysis of Algorithms
Unit 1 chapter 1 Design and Analysis of Algorithms
 
Control Strategies in AI
Control Strategies in AI Control Strategies in AI
Control Strategies in AI
 
Problem solving agents
Problem solving agentsProblem solving agents
Problem solving agents
 
AI_Session 10 Local search in continious space.pptx
AI_Session 10 Local search in continious space.pptxAI_Session 10 Local search in continious space.pptx
AI_Session 10 Local search in continious space.pptx
 
AI_Session 7 Greedy Best first search algorithm.pptx
AI_Session 7 Greedy Best first search algorithm.pptxAI_Session 7 Greedy Best first search algorithm.pptx
AI_Session 7 Greedy Best first search algorithm.pptx
 
Forward and Backward chaining in AI
Forward and Backward chaining in AIForward and Backward chaining in AI
Forward and Backward chaining in AI
 
Issues in knowledge representation
Issues in knowledge representationIssues in knowledge representation
Issues in knowledge representation
 
A* Search Algorithm
A* Search AlgorithmA* Search Algorithm
A* Search Algorithm
 
A* Algorithm
A* AlgorithmA* Algorithm
A* Algorithm
 
String matching algorithms
String matching algorithmsString matching algorithms
String matching algorithms
 
I. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHMI. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHM
 
Lecture 21 problem reduction search ao star search
Lecture 21 problem reduction search ao star searchLecture 21 problem reduction search ao star search
Lecture 21 problem reduction search ao star search
 

Ähnlich wie Heuristic Search Techniques Unit -II.ppt

Heuristic Search Techniques Unit -II.ppt
Heuristic Search Techniques Unit -II.pptHeuristic Search Techniques Unit -II.ppt
Heuristic Search Techniques Unit -II.pptkarthikaparthasarath
 
Heuristc Search Techniques
Heuristc Search TechniquesHeuristc Search Techniques
Heuristc Search TechniquesJismy .K.Jose
 
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.pptxKirti Verma
 
Artificial Intelligence_Anjali_Kumari_26900122059.pptx
Artificial Intelligence_Anjali_Kumari_26900122059.pptxArtificial Intelligence_Anjali_Kumari_26900122059.pptx
Artificial Intelligence_Anjali_Kumari_26900122059.pptxCCBProduction
 
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.pptxAsst.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.pptxAsst.prof M.Gokilavani
 
Heuristic search
Heuristic searchHeuristic search
Heuristic searchNivethaS35
 
Heuristic search
Heuristic searchHeuristic search
Heuristic searchNivethaS35
 
Heuristic or informed search
Heuristic or informed searchHeuristic or informed search
Heuristic or informed searchHamzaJaved64
 
Heuristic Searching Algorithms Artificial Intelligence.pptx
Heuristic Searching Algorithms Artificial Intelligence.pptxHeuristic Searching Algorithms Artificial Intelligence.pptx
Heuristic Searching Algorithms Artificial Intelligence.pptxSwagat Praharaj
 
Hill climbing algorithm in artificial intelligence
Hill climbing algorithm in artificial intelligenceHill climbing algorithm in artificial intelligence
Hill climbing algorithm in artificial intelligencesandeep54552
 
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 ENGneelamsanjeevkumar
 
Problem solving in Artificial Intelligence.pptx
Problem solving in Artificial Intelligence.pptxProblem solving in Artificial Intelligence.pptx
Problem solving in Artificial Intelligence.pptxkitsenthilkumarcse
 
Ch19_Response_Surface_Methodology.pptx
Ch19_Response_Surface_Methodology.pptxCh19_Response_Surface_Methodology.pptx
Ch19_Response_Surface_Methodology.pptxSriSusilawatiIslam
 
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.pdfAsst.prof M.Gokilavani
 

Ähnlich wie Heuristic Search Techniques Unit -II.ppt (20)

Heuristic Search Techniques Unit -II.ppt
Heuristic Search Techniques Unit -II.pptHeuristic Search Techniques Unit -II.ppt
Heuristic Search Techniques Unit -II.ppt
 
Heuristc Search Techniques
Heuristc Search TechniquesHeuristc Search Techniques
Heuristc Search Techniques
 
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
 
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
 
Heuristic search
Heuristic searchHeuristic search
Heuristic search
 
Heuristic search
Heuristic searchHeuristic search
Heuristic search
 
Heuristic or informed search
Heuristic or informed searchHeuristic or informed search
Heuristic or informed search
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial Intelligence
 
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 algorithm in artificial intelligence
Hill climbing algorithm in artificial intelligenceHill climbing algorithm in artificial intelligence
Hill climbing algorithm in artificial intelligence
 
informed search.pptx
informed search.pptxinformed search.pptx
informed search.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
 
AI Lesson 10
AI Lesson 10AI Lesson 10
AI Lesson 10
 
Problem solving in Artificial Intelligence.pptx
Problem solving in Artificial Intelligence.pptxProblem solving in Artificial Intelligence.pptx
Problem solving in Artificial Intelligence.pptx
 
Lec 6 bsc csit
Lec 6 bsc csitLec 6 bsc csit
Lec 6 bsc csit
 
Ch19_Response_Surface_Methodology.pptx
Ch19_Response_Surface_Methodology.pptxCh19_Response_Surface_Methodology.pptx
Ch19_Response_Surface_Methodology.pptx
 
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
 
unit-1-l3.ppt
unit-1-l3.pptunit-1-l3.ppt
unit-1-l3.ppt
 

Mehr von karthikaparthasarath

BASIC COMPUTER ORGANIZATION unit 1.pptx
BASIC COMPUTER ORGANIZATION unit 1.pptxBASIC COMPUTER ORGANIZATION unit 1.pptx
BASIC COMPUTER ORGANIZATION unit 1.pptxkarthikaparthasarath
 
Fundamentals of Computers MCQS.docx
Fundamentals of Computers MCQS.docxFundamentals of Computers MCQS.docx
Fundamentals of Computers MCQS.docxkarthikaparthasarath
 
Software Engineering Question Bank.docx
Software Engineering Question Bank.docxSoftware Engineering Question Bank.docx
Software Engineering Question Bank.docxkarthikaparthasarath
 
BASIC COMPUTER ORGANIZATION unit 1.pptx
BASIC COMPUTER ORGANIZATION unit 1.pptxBASIC COMPUTER ORGANIZATION unit 1.pptx
BASIC COMPUTER ORGANIZATION unit 1.pptxkarthikaparthasarath
 
ATTACKER TECHNIQUES AND MOTIVATION.pptx
ATTACKER TECHNIQUES AND MOTIVATION.pptxATTACKER TECHNIQUES AND MOTIVATION.pptx
ATTACKER TECHNIQUES AND MOTIVATION.pptxkarthikaparthasarath
 
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.pptxkarthikaparthasarath
 
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.pdfkarthikaparthasarath
 
UNIT III Process Synchronization.docx
UNIT III Process Synchronization.docxUNIT III Process Synchronization.docx
UNIT III Process Synchronization.docxkarthikaparthasarath
 
Android Lab Mannual 18SUITSP5.docx
Android Lab Mannual 18SUITSP5.docxAndroid Lab Mannual 18SUITSP5.docx
Android Lab Mannual 18SUITSP5.docxkarthikaparthasarath
 
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.pptxkarthikaparthasarath
 

Mehr von 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
 

Kürzlich hochgeladen

Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 

Kürzlich hochgeladen (20)

Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 

Heuristic Search Techniques Unit -II.ppt

  • 2. WHAT IS A HEURISTIC? 2/7/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. 2/7/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. 2/7/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 2/7/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 2/7/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. 2/7/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. 2/7/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. 2/7/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. 2/7/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 2/7/2023 14
  • 15. TYPES OF HILL CLIMBING IN AI 2/7/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. 2/7/2023 16
  • 17. FEATURES: • Less time consuming • Less optimal solution and the solution is not guaranteed 2/7/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 2/7/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. 2/7/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. 2/7/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. 2/7/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. 2/7/2023 22
  • 23. BEST FIRST SEARCH • OR Graphs • The A* Algorithm 2/7/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. 2/7/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) 2/7/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. 2/7/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 2/7/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. 2/7/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. 2/7/2023 30