SlideShare a Scribd company logo
Local Search
CSI 341 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Classical Search
The search problems we have considered during the Uninformed/Informed Search have the following properties:
▸Observable
– If an agent’s sensors give it access to the complete state of the environment at each point in time, then we
say that the task environment is fully observable.
▸Deterministic
– If the next state of the environment is completely determined by the current state and action executed by the
agent, then we say the environment is deterministic.
▸Known
– In a known environment, the outcomes for all actions are given and the agent won’t have to learn how it works
in order to make good decisions.
Classical search algorithms explore the search space systematically and the solution of the search problem is a sequence of
actions representing paths from an initial state to the goal state.
2
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Local Search
▸There exists some problems where the path to the goal is irrelevant.
▸For example,
In the 8-queens problem what matters is the final configuration of queens, not the order in which they are added.
▸If the path to the goal does not matter, we might consider a different class of algorithms(Local Search), ones that do not
worry about paths at all.
▸Local search algorithms evaluate and modify one or more current states rather than systematically exploring paths from an
initial state.
▸Local Search
- Keep track of single current state
- Move only to neighboring states
- Path followed by the search are not retained
▸Advantages
- Use very little memory
- Can often find reasonable solutions in large or infinite state spaces for which systematic algorithms are unsuitable
- Useful for solving pure optimization problems, in which the aim is to find the best state according to an objective
function
3
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
State-space Landscape
Components >>
▸Location – state
▸Elevation – heuristic cost function or,
objective function.
An optimal algorithm always finds a global
maximum(for objective function)/minimum(for
heuristic cost function)
▸Local Maxima – a peak that is higher than each of
its neighboring states but lower than the global
maximum
▸Plateaux – a plateau is a flat area of the state-
space landscape. It can be a flat local maximum
from which no uphill exit exists, or a shoulder from
which progress is possible.
4
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Hill-climbing Search >> Steepest-ascent Version
▸Hill-climbing search algorithm is simply a loop that continually moves in the direction of increasing value - that is uphill.
▸It terminates when it reaches a peak where no neighbor has a higher value.
▸It doesn’t maintain a search tree, so the data structure for the current node need only record the state and the value of the
objective function/heuristic cost function.
▸Can randomly choose among the set of best successors, if multiple have the best value.
▸It doesn’t look ahead beyond the immediate neighbors of the current state.
▸Also known as Greedy Local Search
5
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Hill-climbing Search >> Example
▸8-queens problem:
- Local search algorithms use a complete-state formulation, where each state has 8-queens on the board one per
columns.
- Successors of a state are all possible states generated by moving a single queen to another square in the same
column. (8x7=56 successors)
- Heuristic cost function h is the number of pairs of queens that are attacking each other, either directly or indirectly.
- The global minima of this heuristic function i.e. zero occurs only at perfect solution.
6
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Local minima, h=1Initial State, h=17
Hill-climbing Search >> 8-puzzle
7
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Hill-climbing Search >> 4-queen
8
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Hill-climbing Search >> Drawbacks
Hill-climbing search often gets stuck for the following reasons:
▸Local Maxima >>
▹It is a peak that is higher than each of its neighboring states but lower than the global maximum.
▹For 8-queens problem at local minima, each move of a single queen makes the situation worse.
▸Ridges >>
▹Sequence of local maxima difficult for greedy algorithms to navigate
▸Plateaux >>
▹A plateau is a flat area of the state-space landscape. If can be a flat
local maximum or, a shoulder.
9
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Hill-climbing Search >> Local Maxima
10
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Hill-climbing Search >> Performance
▸Randomly generated 8-queens starting state…
▸14% the time it solves the problem
▸86% of the time it gets stuck at a local minimum
▸However…
- Takes only 4 steps on average when it succeeds
- And 3 on average when it gets stuck
- Not bad (for a state space with 88~17 million states)
11
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Hill-climbing Search >> Sideway Move version
▸If no downhill (uphill) moves, allow sideways moves in hope that algorithm can escape
- Need to place a limit on the possible number of sideways moves to avoid infinite loops
▸For 8-queens
- Now allow sideways moves with a limit of 100
- Raises percentage of problem instances solved from 14 to 94%
- However….
- 21 steps for every successful solution
- 64 for each failure
12
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Hill-climbing Search >> Variations
▸Stochastic hill-climbing
- Random selection among the uphill/downhill moves.
- The selection probability can vary with the steepness of the uphill move.
Sample Algorithm [Uphill version] >>
13
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
eval(vc) = 107, T = const = 10
Hill-climbing Search >> Variations
▸First-choice hill-climbing
- stochastic hill climbing by generating successors randomly until a better one is found
- Useful when there are a very large number of successors
▸Random-restart hill-climbing
- If at first you don’t succeed, try, try again.
- Tries to avoid getting stuck in local maxima.
14
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Simulated Annealing
15
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
▸A hill-climbing algorithm that never makes downhill moves(for maximization problem) toward states with lower value(or
higher cost) is guaranteed to be incomplete, because it can get stuck on a local maximum.
▸In contrast, a purely random walk-that is moving to successor chosen uniformly at random from the set of successors-is
complete but extremely inefficient.
▸Simulated Annealing is such an algorithm that combines both hill climbing with a random walk in such a way that yields
both efficiency and completeness.
Simulated Annealing
16
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
▸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 the material to reach a low energy crystalline state.
▸The simulated-annealing solution is to start by shaking hard (i.e. high temperature) and then gradually reduce the
intensity of the shaking (i.e. lower the temperature).
▸Instead of picking the best move, it picks a random move.
- If the move improves the situation, it is always accepted.
- Otherwise, the algorithm accepts the move with some probability less than 1.
▸The probability decreases exponentially with the badness of the move – the amount ∆E by which the evaluation is
worsened.
▸The probability also decreases as the temperature T goes down. As a result bad moves more likely to be allowed at the
start when T is high, and they become more unlikely as T decreases.
▸If the schedule lowers T slowly enough, the algorithm will find a global optimum with probability approaching 1.
Simulated Annealing >> Algorithm
17
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Simulated Annealing >> Algorithm
18
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Local Beam Search
19
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
▸Because of memory limitations, we are just maintaining one node in memory in our previous local search algorithms.
▸The local beam search keeps track of k states rather than just one.
▹It begins with k randomly generated states.
▹At each step, all the successors of all k states are generated. If any one is a goal, the algorithm halts. Otherwise it
selects the k best successors from the complete list and repeats.
▸In a random restart search each search process runs independently of the others; while in local beam search useful
information is passed among the parallel search threads.
▸The algorithm quickly abandons unfruitful searches and moves its resources to where the most progress is being made.
▸Problem:
- It can suffer from a lack of diversity among the k states - they can quickly become concentrated in a small region
of the state space, making the search little more than an expensive version of hill-climbing.
▸Solution:
- Stochastic Beam Search : Instead of choosing the best k from the pool of candidate successors, stochastic beam
search chooses k successors at random, with the probability of choosing a given successor being an increasing
function of its value.
Genetic Algorithm (GA)
20
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
▸A Genetic Algorithm is a variant of stochastic beam search in which successor states are generated by combining two
parents rather than by modifying a single state.
▸Population >> GAs begin with a set of k randomly generated states, called population.
▸Individual >> Each state or, individual is represented as a string over finite alphabet.
For example, 8-queens state must specify the positions of 8-queens, each in a column of 8 squares.
- way 1: a bit string requires 8 x log2(8) = 8 x 3 = 24 bits. (problem: cut in the middle of a digit)
- way 2: a string representing a sequence of 8 digits.
▸Genetic algorithms combine an uphill tendency with random exploration and exchange of
information among parallel search threads.
1 6 2 5 7 4 8 3
Genetic Algorithm (GA) >> Fitness Function
21
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
▸Each state/individual is rated by the objective/fitness function. A fitness function should return higher values for better
states.
For 8-queens, fitness function = number of not-attacking pairs of queens, which has a value of 28 for solution.
▸In this variant, we assume that the probability of being chosen for reproducing is directly proportional to the fitness score.
Genetic Algorithm (GA) >> Reproduction & Crossover
22
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
▸Pairs are selected at random for reproduction, in accordance with the calculated probabilities of the previous step.
▸For each pair to be mated, a crossover point is chosen randomly from the positions in the string.
- In our case, the crossover points are after the third digit in the first pair and after the fifth digit in the second pair.
- In our variant, each mating of two parents produces two offsprings.
Genetic Algorithm (GA) >> Reproduction & Crossover
23
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
▸The population is quite diverse early on in the process, so crossover frequently takes large steps in the state space early in
the search process and smaller steps later on when most individuals are quite similar.
▸The following figure illustrates that when two parent states are quite different, the crossover operation can produce a state
that is a long way from either parent state.
Genetic Algorithm (GA) >> Mutation
24
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
▸Each location is subject to random mutation with a small independent probability.
▸For 8-queens problem, we need to choose a queen at random and moving it to a random square in its column.
▸In our example, one digit was mutated in the first, third and fourth offspring.
Genetic Algorithm (GA) >> Mutation
25
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
Genetic Algorithm (GA) >> Comments
26
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
▸Positive points
- Random exploration can find solutions that local search can’t
- Appealing connection to human programming
▸Negative points
- Large number of tunable parameters
- Lack of good empirical studies comparing to simpler methods
- Useful on some set of problems but no convincing evidence that GAs are better than hill-climbing w/random restarts
in general.
Genetic Algorithm (GA) >> Max One Problem
27
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
▸The Max-One problem is a very simple problem where evolution is used to find a specific gene.
▸A gene is essentially a piece of text filled with random binary values, binary string.
Start Gene: 1010001010
Target Gene: 1111111111
▸The fitness f of a candidate solution to the Max-One problem is the number of ones in its genetic code.
Genetic Algorithm (GA) >> Max One Problem
28
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
▸We start with a population of n random strings.
▸Suppose that l=10 and n=6
s1= 1111010101 f (s1) = 7
s2= 0111000101 f (s2) = 5
s3= 1110110101 f (s3) = 7
s4= 0100010011 f (s4) = 4
s5= 1110111101 f (s5) = 8
s6= 0100110000 f (s6) = 3
Genetic Algorithm (GA) >> Selection
29
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
▸We randomly select a subset of the individuals based on their fitness:
Individual i will have a probability =
𝑓(𝑖)
𝑓(𝑖)𝑖
to be chosen.
s1’= 1111010101(s1)
s2’ = 1110110101(s3)
s3’ = 1110111101(s5)
s4’ = 0111000101 (s2)
s5’ = 0100010011 (s4)
s6’ = 1110111101 (s5)
Genetic Algorithm (GA) >> Crossover
30
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
▸Next we mate strings for crossover. For each couple we first decide whether to actually perform the crossover or not.
▸If we decide to actually perform crossover, we randomly extract the crossover points.
s1’= 1111010101(s1) s1’’ = 1110110101
s2’ = 1110110101(s3) s2’’ = 1111010101
s3’ = 1110111101(s5) s3’’ = 1110111101
s4’ = 0111000101 (s2) s4’’ = 0111000101
s5’ = 0100010011 (s4) s5’’ = 0100011101
s6’ = 1110111101 (s5) s6’’ = 1110110011
Genetic Algorithm (GA) >> Mutation
31
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
▸For each bit that we are to copy to the new population we allow a small probability of error (for example 0.1)
s1’’ = 1110110101 s1’’’ = 1110100101
s2’’ = 1111010101 s2’’’ = 1111110100
s3’’ = 1110111101 s3’’’ = 1110101111
s4’’ = 0111000101 s4’’’ = 0111000101
s5’’ = 0100011101 s5’’’ = 0100011101
s6’’ = 1110110011 s6’’’ = 1110110001
Go through the same process all over again, until a stopping criterion is met.
Genetic Algorithm (GA) >> Previous Question
32
Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
33
THANKS!
Any questions?
You can find me at imam@cse.uiu.ac.bd

