Informed Search Techniques 2

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 18

Informed Search Techniques

Contents

 What is Informed Search ?


 Role of Heuristic function
 Evolutionary algorithm
 What is Genetic Algorithm ?
 Operators of GA
 Illustration of GA – MAXONE problem
 References
What is informed search ?

 Informed search (also called directed search and heuristic search), tries to
reduce the amount of search that must be done by making intelligent choices
for the nodes that are selected for expansion.
 Informed search strategies use problem-specific knowledge to find solution
faster
Heuristic functions

 A heuristic function is used to evaluate the promise of a state.


 Evaluation function is an estimate of the cost of the cheapest path from the
(current) state to a goal state. Functions that calculate such estimates are
called heuristic functions.
 Heuristic functions are problem-specific.
 The principal advantage of using a heuristic function is the reduction of the
state space. For example, the full tree for Tic-Tac-Toe has 9! leaves. If we
consider symmetries, the tree becomes six times smaller.
Evolutionary Algorithm
 Now days, the complexity of real world application is increased
substantially. The problems like decision making are very complex and hard
to solve[1].
 An approach suggested to tackle such complex problems inspired by
Darwinian natural evolution is referred as Evolutionary Computations.

Optimization Problems
 Instead of considering the whole state space, consider only the current state
 Limits necessary memory; paths not retained
 Amenable to large or continuous (infinite) state spaces where exhaustive search

 algorithms are not possible
 Local search algorithms can’t backtrack
Genetic Algorithm
 Proposed by John Holland.
 Based on Natural Selection – best genes are carried forward.
 Adaptive heuristic search algorithm.
 Abstraction of real biological evolution.
 Used to solve complex problems(NP hard, TSP, 0/1 knapsack)
 Mainly focuses on finding global optimal solution amongst the population.
 Survival of the fittest- best chromosome is carried forward.
 Phenotype is raw solution which is encoded to genotype for fine tuning

Phenotype Genotype
Genetic VS Non-Genetic Algorithms

Genetic Algorithm Non-Genetic Algorithm


Genetic and natural selection to solve Step by step procedure to solve the
optimization problem given problem
Probabilistic Rules Fully deterministic rules
Search on a population of points Search on a single point
More advanced algorithm which is used Not as advanced as genetic algorithm
in fields like AI, ML.
How Genetic algorithm works ?
Population Initialisation
 Population is a subset of solutions in the current generation. It can also be
defined as a set of chromosomes.
 Population Initialization
Random Initialization − Populate the initial population with completely
random solutions.
Heuristic initialization − Populate the initial population using a known
heuristic for the problem.
Selection
 The fitness function simply defined is a function which takes a candidate
solution to the problem as input and produces as output how “fit” our how
“good” the solution n is with respect to the problem in consideration.

Fitness Proportionate Selection


 In this every individual can become a parent with a probability which is
proportional to its fitness.
 Roulette Wheel Selection
 Random Selection
Crossover
 The crossover operator is analogous to reproduction and biological crossover.
In this more than one parent is selected and one or more off-springs are
produced using the genetic material of the parents. Crossover is usually
applied in a GA with a high probability – pc 
 One Point Crossover- In this one-point crossover, a random crossover point is
selected and the tails of its two parents are swapped to get new off-springs.

 Multi Point Crossover is a generalization of the one-point crossover wherein


alternating segments are swapped to get new off-springs.
Mutation
 Mutation is defined as a small random tweak in the chromosome, to get a new
solution.
 It is used to maintain and introduce diversity in the genetic population and is
usually applied with a low probability – pm.
 Bit Flip Mutation

 Swap Mutation

 Inversion Mutation
Termination Condition

 The termination condition of a Genetic Algorithm is important in determining


when a GA run will end.
 Usually, we keep one of the following termination conditions −
1. When there has been no improvement in the population for X iterations.
2. When we reach an absolute number of generations.
3. When the objective function value has reached a certain pre-defined value.
Illustration - MAXONE problem
 Problem - maximize the number of ones in a string of l binary digits
 We start with a population of n random strings. Suppose that l = 10 and n = 6
1. Initialization
We toss a fair coin 60 times and get the following initial population:
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
 Selection
We randomly (using a biased coin) select a subset of the individuals
based on their fitness:

 Selected set
s1 ` = 1111010101 (s1 )
s2 ` = 1110110101 (s3 )
s3 ` = 1110111101 (s5 )
s4 ` = 0111000101 (s2 )
s5 ` = 0100010011 (s4 )
s6 ` = 1110111101 (s5 )
 Crossover
1. Now mate strings for crossover.
2. If we decide to actually perform crossover, we randomly extract the
crossover points, for instance 2 and 5
 Before crossover:
s1 ` = 1111010101 s2 ` = 1110110101
 After crossover:
s1 `` = 1110110101 s2 `` = 1111010101
 Mutations
The final step is to apply random mutations: for each bit that we are to copy
to the new population we allow a small probability of error (for instance 0.1)
Initial strings After mutating
s1 `` = 1110110101 s1 ``` = 1110100101 f(s1)= 6
s2 `` = 1111010101 s2 ``` = 1111110100 f(s1)= 7
s3 `` = 1110111101 s3 ``` = 1110101111 f(s1)= 8
s4 `` = 0111000101 s4 ``` = 0111000101 f(s1)= 5
s5 `` = 0100011101 s5 ``` = 0100011101 f(s1)= 5
s6 `` = 1110110011 s6 ``` = 1110110001 f(s1)= 6

And now, iterate … In one generation, the total population fitness


changed from 34 to 37, thus improved by ~9% At this point, we go
through the same process all over again, until a stopping criterion
is met
References
[1] Evolutionary Algorithms: A Critical Review and its Future Prospects
[2] Carnegie Mellon University – genetic algorithm.
[3] Genetic-Algorithm-Guide-Tom-Mathew.pdf
[4] Shir, Ofer M. (2012). "Niching in Evolutionary Algorithms". In Rozenberg,
Grzegorz; Bäck, Thomas; Kok, Joost N. (eds.). Handbook of Natural
Computing. Springer Berlin Heidelberg. pp. 1035–1069. doi:10.1007/978-3-
540-92910-9_32. ISBN 9783540929093.

You might also like