SlideShare a Scribd company logo
Informed Search
Hill Climbing
• Back – Tracking
• Use Enqued List
• Informed Search
• Very similar to DFS except instead of using
lexical order to break ties, it break ties
according to which node is closer to the goal.
• Hill Climbing: Front Sorted
Hill Climbing
• It starts with random (potentially poor)
solution, and iteratively makes small changes
to the solution, each time improving it a little.
When the algorithm cannot see any
improvement anymore, it terminates.
• Ideally, at that point the current solution is
close to optimal, but it is not guaranteed that
hill climbing will ever come close to the
optimal solution.
Hill Climbing
• Hill climbing can be applied to the travelling
salesman problem.
• It is easy to find a solution that visits all the
cities but will be very poor compared to the
optimal solution.
Hill Climbing
The hill climbing can be described as follows:
1. Start with current-state = initial state
2. Until current-state = goal-state OR there is no
change in current-state do:
– Get the successors of the current state and use the
evaluating function to assign a score to each
successor.
– If one of the successors has a better score than the
current-state then set the new current-state to be the
successor with the best score.
• Hill climbing terminates when there are no
successors of the current state which are better
than the current state itself.
Hill Climbing
• Hill climbing is depth-first search with a
heuristic measurement that orders choices as
nodes are expanded. It always selects the
most promising successor of the node last
expanded.
Hill Climbing
• For instance, consider that the most
promising successor of a node is the one
that has the shortest straight-line
distance to the goal node G.
• In figure below, the straight line
distances between each city and goal G
is indicated in square brackets, i.e. the
heuristic.
Hill Climbing
• Problems with Hill Climbing
– Gets stuck at local maxima when we reach a
position where there are no better neighbors, it is
not a guarantee that we have found the best
solution. Ridge is a sequence of local maxima.
– Another type of problem we may find with hill
climbing searches is finding a plateau. This is an
area where the search space is flat so that all
neighbors returns the same evaluation.
Hill Climbing
S
A
A
G
E
FB
88.5
8.5 6
6 3
D
The hill climbing search from S to G proceeds as
follows:
S
A
D
B
E
C
F
G
3
4 4
5 5
42
4
3
[8]
[8.5] [6]
[6] [3]
[3]
[10]
Hill Climbing
• Apply the hill climbing algorithm to find a path
from S to G, considering that the most promising
successor of a node is its closest neighbor.
S
A
D
B
E
C
F
G
3
4 4
5 5
42
4
3
Hill Climbing
•the best first search method selects for expansion the
most promising leaf node of the current search tree
•the hill climbing search method selects for expansion the most
promising successor of the node last expanded.
• In depth-first search: front of the queue (a stack).
• In breadth-first search: back of the queue.
• Now, in hill-climbing search, you sort[1] the current node's
children before adding them to the queue.
• In best-first search, you add the current node's children to
the queue in any order, then sort[1] the entire queue.
• [1]: sort according to some problem-specific evaluation of the
solution node, for example "distance from destination" in a
path-finding search
Hill Climbing
AI, Subash Chandra Pakhrin 12
S
G
D
E
B
A
C
5
4
4
6
3
5
7+
6
7+
S
A B
G
A C
D
7+ 6
5
7+
7+ 3
A and C are both equally far from goal, so now we are going to use
lexical order to break the tie
Beam Search
S
A B
B D
C G
A C
Beam width (w) = 2
Beam: Keep w Best
Annealing
• In metallurgy, annealing is the process used to
temper or harden metals and glass by heating
them to a high temperature and then
gradually cooling them, thus allowing material
to reach a low energy crystalline state.
• This can be applied to computer science
problems.
Simulated Annealing
• It is applied to solve problems like
– Travelling salesman problem
– Designing printed circuit boards
– Solving VLSI layout problems
– Factory scheduling
– Large-scale optimization task
– Planning of path for a robot
– Bioinformatics to design three dimension
structures of protein molecules.
Simulated Annealing
• A hill climbing algorithm that never makes “down
hill” moves towards states with lower value is
guaranteed to be incomplete, because it can get
stuck on a local maximum.
• In contrast, a purely random walk – that is,
moving to a successor chosen uniformly at
random from the set of successors- is complete
but extremely inefficient.
• Simulated Annealing = hill climbing + random
walk hence, it is efficient as well as completeness.
Simulated Annealing
• At the beginning you don’t care if you are
actually moving towards the good solution
and you accept bad moves as well, you accept
bad configurations as well but as you progress
towards the solution we become more careful
and we try to get closer to the solution by
selecting only the good moves.
Simulated Annealing
• Switch the perspective from hill climbing to gradient
descent.
• Imagine the task of getting a ping-pong ball into he
deepest crevice in a bumpy surface.
• If we just let the ball roll, it will get come to rest at a
local minimum.
• If we shake the surface, we can bounce the ball out of
local minimum.
• The trick is to shake just hard enough to bounce the
ball out of local minimum but not hard enough to
dislodge it from the global minimum.
• Simulated Annealing solution is to start by shaking hard
(i.e., at a high temperature) and then gradually reduce
the intensity of shaking (i.e., lower the temperature)
Simulated Annealing
• E = Energy of the system
• ΔE = Change in energy
• We need to have a mechanism to alter the
configuration
All possible configurations of a given system
E
n
e
r
g
y
C N
Move
Simulated Annealing
C = C init
for T = T max to T min
E c = E(C)
N = next (C)
EN = E(N)
ΔE = EN – EC
If (ΔE > 0)
C = N
else if (eΔE/T > rand (0, 1))
C = N
epoch
Simulated Annealing
• If the change in energy is negative, or in other
words if we are making bad move.
– In this case we compute probability
• If probability is very high then we accept the move
even if it is a bad move.
• If probability is very low then we have low probability
to accept the bad move.
• Probability depends upon two variables
change in energy ΔE and the temperature
factor T.
Simulated Annealing
• When temperature is very high then
probability for accepting bad move is very
high. In other words, at high temperature we
are exploring the solution space or we are
exploiting the configuration and we’re
accepting bad moves as well.
• When the temperature is low this probability
becomes very low and we have very low
probability to accept bad moves.
Simulated Annealing
• Case 1: T = 1000, ΔE = 10
ΔE/T = 0.01
eΔ E/T = 0.99004
A number that is close to one has a very high
(correlation) probability to become greater than a
random number between 0 and 1, which means
we get a very high probability, so when
temperature is very high we have high probability
to accept bad moves as well.
Simulated Annealing
ΔE influences probability
• ΔE is very high = a low probability to accept the
move
• ΔE is small = high probability to accept the move.
• We repeat the process for certain number of
times usually known as the number of epochs,
usually 100 to 200 times and for every value of
temperature we repeat the process and finally
expecting the solution to converge towards the
global minimum.
Simulated Annealing
• Now on either extremes are 2 other algorithms
1. Hill Climbing
2. Random Walk
• If we remove the probability factor or the
temperature factor and always accept the good
moves only then that’s hill climbing or it’s like a
greedy algorithm which always go towards a
better solution. Such, algorithms are prone to be
easily stuck in local minima.
Simulated Annealing
• Random walk: It doesn’t care about how good
a move we are making every time but we just
explore, continue to explore, the space. Such
algorithm never converge and will probably
never give you the best optimal solution.
Simulated Annealing
• Parameters T max to T min and number of epochs
are dependent on the problem that we are
solving, usually we start with high temperature
like few thousands, let’s say 5000 or 3000 and
then the minimum temperature is set to a small
value like 0 or 10 or something like that.
• Number of epoch is usually a hundred, or 200
depending on the problem
• If you run multiple times you will have an idea
whether you’re being stuck in the local minima or
global minimum