More Related Content

What's hot

Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}
FellowBuddy.com
 
Hill climbing
Hill climbingHill climbing
Hill climbing
Mohammad Faizan
 
Heuristc Search Techniques
Heuristc Search TechniquesHeuristc Search Techniques
Heuristc Search Techniques
Jismy .K.Jose
 
AI: AI & Problem Solving
AI: AI & Problem SolvingAI: AI & Problem Solving
AI: AI & Problem Solving
DataminingTools Inc
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial Intelligence
Jay Nagar
 
Hill climbing algorithm
Hill climbing algorithmHill climbing algorithm
Hill climbing algorithm
Dr. C.V. Suresh Babu
 
Uninformed Search technique
Uninformed Search techniqueUninformed Search technique
Uninformed Search technique
Kapil Dahal
 
AI Lecture 2 (intelligent agents)
AI Lecture 2 (intelligent agents)AI Lecture 2 (intelligent agents)
AI Lecture 2 (intelligent agents)
Tajim Md. Niamat Ullah Akhund
 
I. Hill climbing algorithm II. Steepest hill climbing algorithm
I. Hill climbing algorithm II. Steepest hill climbing algorithmI. Hill climbing algorithm II. Steepest hill climbing algorithm
I. Hill climbing algorithm II. Steepest hill climbing algorithm
vikas dhakane
 
UNIT - I PROBLEM SOLVING AGENTS and EXAMPLES.pptx.pdf
UNIT - I PROBLEM SOLVING AGENTS and EXAMPLES.pptx.pdfUNIT - I PROBLEM SOLVING AGENTS and EXAMPLES.pptx.pdf
UNIT - I PROBLEM SOLVING AGENTS and EXAMPLES.pptx.pdf
JenishaR1
 
Hill climbing algorithm in artificial intelligence
Hill climbing algorithm in artificial intelligenceHill climbing algorithm in artificial intelligence
Hill climbing algorithm in artificial intelligence
sandeep54552
 
Local search algorithm
Local search algorithmLocal search algorithm
Local search algorithm
Megha Sharma
 
Means End Analysis (MEA) in Artificial.pptx
Means End Analysis (MEA) in Artificial.pptxMeans End Analysis (MEA) in Artificial.pptx
Means End Analysis (MEA) in Artificial.pptx
suchita74
 
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)
Tajim Md. Niamat Ullah Akhund
 
Informed search
Informed searchInformed search
Informed search
Amit Kumar Rathi
 
Production systems
Production systemsProduction systems
Production systems
Adri Jovin
 
Lecture 11 Informed Search
Lecture 11 Informed SearchLecture 11 Informed Search
Lecture 11 Informed Search
Hema Kashyap
 
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | EdurekaA star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
Edureka!
 
Artificial Intelligence Searching Techniques
Artificial Intelligence Searching TechniquesArtificial Intelligence Searching Techniques
Artificial Intelligence Searching Techniques
Dr. C.V. Suresh Babu
 
Adversarial search
Adversarial search Adversarial search
Adversarial search
Farah M. Altufaili
 

What's hot (20)

Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}
 
Hill climbing
Hill climbingHill climbing
Hill climbing
 
Heuristc Search Techniques
Heuristc Search TechniquesHeuristc Search Techniques
Heuristc Search Techniques
 
AI: AI & Problem Solving
AI: AI & Problem SolvingAI: AI & Problem Solving
AI: AI & Problem Solving
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial Intelligence
 
Hill climbing algorithm
Hill climbing algorithmHill climbing algorithm
Hill climbing algorithm
 
Uninformed Search technique
Uninformed Search techniqueUninformed Search technique
Uninformed Search technique
 
AI Lecture 2 (intelligent agents)
AI Lecture 2 (intelligent agents)AI Lecture 2 (intelligent agents)
AI Lecture 2 (intelligent agents)
 
I. Hill climbing algorithm II. Steepest hill climbing algorithm
I. Hill climbing algorithm II. Steepest hill climbing algorithmI. Hill climbing algorithm II. Steepest hill climbing algorithm
I. Hill climbing algorithm II. Steepest hill climbing algorithm
 
UNIT - I PROBLEM SOLVING AGENTS and EXAMPLES.pptx.pdf
UNIT - I PROBLEM SOLVING AGENTS and EXAMPLES.pptx.pdfUNIT - I PROBLEM SOLVING AGENTS and EXAMPLES.pptx.pdf
UNIT - I PROBLEM SOLVING AGENTS and EXAMPLES.pptx.pdf
 
Hill climbing algorithm in artificial intelligence
Hill climbing algorithm in artificial intelligenceHill climbing algorithm in artificial intelligence
Hill climbing algorithm in artificial intelligence
 
Local search algorithm
Local search algorithmLocal search algorithm
Local search algorithm
 
Means End Analysis (MEA) in Artificial.pptx
Means End Analysis (MEA) in Artificial.pptxMeans End Analysis (MEA) in Artificial.pptx
Means End Analysis (MEA) in Artificial.pptx
 
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)
 
Informed search
Informed searchInformed search
Informed search
 
Production systems
Production systemsProduction systems
Production systems
 
Lecture 11 Informed Search
Lecture 11 Informed SearchLecture 11 Informed Search
Lecture 11 Informed Search
 
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | EdurekaA star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
 
Artificial Intelligence Searching Techniques
Artificial Intelligence Searching TechniquesArtificial Intelligence Searching Techniques
Artificial Intelligence Searching Techniques
 
Adversarial search
Adversarial search Adversarial search
Adversarial search
 

Similar to AI 5 | Local Search

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
 
Heuristic or informed search
Heuristic or informed searchHeuristic or informed search
Heuristic or informed search
HamzaJaved64
 
Optimization technique
Optimization techniqueOptimization technique
Optimization technique
Vimal Patel
 
Numerical analysis genetic algorithms
Numerical analysis  genetic algorithmsNumerical analysis  genetic algorithms
Numerical analysis genetic algorithms
SHAMJITH KM
 
1582997627872.pdf
1582997627872.pdf1582997627872.pdf
1582997627872.pdf
AbhilashJain25
 
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
 
UNIT-5 Optimization (Part-1).ppt
UNIT-5 Optimization (Part-1).pptUNIT-5 Optimization (Part-1).ppt
UNIT-5 Optimization (Part-1).ppt
TvVignesh3
 
BGA.pptx
BGA.pptxBGA.pptx
04-local-search.pdf
04-local-search.pdf04-local-search.pdf
04-local-search.pdf
Dr. Naushad Varish
 
Muzammil Adulrahman ppt on travelling salesman Problem Based On Mutation Gene...
Muzammil Adulrahman ppt on travelling salesman Problem Based On Mutation Gene...Muzammil Adulrahman ppt on travelling salesman Problem Based On Mutation Gene...
Muzammil Adulrahman ppt on travelling salesman Problem Based On Mutation Gene...
Petroleum Training Institute
 
AI_ppt.pptx
AI_ppt.pptxAI_ppt.pptx
AI_ppt.pptx
SnehaTiwari84
 