More Related Content

Similar to Lec 6 bsc csit

02LocalSearch.pdf
02LocalSearch.pdf02LocalSearch.pdf
02LocalSearch.pdf
vijaykumar95844
 
Artificial Intelligence_Anjali_Kumari_26900122059.pptx
Artificial Intelligence_Anjali_Kumari_26900122059.pptxArtificial Intelligence_Anjali_Kumari_26900122059.pptx
Artificial Intelligence_Anjali_Kumari_26900122059.pptx
CCBProduction
 
Chap 4 local_search
Chap 4 local_search Chap 4 local_search
Chap 4 local_search
Rakhi Gupta
 
Heuristic Search Techniques Unit -II.ppt
Heuristic Search Techniques Unit -II.pptHeuristic Search Techniques Unit -II.ppt
Heuristic Search Techniques Unit -II.ppt
karthikaparthasarath
 
BeyondClassicalSearch.ppt
BeyondClassicalSearch.pptBeyondClassicalSearch.ppt
BeyondClassicalSearch.ppt
GauravWani20
 
BeyondClassicalSearch.ppt
BeyondClassicalSearch.pptBeyondClassicalSearch.ppt
BeyondClassicalSearch.ppt
jpradha86
 
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
 
Optimization
OptimizationOptimization
Optimization
yesheeka
 