24.09.2021 Reinforcement Learning Algorithms.pptx
24.09.2021 Reinforcement Learning Algorithms.pptx24.09.2021 Reinforcement Learning Algorithms.pptx
24.09.2021 Reinforcement Learning Algorithms.pptx
ManiMaran230751
 
simple
simplesimple
simple
avy2cess
 
simple
simplesimple
simple
avy2cess
 
Lec 6 bsc csit
Lec 6 bsc csitLec 6 bsc csit
Lec 6 bsc csit
Subash Chandra Pakhrin
 
Bio-Inspired Optimization Algorithms_BasicAlgorithms.pdf
Bio-Inspired Optimization Algorithms_BasicAlgorithms.pdfBio-Inspired Optimization Algorithms_BasicAlgorithms.pdf
Bio-Inspired Optimization Algorithms_BasicAlgorithms.pdf
Neha Jain jain
 
AI Lesson 10
AI Lesson 10AI Lesson 10
AI Lesson 10
Assistant Professor
 
02LocalSearch.pdf
02LocalSearch.pdf02LocalSearch.pdf
02LocalSearch.pdf
vijaykumar95844
 
cs-171-05-LocalSearch.pptx
cs-171-05-LocalSearch.pptxcs-171-05-LocalSearch.pptx
cs-171-05-LocalSearch.pptx
VijayKumarLokanadam
 
Innovative computational intelligence ai techniques - Ahmed Yousry
Innovative computational intelligence ai techniques - Ahmed YousryInnovative computational intelligence ai techniques - Ahmed Yousry
Innovative computational intelligence ai techniques - Ahmed Yousry
Ahmed Yousry
 

Similar to AI 5 | Local Search (20)

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
 
Heuristic or informed search
Heuristic or informed searchHeuristic or informed search
Heuristic or informed search
 
Optimization technique
Optimization techniqueOptimization technique
Optimization technique
 
Numerical analysis genetic algorithms
Numerical analysis  genetic algorithmsNumerical analysis  genetic algorithms
Numerical analysis genetic algorithms
 
1582997627872.pdf
1582997627872.pdf1582997627872.pdf
1582997627872.pdf
 
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
 
UNIT-5 Optimization (Part-1).ppt
UNIT-5 Optimization (Part-1).pptUNIT-5 Optimization (Part-1).ppt
UNIT-5 Optimization (Part-1).ppt
 
BGA.pptx
BGA.pptxBGA.pptx
BGA.pptx
 
04-local-search.pdf
04-local-search.pdf04-local-search.pdf
04-local-search.pdf
 
Muzammil Adulrahman ppt on travelling salesman Problem Based On Mutation Gene...
Muzammil Adulrahman ppt on travelling salesman Problem Based On Mutation Gene...Muzammil Adulrahman ppt on travelling salesman Problem Based On Mutation Gene...
Muzammil Adulrahman ppt on travelling salesman Problem Based On Mutation Gene...
 
AI_ppt.pptx
AI_ppt.pptxAI_ppt.pptx
AI_ppt.pptx
 
24.09.2021 Reinforcement Learning Algorithms.pptx
24.09.2021 Reinforcement Learning Algorithms.pptx24.09.2021 Reinforcement Learning Algorithms.pptx
24.09.2021 Reinforcement Learning Algorithms.pptx
 
simple
simplesimple
simple
 
simple
simplesimple
simple
 
Lec 6 bsc csit
Lec 6 bsc csitLec 6 bsc csit
Lec 6 bsc csit
 
Bio-Inspired Optimization Algorithms_BasicAlgorithms.pdf
Bio-Inspired Optimization Algorithms_BasicAlgorithms.pdfBio-Inspired Optimization Algorithms_BasicAlgorithms.pdf
Bio-Inspired Optimization Algorithms_BasicAlgorithms.pdf
 
AI Lesson 10
AI Lesson 10AI Lesson 10
AI Lesson 10
 
02LocalSearch.pdf
02LocalSearch.pdf02LocalSearch.pdf
02LocalSearch.pdf
 
cs-171-05-LocalSearch.pptx
cs-171-05-LocalSearch.pptxcs-171-05-LocalSearch.pptx
cs-171-05-LocalSearch.pptx
 
Innovative computational intelligence ai techniques - Ahmed Yousry
Innovative computational intelligence ai techniques - Ahmed YousryInnovative computational intelligence ai techniques - Ahmed Yousry
Innovative computational intelligence ai techniques - Ahmed Yousry
 

More from Mohammad Imam Hossain

DS & Algo 6 - Offline Assignment 6
DS & Algo 6 - Offline Assignment 6DS & Algo 6 - Offline Assignment 6
DS & Algo 6 - Offline Assignment 6
Mohammad Imam Hossain
 
DS & Algo 6 - Dynamic Programming
DS & Algo 6 - Dynamic ProgrammingDS & Algo 6 - Dynamic Programming
DS & Algo 6 - Dynamic Programming
Mohammad Imam Hossain
 
DS & Algo 5 - Disjoint Set and MST
DS & Algo 5 - Disjoint Set and MSTDS & Algo 5 - Disjoint Set and MST
DS & Algo 5 - Disjoint Set and MST
Mohammad Imam Hossain
 
DS & Algo 4 - Graph and Shortest Path Search
DS & Algo 4 - Graph and Shortest Path SearchDS & Algo 4 - Graph and Shortest Path Search
DS & Algo 4 - Graph and Shortest Path Search
Mohammad Imam Hossain
 
DS & Algo 3 - Offline Assignment 3
DS & Algo 3 - Offline Assignment 3DS & Algo 3 - Offline Assignment 3
DS & Algo 3 - Offline Assignment 3
Mohammad Imam Hossain
 
DS & Algo 3 - Divide and Conquer
DS & Algo 3 - Divide and ConquerDS & Algo 3 - Divide and Conquer
DS & Algo 3 - Divide and Conquer
Mohammad Imam Hossain
 
DS & Algo 2 - Offline Assignment 2
DS & Algo 2 - Offline Assignment 2DS & Algo 2 - Offline Assignment 2
DS & Algo 2 - Offline Assignment 2
Mohammad Imam Hossain
 
DS & Algo 2 - Recursion
DS & Algo 2 - RecursionDS & Algo 2 - Recursion
DS & Algo 2 - Recursion
Mohammad Imam Hossain
 