cs-171-05-LocalSearch.pptx
cs-171-05-LocalSearch.pptxcs-171-05-LocalSearch.pptx
cs-171-05-LocalSearch.pptx
VijayKumarLokanadam
 
Learning algorithm including gradient descent.pptx
Learning algorithm including gradient descent.pptxLearning algorithm including gradient descent.pptx
Learning algorithm including gradient descent.pptx
amrita chaturvedi
 
Heuristic or informed search
Heuristic or informed searchHeuristic or informed search
Heuristic or informed search
HamzaJaved64
 
Gradient descent method
Gradient descent methodGradient descent method
Gradient descent method
Sanghyuk Chun
 
Artificial Intelligence - Hill climbing.
Artificial Intelligence - Hill climbing.Artificial Intelligence - Hill climbing.
Artificial Intelligence - Hill climbing.
StephenTec
 
Hill climbing algorithm
Hill climbing algorithmHill climbing algorithm
Hill climbing algorithm
Dr. C.V. Suresh Babu
 
Informed search
Informed searchInformed search
Informed search
Amit Kumar Rathi
 
Secant method
Secant method Secant method
Secant method
Er. Rahul Jarariya
 
Simulated annealing presentation
Simulated annealing presentation Simulated annealing presentation
Simulated annealing presentation
AmarendraKrSaroj
 
4-Local search Artificial Intelligent Presentation
4-Local search Artificial Intelligent Presentation4-Local search Artificial Intelligent Presentation
4-Local search Artificial Intelligent Presentation
fokac40868
 
Simulated annealing-global optimization algorithm
Simulated annealing-global optimization algorithmSimulated annealing-global optimization algorithm
Simulated annealing-global optimization algorithmAkhil Prabhakar
 

Similar to Lec 6 bsc csit (20)

02LocalSearch.pdf
02LocalSearch.pdf02LocalSearch.pdf
02LocalSearch.pdf
 
Artificial Intelligence_Anjali_Kumari_26900122059.pptx
Artificial Intelligence_Anjali_Kumari_26900122059.pptxArtificial Intelligence_Anjali_Kumari_26900122059.pptx
Artificial Intelligence_Anjali_Kumari_26900122059.pptx
 
Chap 4 local_search
Chap 4 local_search Chap 4 local_search
Chap 4 local_search
 
Heuristic Search Techniques Unit -II.ppt
Heuristic Search Techniques Unit -II.pptHeuristic Search Techniques Unit -II.ppt
Heuristic Search Techniques Unit -II.ppt
 