DS & Algo 1 - Offline Assignment 1
DS & Algo 1 - Offline Assignment 1DS & Algo 1 - Offline Assignment 1
DS & Algo 1 - Offline Assignment 1
Mohammad Imam Hossain
 
DS & Algo 1 - C++ and STL Introduction
DS & Algo 1 - C++ and STL IntroductionDS & Algo 1 - C++ and STL Introduction
DS & Algo 1 - C++ and STL Introduction
Mohammad Imam Hossain
 
DBMS 1 | Introduction to DBMS
DBMS 1 | Introduction to DBMSDBMS 1 | Introduction to DBMS
DBMS 1 | Introduction to DBMS
Mohammad Imam Hossain
 
DBMS 10 | Database Transactions
DBMS 10 | Database TransactionsDBMS 10 | Database Transactions
DBMS 10 | Database Transactions
Mohammad Imam Hossain
 
DBMS 3 | ER Diagram to Relational Schema
DBMS 3 | ER Diagram to Relational SchemaDBMS 3 | ER Diagram to Relational Schema
DBMS 3 | ER Diagram to Relational Schema
Mohammad Imam Hossain
 
DBMS 2 | Entity Relationship Model
DBMS 2 | Entity Relationship ModelDBMS 2 | Entity Relationship Model
DBMS 2 | Entity Relationship Model
Mohammad Imam Hossain
 
DBMS 7 | Relational Query Language
DBMS 7 | Relational Query LanguageDBMS 7 | Relational Query Language
DBMS 7 | Relational Query Language
Mohammad Imam Hossain
 
DBMS 4 | MySQL - DDL & DML Commands
DBMS 4 | MySQL - DDL & DML CommandsDBMS 4 | MySQL - DDL & DML Commands
DBMS 4 | MySQL - DDL & DML Commands
Mohammad Imam Hossain
 
DBMS 5 | MySQL Practice List - HR Schema
DBMS 5 | MySQL Practice List - HR SchemaDBMS 5 | MySQL Practice List - HR Schema
DBMS 5 | MySQL Practice List - HR Schema
Mohammad Imam Hossain
 
TOC 10 | Turing Machine
TOC 10 | Turing MachineTOC 10 | Turing Machine
TOC 10 | Turing Machine
Mohammad Imam Hossain
 
TOC 9 | Pushdown Automata
TOC 9 | Pushdown AutomataTOC 9 | Pushdown Automata
TOC 9 | Pushdown Automata
Mohammad Imam Hossain
 
TOC 8 | Derivation, Parse Tree & Ambiguity Check
TOC 8 | Derivation, Parse Tree & Ambiguity CheckTOC 8 | Derivation, Parse Tree & Ambiguity Check
TOC 8 | Derivation, Parse Tree & Ambiguity Check
Mohammad Imam Hossain
 

More from Mohammad Imam Hossain (20)

DS & Algo 6 - Offline Assignment 6
DS & Algo 6 - Offline Assignment 6DS & Algo 6 - Offline Assignment 6
DS & Algo 6 - Offline Assignment 6
 
DS & Algo 6 - Dynamic Programming
DS & Algo 6 - Dynamic ProgrammingDS & Algo 6 - Dynamic Programming
DS & Algo 6 - Dynamic Programming
 
DS & Algo 5 - Disjoint Set and MST
DS & Algo 5 - Disjoint Set and MSTDS & Algo 5 - Disjoint Set and MST
DS & Algo 5 - Disjoint Set and MST
 
DS & Algo 4 - Graph and Shortest Path Search
DS & Algo 4 - Graph and Shortest Path SearchDS & Algo 4 - Graph and Shortest Path Search
DS & Algo 4 - Graph and Shortest Path Search
 
DS & Algo 3 - Offline Assignment 3
DS & Algo 3 - Offline Assignment 3DS & Algo 3 - Offline Assignment 3
DS & Algo 3 - Offline Assignment 3
 
DS & Algo 3 - Divide and Conquer
DS & Algo 3 - Divide and ConquerDS & Algo 3 - Divide and Conquer
DS & Algo 3 - Divide and Conquer
 
DS & Algo 2 - Offline Assignment 2
DS & Algo 2 - Offline Assignment 2DS & Algo 2 - Offline Assignment 2
DS & Algo 2 - Offline Assignment 2
 
DS & Algo 2 - Recursion
DS & Algo 2 - RecursionDS & Algo 2 - Recursion
DS & Algo 2 - Recursion
 
DS & Algo 1 - Offline Assignment 1
DS & Algo 1 - Offline Assignment 1DS & Algo 1 - Offline Assignment 1
DS & Algo 1 - Offline Assignment 1
 
DS & Algo 1 - C++ and STL Introduction
DS & Algo 1 - C++ and STL IntroductionDS & Algo 1 - C++ and STL Introduction
DS & Algo 1 - C++ and STL Introduction
 
DBMS 1 | Introduction to DBMS
DBMS 1 | Introduction to DBMSDBMS 1 | Introduction to DBMS
DBMS 1 | Introduction to DBMS
 
DBMS 10 | Database Transactions
DBMS 10 | Database TransactionsDBMS 10 | Database Transactions
DBMS 10 | Database Transactions
 
DBMS 3 | ER Diagram to Relational Schema
DBMS 3 | ER Diagram to Relational SchemaDBMS 3 | ER Diagram to Relational Schema
DBMS 3 | ER Diagram to Relational Schema
 
DBMS 2 | Entity Relationship Model
DBMS 2 | Entity Relationship ModelDBMS 2 | Entity Relationship Model
DBMS 2 | Entity Relationship Model
 
DBMS 7 | Relational Query Language
DBMS 7 | Relational Query LanguageDBMS 7 | Relational Query Language
DBMS 7 | Relational Query Language
 
DBMS 4 | MySQL - DDL & DML Commands
DBMS 4 | MySQL - DDL & DML CommandsDBMS 4 | MySQL - DDL & DML Commands
DBMS 4 | MySQL - DDL & DML Commands
 
DBMS 5 | MySQL Practice List - HR Schema
DBMS 5 | MySQL Practice List - HR SchemaDBMS 5 | MySQL Practice List - HR Schema
DBMS 5 | MySQL Practice List - HR Schema
 
TOC 10 | Turing Machine
TOC 10 | Turing MachineTOC 10 | Turing Machine
TOC 10 | Turing Machine
 