BeyondClassicalSearch.ppt
BeyondClassicalSearch.pptBeyondClassicalSearch.ppt
BeyondClassicalSearch.ppt
 
BeyondClassicalSearch.ppt
BeyondClassicalSearch.pptBeyondClassicalSearch.ppt
BeyondClassicalSearch.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
 
Optimization
OptimizationOptimization
Optimization
 
cs-171-05-LocalSearch.pptx
cs-171-05-LocalSearch.pptxcs-171-05-LocalSearch.pptx
cs-171-05-LocalSearch.pptx
 
Hill climbing
Hill climbingHill climbing
Hill climbing
 
Learning algorithm including gradient descent.pptx
Learning algorithm including gradient descent.pptxLearning algorithm including gradient descent.pptx
Learning algorithm including gradient descent.pptx
 
Heuristic or informed search
Heuristic or informed searchHeuristic or informed search
Heuristic or informed search
 
Gradient descent method
Gradient descent methodGradient descent method
Gradient descent method
 
Artificial Intelligence - Hill climbing.
Artificial Intelligence - Hill climbing.Artificial Intelligence - Hill climbing.
Artificial Intelligence - Hill climbing.
 
Hill climbing algorithm
Hill climbing algorithmHill climbing algorithm
Hill climbing algorithm
 
Informed search
Informed searchInformed search
Informed search
 
Secant method
Secant method Secant method
Secant method
 
Simulated annealing presentation
Simulated annealing presentation Simulated annealing presentation
Simulated annealing presentation
 
4-Local search Artificial Intelligent Presentation
4-Local search Artificial Intelligent Presentation4-Local search Artificial Intelligent Presentation
4-Local search Artificial Intelligent Presentation
 
Simulated annealing-global optimization algorithm
Simulated annealing-global optimization algorithmSimulated annealing-global optimization algorithm
Simulated annealing-global optimization algorithm
 

More from Subash Chandra Pakhrin

Prismoid
PrismoidPrismoid
Torsion Angles, ASA Used for prediction of Non - Enzymatic PTM
Torsion Angles, ASA Used for prediction of Non - Enzymatic PTMTorsion Angles, ASA Used for prediction of Non - Enzymatic PTM
Torsion Angles, ASA Used for prediction of Non - Enzymatic PTM
Subash Chandra Pakhrin
 
COVID 19
COVID 19 COVID 19
Lstm covid 19 prediction
Lstm covid 19 predictionLstm covid 19 prediction
Lstm covid 19 prediction
Subash Chandra Pakhrin
 
Rnn & Lstm
Rnn & LstmRnn & Lstm
Characterization and identification of lysine succinylation sites based
Characterization and identification of lysine succinylation sites basedCharacterization and identification of lysine succinylation sites based
Characterization and identification of lysine succinylation sites based
Subash Chandra Pakhrin
 
Deep Learning or Convolutional Neural Network
Deep Learning or Convolutional Neural Network Deep Learning or Convolutional Neural Network
Deep Learning or Convolutional Neural Network
Subash Chandra Pakhrin
 
Ncit 1st ai lab
Ncit 1st ai labNcit 1st ai lab
Ncit 1st ai lab
Subash Chandra Pakhrin
 
Ai lab
Ai labAi lab
Constraint satisfaction problem
Constraint satisfaction problem Constraint satisfaction problem
Constraint satisfaction problem
Subash Chandra Pakhrin
 
Analysis
AnalysisAnalysis
Planning
PlanningPlanning
Intelligent agents (bsc csit) lec 2
Intelligent agents (bsc csit) lec 2Intelligent agents (bsc csit) lec 2
Intelligent agents (bsc csit) lec 2
Subash Chandra Pakhrin
 
Final slide4 (bsc csit) chapter 4
Final slide4 (bsc csit) chapter 4Final slide4 (bsc csit) chapter 4
Final slide4 (bsc csit) chapter 4
Subash Chandra Pakhrin
 
Final slide (bsc csit) chapter 5
Final slide (bsc csit) chapter 5Final slide (bsc csit) chapter 5
Final slide (bsc csit) chapter 5
Subash Chandra Pakhrin
 
Two player games
Two player gamesTwo player games
Two player games
Subash Chandra Pakhrin
 
Knnowledge representation and logic lec 11 to lec 15
Knnowledge representation and logic lec 11 to lec 15Knnowledge representation and logic lec 11 to lec 15
Knnowledge representation and logic lec 11 to lec 15
Subash Chandra Pakhrin
 
Final slide (bsc csit) chapter 2
Final slide (bsc csit) chapter 2Final slide (bsc csit) chapter 2
Final slide (bsc csit) chapter 2
Subash Chandra Pakhrin
 
Final slide (bsc csit) chapter 3
Final slide (bsc csit) chapter 3Final slide (bsc csit) chapter 3
Final slide (bsc csit) chapter 3
Subash Chandra Pakhrin
 

More from Subash Chandra Pakhrin (20)

Prismoid
PrismoidPrismoid
Prismoid
 
Torsion Angles, ASA Used for prediction of Non - Enzymatic PTM
Torsion Angles, ASA Used for prediction of Non - Enzymatic PTMTorsion Angles, ASA Used for prediction of Non - Enzymatic PTM
Torsion Angles, ASA Used for prediction of Non - Enzymatic PTM
 
COVID 19
COVID 19 COVID 19
COVID 19
 
Lstm covid 19 prediction
Lstm covid 19 predictionLstm covid 19 prediction
Lstm covid 19 prediction
 
Rnn & Lstm
Rnn & LstmRnn & Lstm
Rnn & Lstm
 
Characterization and identification of lysine succinylation sites based
Characterization and identification of lysine succinylation sites basedCharacterization and identification of lysine succinylation sites based
Characterization and identification of lysine succinylation sites based
 
Cnn april 8 2020
Cnn april 8 2020Cnn april 8 2020
Cnn april 8 2020
 
Deep Learning or Convolutional Neural Network
Deep Learning or Convolutional Neural Network Deep Learning or Convolutional Neural Network
Deep Learning or Convolutional Neural Network
 
Ncit 1st ai lab
Ncit 1st ai labNcit 1st ai lab
Ncit 1st ai lab
 
Ai lab
Ai labAi lab
Ai lab
 
Constraint satisfaction problem
Constraint satisfaction problem Constraint satisfaction problem
Constraint satisfaction problem
 
Analysis
AnalysisAnalysis
Analysis
 
Planning
PlanningPlanning
Planning
 
Intelligent agents (bsc csit) lec 2
Intelligent agents (bsc csit) lec 2Intelligent agents (bsc csit) lec 2
Intelligent agents (bsc csit) lec 2
 
Final slide4 (bsc csit) chapter 4
Final slide4 (bsc csit) chapter 4Final slide4 (bsc csit) chapter 4
Final slide4 (bsc csit) chapter 4
 
Final slide (bsc csit) chapter 5
Final slide (bsc csit) chapter 5Final slide (bsc csit) chapter 5
Final slide (bsc csit) chapter 5
 
Two player games
Two player gamesTwo player games
Two player games
 
Knnowledge representation and logic lec 11 to lec 15
Knnowledge representation and logic lec 11 to lec 15Knnowledge representation and logic lec 11 to lec 15
Knnowledge representation and logic lec 11 to lec 15
 
Final slide (bsc csit) chapter 2
Final slide (bsc csit) chapter 2Final slide (bsc csit) chapter 2
Final slide (bsc csit) chapter 2
 
Final slide (bsc csit) chapter 3
Final slide (bsc csit) chapter 3Final slide (bsc csit) chapter 3
Final slide (bsc csit) chapter 3
 

Recently uploaded

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
 
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
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Po-Chuan Chen
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
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
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
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
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
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
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 