TOC 9 | Pushdown Automata
TOC 9 | Pushdown AutomataTOC 9 | Pushdown Automata
TOC 9 | Pushdown Automata
 
TOC 8 | Derivation, Parse Tree & Ambiguity Check
TOC 8 | Derivation, Parse Tree & Ambiguity CheckTOC 8 | Derivation, Parse Tree & Ambiguity Check
TOC 8 | Derivation, Parse Tree & Ambiguity Check
 

Recently uploaded

Observational Learning
Observational Learning Observational Learning
Observational Learning
sanamushtaq922
 
78 Microsoft-Publisher - Sirin Sultana Bora.pptx
78 Microsoft-Publisher - Sirin Sultana Bora.pptx78 Microsoft-Publisher - Sirin Sultana Bora.pptx
78 Microsoft-Publisher - Sirin Sultana Bora.pptx
Kalna College
 
The basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptxThe basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptx
heathfieldcps1
 
skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)
Mohammad Al-Dhahabi
 
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
zuzanka
 
Bossa N’ Roll Records by Ismael Vazquez.
Bossa N’ Roll Records by Ismael Vazquez.Bossa N’ Roll Records by Ismael Vazquez.
Bossa N’ Roll Records by Ismael Vazquez.
IsmaelVazquez38
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
zuzanka
 
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
indexPub
 
Juneteenth Freedom Day 2024 David Douglas School District
Juneteenth Freedom Day 2024 David Douglas School DistrictJuneteenth Freedom Day 2024 David Douglas School District
Juneteenth Freedom Day 2024 David Douglas School District
David Douglas School District
 
Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...
PsychoTech Services
 
Haunted Houses by H W Longfellow for class 10
Haunted Houses by H W Longfellow for class 10Haunted Houses by H W Longfellow for class 10
Haunted Houses by H W Longfellow for class 10
nitinpv4ai
 
Contiguity Of Various Message Forms - Rupam Chandra.pptx
Contiguity Of Various Message Forms - Rupam Chandra.pptxContiguity Of Various Message Forms - Rupam Chandra.pptx
Contiguity Of Various Message Forms - Rupam Chandra.pptx
Kalna College
 
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdfREASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
giancarloi8888
 
CHUYÊN ĐỀ ÔN TẬP VÀ PHÁT TRIỂN CÂU HỎI TRONG ĐỀ MINH HỌA THI TỐT NGHIỆP THPT ...
CHUYÊN ĐỀ ÔN TẬP VÀ PHÁT TRIỂN CÂU HỎI TRONG ĐỀ MINH HỌA THI TỐT NGHIỆP THPT ...CHUYÊN ĐỀ ÔN TẬP VÀ PHÁT TRIỂN CÂU HỎI TRONG ĐỀ MINH HỌA THI TỐT NGHIỆP THPT ...
CHUYÊN ĐỀ ÔN TẬP VÀ PHÁT TRIỂN CÂU HỎI TRONG ĐỀ MINH HỌA THI TỐT NGHIỆP THPT ...
Nguyen Thanh Tu Collection
 
BPSC-105 important questions for june term end exam
BPSC-105 important questions for june term end examBPSC-105 important questions for june term end exam
BPSC-105 important questions for june term end exam
sonukumargpnirsadhan
 
220711130088 Sumi Basak Virtual University EPC 3.pptx
220711130088 Sumi Basak Virtual University EPC 3.pptx220711130088 Sumi Basak Virtual University EPC 3.pptx
220711130088 Sumi Basak Virtual University EPC 3.pptx
Kalna College
 
How to Fix [Errno 98] address already in use
How to Fix [Errno 98] address already in useHow to Fix [Errno 98] address already in use
How to Fix [Errno 98] address already in use
Celine George
 
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptxCapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapitolTechU
 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Henry Hollis
 
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
EduSkills OECD
 

Recently uploaded (20)

Observational Learning
Observational Learning Observational Learning
Observational Learning
 
78 Microsoft-Publisher - Sirin Sultana Bora.pptx
78 Microsoft-Publisher - Sirin Sultana Bora.pptx78 Microsoft-Publisher - Sirin Sultana Bora.pptx
78 Microsoft-Publisher - Sirin Sultana Bora.pptx
 
The basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptxThe basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptx
 
skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)
 
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
 
Bossa N’ Roll Records by Ismael Vazquez.
Bossa N’ Roll Records by Ismael Vazquez.Bossa N’ Roll Records by Ismael Vazquez.
Bossa N’ Roll Records by Ismael Vazquez.
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
 
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
 
Juneteenth Freedom Day 2024 David Douglas School District
Juneteenth Freedom Day 2024 David Douglas School DistrictJuneteenth Freedom Day 2024 David Douglas School District
Juneteenth Freedom Day 2024 David Douglas School District
 
Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...
 
Haunted Houses by H W Longfellow for class 10
Haunted Houses by H W Longfellow for class 10Haunted Houses by H W Longfellow for class 10
Haunted Houses by H W Longfellow for class 10
 
Contiguity Of Various Message Forms - Rupam Chandra.pptx
Contiguity Of Various Message Forms - Rupam Chandra.pptxContiguity Of Various Message Forms - Rupam Chandra.pptx
Contiguity Of Various Message Forms - Rupam Chandra.pptx
 
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdfREASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
 
CHUYÊN ĐỀ ÔN TẬP VÀ PHÁT TRIỂN CÂU HỎI TRONG ĐỀ MINH HỌA THI TỐT NGHIỆP THPT ...
CHUYÊN ĐỀ ÔN TẬP VÀ PHÁT TRIỂN CÂU HỎI TRONG ĐỀ MINH HỌA THI TỐT NGHIỆP THPT ...CHUYÊN ĐỀ ÔN TẬP VÀ PHÁT TRIỂN CÂU HỎI TRONG ĐỀ MINH HỌA THI TỐT NGHIỆP THPT ...
CHUYÊN ĐỀ ÔN TẬP VÀ PHÁT TRIỂN CÂU HỎI TRONG ĐỀ MINH HỌA THI TỐT NGHIỆP THPT ...
 
BPSC-105 important questions for june term end exam
BPSC-105 important questions for june term end examBPSC-105 important questions for june term end exam
BPSC-105 important questions for june term end exam
 