Recently uploaded (20)

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
 
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
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).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
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
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
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.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
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 

Lec 6 bsc csit

  • 2. Hill Climbing • Back – Tracking • Use Enqued List • Informed Search • Very similar to DFS except instead of using lexical order to break ties, it break ties according to which node is closer to the goal. • Hill Climbing: Front Sorted
  • 3. Hill Climbing • It starts with random (potentially poor) solution, and iteratively makes small changes to the solution, each time improving it a little. When the algorithm cannot see any improvement anymore, it terminates. • Ideally, at that point the current solution is close to optimal, but it is not guaranteed that hill climbing will ever come close to the optimal solution.
  • 4. Hill Climbing • Hill climbing can be applied to the travelling salesman problem. • It is easy to find a solution that visits all the cities but will be very poor compared to the optimal solution.
  • 5. Hill Climbing The hill climbing can be described as follows: 1. Start with current-state = initial state 2. Until current-state = goal-state OR there is no change in current-state do: – Get the successors of the current state and use the evaluating function to assign a score to each successor. – If one of the successors has a better score than the current-state then set the new current-state to be the successor with the best score. • Hill climbing terminates when there are no successors of the current state which are better than the current state itself.
  • 6. Hill Climbing • Hill climbing is depth-first search with a heuristic measurement that orders choices as nodes are expanded. It always selects the most promising successor of the node last expanded.
  • 7. Hill Climbing • For instance, consider that the most promising successor of a node is the one that has the shortest straight-line distance to the goal node G. • In figure below, the straight line distances between each city and goal G is indicated in square brackets, i.e. the heuristic.
  • 8. Hill Climbing • Problems with Hill Climbing – Gets stuck at local maxima when we reach a position where there are no better neighbors, it is not a guarantee that we have found the best solution. Ridge is a sequence of local maxima. – Another type of problem we may find with hill climbing searches is finding a plateau. This is an area where the search space is flat so that all neighbors returns the same evaluation.
  • 9. Hill Climbing S A A G E FB 88.5 8.5 6 6 3 D The hill climbing search from S to G proceeds as follows: S A D B E C F G 3 4 4 5 5 42 4 3 [8] [8.5] [6] [6] [3] [3] [10]
  • 10. Hill Climbing • Apply the hill climbing algorithm to find a path from S to G, considering that the most promising successor of a node is its closest neighbor. S A D B E C F G 3 4 4 5 5 42 4 3
  • 11. Hill Climbing •the best first search method selects for expansion the most promising leaf node of the current search tree •the hill climbing search method selects for expansion the most promising successor of the node last expanded. • In depth-first search: front of the queue (a stack). • In breadth-first search: back of the queue. • Now, in hill-climbing search, you sort[1] the current node's children before adding them to the queue. • In best-first search, you add the current node's children to the queue in any order, then sort[1] the entire queue. • [1]: sort according to some problem-specific evaluation of the solution node, for example "distance from destination" in a path-finding search
  • 12. Hill Climbing AI, Subash Chandra Pakhrin 12 S G D E B A C 5 4 4 6 3 5 7+ 6 7+ S A B G A C D 7+ 6 5 7+ 7+ 3 A and C are both equally far from goal, so now we are going to use lexical order to break the tie
  • 13. Beam Search S A B B D C G A C Beam width (w) = 2 Beam: Keep w Best
  • 14. Annealing • In metallurgy, annealing is the process used to temper or harden metals and glass by heating them to a high temperature and then gradually cooling them, thus allowing material to reach a low energy crystalline state. • This can be applied to computer science problems.
  • 15. Simulated Annealing • It is applied to solve problems like – Travelling salesman problem – Designing printed circuit boards – Solving VLSI layout problems – Factory scheduling – Large-scale optimization task – Planning of path for a robot – Bioinformatics to design three dimension structures of protein molecules.
  • 16. Simulated Annealing • A hill climbing algorithm that never makes “down hill” moves towards states with lower value is guaranteed to be incomplete, because it can get stuck on a local maximum. • In contrast, a purely random walk – that is, moving to a successor chosen uniformly at random from the set of successors- is complete but extremely inefficient. • Simulated Annealing = hill climbing + random walk hence, it is efficient as well as completeness.
  • 17. Simulated Annealing • At the beginning you don’t care if you are actually moving towards the good solution and you accept bad moves as well, you accept bad configurations as well but as you progress towards the solution we become more careful and we try to get closer to the solution by selecting only the good moves.
  • 18. Simulated Annealing • Switch the perspective from hill climbing to gradient descent. • Imagine the task of getting a ping-pong ball into he deepest crevice in a bumpy surface. • If we just let the ball roll, it will get come to rest at a local minimum. • If we shake the surface, we can bounce the ball out of local minimum. • The trick is to shake just hard enough to bounce the ball out of local minimum but not hard enough to dislodge it from the global minimum. • Simulated Annealing solution is to start by shaking hard (i.e., at a high temperature) and then gradually reduce the intensity of shaking (i.e., lower the temperature)
  • 19. Simulated Annealing • E = Energy of the system • ΔE = Change in energy • We need to have a mechanism to alter the configuration All possible configurations of a given system E n e r g y C N Move
  • 20. Simulated Annealing C = C init for T = T max to T min E c = E(C) N = next (C) EN = E(N) ΔE = EN – EC If (ΔE > 0) C = N else if (eΔE/T > rand (0, 1)) C = N epoch
  • 21. Simulated Annealing • If the change in energy is negative, or in other words if we are making bad move. – In this case we compute probability • If probability is very high then we accept the move even if it is a bad move. • If probability is very low then we have low probability to accept the bad move. • Probability depends upon two variables change in energy ΔE and the temperature factor T.
  • 22. Simulated Annealing • When temperature is very high then probability for accepting bad move is very high. In other words, at high temperature we are exploring the solution space or we are exploiting the configuration and we’re accepting bad moves as well. • When the temperature is low this probability becomes very low and we have very low probability to accept bad moves.
  • 23. Simulated Annealing • Case 1: T = 1000, ΔE = 10 ΔE/T = 0.01 eΔ E/T = 0.99004 A number that is close to one has a very high (correlation) probability to become greater than a random number between 0 and 1, which means we get a very high probability, so when temperature is very high we have high probability to accept bad moves as well.
  • 24. Simulated Annealing ΔE influences probability • ΔE is very high = a low probability to accept the move • ΔE is small = high probability to accept the move. • We repeat the process for certain number of times usually known as the number of epochs, usually 100 to 200 times and for every value of temperature we repeat the process and finally expecting the solution to converge towards the global minimum.
  • 25. Simulated Annealing • Now on either extremes are 2 other algorithms 1. Hill Climbing 2. Random Walk • If we remove the probability factor or the temperature factor and always accept the good moves only then that’s hill climbing or it’s like a greedy algorithm which always go towards a better solution. Such, algorithms are prone to be easily stuck in local minima.
  • 26. Simulated Annealing • Random walk: It doesn’t care about how good a move we are making every time but we just explore, continue to explore, the space. Such algorithm never converge and will probably never give you the best optimal solution.
  • 27. Simulated Annealing • Parameters T max to T min and number of epochs are dependent on the problem that we are solving, usually we start with high temperature like few thousands, let’s say 5000 or 3000 and then the minimum temperature is set to a small value like 0 or 10 or something like that. • Number of epoch is usually a hundred, or 200 depending on the problem • If you run multiple times you will have an idea whether you’re being stuck in the local minima or global minimum

Editor's Notes

  1. Energy Landscape
  2. Case 1: ΔE = -10000 keeping T constant e^(-10000) = 0 Case 2: : ΔE = -0.001 keeping T constant e^(-0.001) = 0.9999