220711130088 Sumi Basak Virtual University EPC 3.pptx
220711130088 Sumi Basak Virtual University EPC 3.pptx220711130088 Sumi Basak Virtual University EPC 3.pptx
220711130088 Sumi Basak Virtual University EPC 3.pptx
 
How to Fix [Errno 98] address already in use
How to Fix [Errno 98] address already in useHow to Fix [Errno 98] address already in use
How to Fix [Errno 98] address already in use
 
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptxCapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
 
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
 

AI 5 | Local Search

  • 1. Local Search CSI 341 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 2. Classical Search The search problems we have considered during the Uninformed/Informed Search have the following properties: ▸Observable – If an agent’s sensors give it access to the complete state of the environment at each point in time, then we say that the task environment is fully observable. ▸Deterministic – If the next state of the environment is completely determined by the current state and action executed by the agent, then we say the environment is deterministic. ▸Known – In a known environment, the outcomes for all actions are given and the agent won’t have to learn how it works in order to make good decisions. Classical search algorithms explore the search space systematically and the solution of the search problem is a sequence of actions representing paths from an initial state to the goal state. 2 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 3. Local Search ▸There exists some problems where the path to the goal is irrelevant. ▸For example, In the 8-queens problem what matters is the final configuration of queens, not the order in which they are added. ▸If the path to the goal does not matter, we might consider a different class of algorithms(Local Search), ones that do not worry about paths at all. ▸Local search algorithms evaluate and modify one or more current states rather than systematically exploring paths from an initial state. ▸Local Search - Keep track of single current state - Move only to neighboring states - Path followed by the search are not retained ▸Advantages - Use very little memory - Can often find reasonable solutions in large or infinite state spaces for which systematic algorithms are unsuitable - Useful for solving pure optimization problems, in which the aim is to find the best state according to an objective function 3 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 4. State-space Landscape Components >> ▸Location – state ▸Elevation – heuristic cost function or, objective function. An optimal algorithm always finds a global maximum(for objective function)/minimum(for heuristic cost function) ▸Local Maxima – a peak that is higher than each of its neighboring states but lower than the global maximum ▸Plateaux – a plateau is a flat area of the state- space landscape. It can be a flat local maximum from which no uphill exit exists, or a shoulder from which progress is possible. 4 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 5. Hill-climbing Search >> Steepest-ascent Version ▸Hill-climbing search algorithm is simply a loop that continually moves in the direction of increasing value - that is uphill. ▸It terminates when it reaches a peak where no neighbor has a higher value. ▸It doesn’t maintain a search tree, so the data structure for the current node need only record the state and the value of the objective function/heuristic cost function. ▸Can randomly choose among the set of best successors, if multiple have the best value. ▸It doesn’t look ahead beyond the immediate neighbors of the current state. ▸Also known as Greedy Local Search 5 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 6. Hill-climbing Search >> Example ▸8-queens problem: - Local search algorithms use a complete-state formulation, where each state has 8-queens on the board one per columns. - Successors of a state are all possible states generated by moving a single queen to another square in the same column. (8x7=56 successors) - Heuristic cost function h is the number of pairs of queens that are attacking each other, either directly or indirectly. - The global minima of this heuristic function i.e. zero occurs only at perfect solution. 6 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU Local minima, h=1Initial State, h=17
  • 7. Hill-climbing Search >> 8-puzzle 7 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 8. Hill-climbing Search >> 4-queen 8 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 9. Hill-climbing Search >> Drawbacks Hill-climbing search often gets stuck for the following reasons: ▸Local Maxima >> ▹It is a peak that is higher than each of its neighboring states but lower than the global maximum. ▹For 8-queens problem at local minima, each move of a single queen makes the situation worse. ▸Ridges >> ▹Sequence of local maxima difficult for greedy algorithms to navigate ▸Plateaux >> ▹A plateau is a flat area of the state-space landscape. If can be a flat local maximum or, a shoulder. 9 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 10. Hill-climbing Search >> Local Maxima 10 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 11. Hill-climbing Search >> Performance ▸Randomly generated 8-queens starting state… ▸14% the time it solves the problem ▸86% of the time it gets stuck at a local minimum ▸However… - Takes only 4 steps on average when it succeeds - And 3 on average when it gets stuck - Not bad (for a state space with 88~17 million states) 11 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 12. Hill-climbing Search >> Sideway Move version ▸If no downhill (uphill) moves, allow sideways moves in hope that algorithm can escape - Need to place a limit on the possible number of sideways moves to avoid infinite loops ▸For 8-queens - Now allow sideways moves with a limit of 100 - Raises percentage of problem instances solved from 14 to 94% - However…. - 21 steps for every successful solution - 64 for each failure 12 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 13. Hill-climbing Search >> Variations ▸Stochastic hill-climbing - Random selection among the uphill/downhill moves. - The selection probability can vary with the steepness of the uphill move. Sample Algorithm [Uphill version] >> 13 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU eval(vc) = 107, T = const = 10
  • 14. Hill-climbing Search >> Variations ▸First-choice hill-climbing - stochastic hill climbing by generating successors randomly until a better one is found - Useful when there are a very large number of successors ▸Random-restart hill-climbing - If at first you don’t succeed, try, try again. - Tries to avoid getting stuck in local maxima. 14 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 15. Simulated Annealing 15 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU ▸A hill-climbing algorithm that never makes downhill moves(for maximization problem) toward states with lower value(or higher cost) is guaranteed to be incomplete, because it can get stuck on a local maximum. ▸In contrast, a purely random walk-that is moving to successor chosen uniformly at random from the set of successors-is complete but extremely inefficient. ▸Simulated Annealing is such an algorithm that combines both hill climbing with a random walk in such a way that yields both efficiency and completeness.
  • 16. Simulated Annealing 16 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU ▸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 the material to reach a low energy crystalline state. ▸The simulated-annealing solution is to start by shaking hard (i.e. high temperature) and then gradually reduce the intensity of the shaking (i.e. lower the temperature). ▸Instead of picking the best move, it picks a random move. - If the move improves the situation, it is always accepted. - Otherwise, the algorithm accepts the move with some probability less than 1. ▸The probability decreases exponentially with the badness of the move – the amount ∆E by which the evaluation is worsened. ▸The probability also decreases as the temperature T goes down. As a result bad moves more likely to be allowed at the start when T is high, and they become more unlikely as T decreases. ▸If the schedule lowers T slowly enough, the algorithm will find a global optimum with probability approaching 1.
  • 17. Simulated Annealing >> Algorithm 17 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 18. Simulated Annealing >> Algorithm 18 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 19. Local Beam Search 19 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU ▸Because of memory limitations, we are just maintaining one node in memory in our previous local search algorithms. ▸The local beam search keeps track of k states rather than just one. ▹It begins with k randomly generated states. ▹At each step, all the successors of all k states are generated. If any one is a goal, the algorithm halts. Otherwise it selects the k best successors from the complete list and repeats. ▸In a random restart search each search process runs independently of the others; while in local beam search useful information is passed among the parallel search threads. ▸The algorithm quickly abandons unfruitful searches and moves its resources to where the most progress is being made. ▸Problem: - It can suffer from a lack of diversity among the k states - they can quickly become concentrated in a small region of the state space, making the search little more than an expensive version of hill-climbing. ▸Solution: - Stochastic Beam Search : Instead of choosing the best k from the pool of candidate successors, stochastic beam search chooses k successors at random, with the probability of choosing a given successor being an increasing function of its value.
  • 20. Genetic Algorithm (GA) 20 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU ▸A Genetic Algorithm is a variant of stochastic beam search in which successor states are generated by combining two parents rather than by modifying a single state. ▸Population >> GAs begin with a set of k randomly generated states, called population. ▸Individual >> Each state or, individual is represented as a string over finite alphabet. For example, 8-queens state must specify the positions of 8-queens, each in a column of 8 squares. - way 1: a bit string requires 8 x log2(8) = 8 x 3 = 24 bits. (problem: cut in the middle of a digit) - way 2: a string representing a sequence of 8 digits. ▸Genetic algorithms combine an uphill tendency with random exploration and exchange of information among parallel search threads. 1 6 2 5 7 4 8 3
  • 21. Genetic Algorithm (GA) >> Fitness Function 21 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU ▸Each state/individual is rated by the objective/fitness function. A fitness function should return higher values for better states. For 8-queens, fitness function = number of not-attacking pairs of queens, which has a value of 28 for solution. ▸In this variant, we assume that the probability of being chosen for reproducing is directly proportional to the fitness score.
  • 22. Genetic Algorithm (GA) >> Reproduction & Crossover 22 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU ▸Pairs are selected at random for reproduction, in accordance with the calculated probabilities of the previous step. ▸For each pair to be mated, a crossover point is chosen randomly from the positions in the string. - In our case, the crossover points are after the third digit in the first pair and after the fifth digit in the second pair. - In our variant, each mating of two parents produces two offsprings.
  • 23. Genetic Algorithm (GA) >> Reproduction & Crossover 23 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU ▸The population is quite diverse early on in the process, so crossover frequently takes large steps in the state space early in the search process and smaller steps later on when most individuals are quite similar. ▸The following figure illustrates that when two parent states are quite different, the crossover operation can produce a state that is a long way from either parent state.
  • 24. Genetic Algorithm (GA) >> Mutation 24 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU ▸Each location is subject to random mutation with a small independent probability. ▸For 8-queens problem, we need to choose a queen at random and moving it to a random square in its column. ▸In our example, one digit was mutated in the first, third and fourth offspring.
  • 25. Genetic Algorithm (GA) >> Mutation 25 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 26. Genetic Algorithm (GA) >> Comments 26 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU ▸Positive points - Random exploration can find solutions that local search can’t - Appealing connection to human programming ▸Negative points - Large number of tunable parameters - Lack of good empirical studies comparing to simpler methods - Useful on some set of problems but no convincing evidence that GAs are better than hill-climbing w/random restarts in general.
  • 27. Genetic Algorithm (GA) >> Max One Problem 27 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU ▸The Max-One problem is a very simple problem where evolution is used to find a specific gene. ▸A gene is essentially a piece of text filled with random binary values, binary string. Start Gene: 1010001010 Target Gene: 1111111111 ▸The fitness f of a candidate solution to the Max-One problem is the number of ones in its genetic code.
  • 28. Genetic Algorithm (GA) >> Max One Problem 28 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU ▸We start with a population of n random strings. ▸Suppose that l=10 and n=6 s1= 1111010101 f (s1) = 7 s2= 0111000101 f (s2) = 5 s3= 1110110101 f (s3) = 7 s4= 0100010011 f (s4) = 4 s5= 1110111101 f (s5) = 8 s6= 0100110000 f (s6) = 3
  • 29. Genetic Algorithm (GA) >> Selection 29 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU ▸We randomly select a subset of the individuals based on their fitness: Individual i will have a probability = 𝑓(𝑖) 𝑓(𝑖)𝑖 to be chosen. s1’= 1111010101(s1) s2’ = 1110110101(s3) s3’ = 1110111101(s5) s4’ = 0111000101 (s2) s5’ = 0100010011 (s4) s6’ = 1110111101 (s5)
  • 30. Genetic Algorithm (GA) >> Crossover 30 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU ▸Next we mate strings for crossover. For each couple we first decide whether to actually perform the crossover or not. ▸If we decide to actually perform crossover, we randomly extract the crossover points. s1’= 1111010101(s1) s1’’ = 1110110101 s2’ = 1110110101(s3) s2’’ = 1111010101 s3’ = 1110111101(s5) s3’’ = 1110111101 s4’ = 0111000101 (s2) s4’’ = 0111000101 s5’ = 0100010011 (s4) s5’’ = 0100011101 s6’ = 1110111101 (s5) s6’’ = 1110110011
  • 31. Genetic Algorithm (GA) >> Mutation 31 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU ▸For each bit that we are to copy to the new population we allow a small probability of error (for example 0.1) s1’’ = 1110110101 s1’’’ = 1110100101 s2’’ = 1111010101 s2’’’ = 1111110100 s3’’ = 1110111101 s3’’’ = 1110101111 s4’’ = 0111000101 s4’’’ = 0111000101 s5’’ = 0100011101 s5’’’ = 0100011101 s6’’ = 1110110011 s6’’’ = 1110110001 Go through the same process all over again, until a stopping criterion is met.
  • 32. Genetic Algorithm (GA) >> Previous Question 32 Mohammad Imam Hossain | Lecturer, Dept. of CSE | UIU
  • 33. 33 THANKS! Any questions? You can find me at imam@cse.uiu.ac.bd