You are on page 1of 37

Evolutionary Algorithms

A presentation by:
Prof. M K Tiwari
IIT Kharagpur
Challenging Optimization Problems

Blending: Petroleum, feed, and metals industries.


Supply chain design in multiple industries.
Cutting stock: Paper, metals, and clothing industries.
Financial Portfolio models of all sorts: Cardinality and min-buy
constraints, Value-at-risk.
Electric Power: Nonlinear Optimal Power Flow, and Hydro/Generator
Scheduling/unit commitment.
Auction and market clearing: Electric power and gas distribution, class
scheduling.
Advertising and Marketing: Media selection, Sales territory realignment,
Sales call planning.
Challenging Optimization Problems

Revenue/booking limits Management, Overbooking limits, Bundle


Pricing, Credit scoring and Classification, Shelf space allocation.
Staff scheduling: Call center management, health and maintenance
personnel management.
Planning under uncertainty: Financial planning, fuel purchasing, and the
auto industry.
Resource extraction long range planning: Mining and petroleum
production.
Routing: Determine which stops should be assigned to each truck and the
order of stops.
Purchasing: Determine amount to buy from each vendor, given their price/
discount terms.
Overview of Talk

Introduction

Stochastic Search Techinques


• Genetic Algorithm
• Simulated Annealing
• Tabu Search
• Ant Colony Optimization

References
Introduction

Nature is full of complex systems studied from different angles with different
objectives.

Complex Systems

• To understand the working • To simulate the complex


mechanism of Complex behavior of system
Systems
• Formulate a problem solving
• E.g. To know the factor strategy for hard
contributing to the ups and downs
computational problem.
in share prices
• To identify the factors affecting a • E.g. Global Optimization.
machine.
General Optimization Strategies

Computer Scientists and Mathematicians have formulated


various algorithms based on Natural Phenomenon to solve
their problem.
One want to be able to Predict, Reconstruct and Deploy a
Complex System.
Optimization Strategies 
• To solve hard computational problem
• Characterize the behavior of Complex Systems.
General Optimization Strategies

Optimization Algorithms

Enumerative schemes Stochastic algorithms


(implicit methods)
Each possible solution is evaluated

Most Common because of cost


effectiveness and time
Deterministic algorithms efficiency
Stochastic Optimization

Goals:
These are also termed as intelligent search techniques and simulate the
natural processes to solve Hard Optimization problems.

Models are built by abstracting the working mechanism of naturally robust


phenomenon.

Typical Examples are


• Genetic Algorithm

• Simulated Annealing

• Tabu Search

• Ant Colony Algorithm


Genetic Algorithm
Genetic Algorithm

 “Genetic Algorithms are good


at taking large, potentially
huge search spaces and
navigating them, looking for
optimal combinations of
things, solutions you might
not otherwise find in a
lifetime.”
 - Salvatore Mangano
 Computer Design, May 1995
Genetic Algorithm

 Genetic Algorithm is an “Intelligent Search Technique”


that maintains a “Population of Candidate Solutions” for
the problem at hand and search the solution space by
applying “Variation Operators”
Genetic Metaphor
Nature Genetic Algorithm

Environment Optimization Problem

Individuals Feasible Solution

Individual’s Adaptation Solution Quality

Population of Organisms i.e. species Set of Feasible Solution

Selection, Recombination & Reproduction Variation Operator


Genetic Algorithm

 Genetic Algorithm: An Introduction


 Inspired by “Natural evolution”

 Contains population of “individuals”

 An individual is a feasible solution to the problem

 Each Individual is characterized by a fitness function

 Higher the fitness, better the individual

 Based upon the fitness, parents are selected to produce

offspring for next generation.


 Fitter individuals has more chance to reproduce.

 Offspring contains the characteristic of both parents

 If well designed, population will converge Faster.


Genetic Algorithm

Basic Terminologies
A Chromosome

A Gene

A Population set
Genetic Algorithm

Basic Terminologies
A Chromosome
Population

1 0 0 1 1 1 0

0 0 1 1 1 0 0

A Gene
Genetic Algorithm

Basic Terms:
• An Individual is characterized by set of parameter called
as “genes”
• The combination of gene forms a string called as
“Chromosome”
• Chromosome forms the “genotype”
Genotype contains all information to construct an organism: A
Phenotype
• Reproduction is a process on chromosome of genotype
• Fitness in real world equivalent to the phenotype’s
struggle for life.
Genetic Algorithm

EVOLUTIONARY
STEPS
Selection Modification Evaluation

• Based upon • Application • Final


the fitness, of Variation fitness of
individuals operators to the
of the generate a individuals
population set of are
are selected offspring evaluated
for further and, less
modificatio fitter
n individuals
are
discarded
Genetic Algorithms (GA)

Outline of the steps involved in GA


• Encoding
• Initialization
• Reproduction
• Selection
• Termination Criteria
Step 1: Encoding Problem

How to encode a solution of the problem into


chromosome ?
• Types of Encoding
 Binary coding 1 0 0 1 1 1 0 1
– Difficult to apply directly
– Not a natural coding

2.3352 5.3252 6.2895 4.1525


 Real number coding
– Mainly for constrained optimization problems

3 5 1 2 4 8 7 6
 Integer coding
– For combinatorial optimization problems
– Ex. Quadratic Assignment Problems
Step 1: Encoding Problem (Cont.)

Coding Space and Solution Space

Decoding

Coding Space
Genetic Operations Solution Space
Evaluation and Selection

Encoding
Step 1: Encoding Problem (Cont.)


Critical issues with encoding
• Feasibility of a chromosome
 solution decoded from a chromosome lies in a feasible region of

the problem
• Legality of a chromosome
 chromosomes represents a solution to a problem

• Uniqueness of mapping (Between Chromosomes and solution to the


problem)
 1 - n mapping (Undesired mapping)

 n – 1 mapping (Undesired mapping)

 1 – 1 mapping (Desired mapping)


One chromosome
represents only one
solution to the
problem
Step 1: Encoding Problem (Cont.)

l one
a
illeg
Coding Space
Solution Space
infeasible one
Feasible space

feasible o
ne

Coding Space
1 -n mapping
Solution Space
g
n -1 mappin

1 -1 mapping
Step 2: Initialization

Create initial population of solutions


• Randomly
• Local search
• Feasible Solutions
For optimization problem
• Minimize: F (x1, x2, x3)
• Binary encoding

1 0 1 1 0 0 1 1 1 0 0 1

x1 x2 x3
Step 2: Initialization (Cont.)

• Population of solutions
• Fitness of solutions are evaluated (= objective
function) Solution No. Fitness values
1 0 1 0 0 1 0 1 1 0 1 0 1 13.2783
0 1 1 0 1 0 1 0 0 1 0 1 2 20.3749
0 0 1 0 1 0 1 1 1 1 0 0 3 19.8302
Chromosomes

0 1 0 1 0 0 1 0 0 0 1 1 4 52.9405
1 0 0 0 1 0 1 0 1 0 0 1 5 25.8202
1 0 1 1 1 1 0 0 0 0 1 1 6 36.0282
0 0 1 0 1 0 1 1 0 1 1 0 7 70.9202
0 1 1 1 1 0 0 1 1 1 0 1 8 38.9022
0 1 0 1 0 1 0 1 1 0 0 1 9 29.0292
1 0 0 0 1 1 1 1 1 1 0 0 10 21.9292
Step 3: Reproduction

Crossover operation (Based on


crossover probability) Crossover Points

• Select parents from population Parent 1


based on crossover probability
Parent 2
• Randomly select two points
between strings to perform
crossover operation
• Perform crossover operations on Offspring 1
selected strings
• Known for Local search Offspring 2
operation
Step 3: Reproduction (Cont.)

For the example of optimization problem


• Let the crossover probability be 0.8
Solution Selected
Solution For crossover
No. operation
1 1 0 1 0 0 1 0 1 1 0 1 0 0.9502 > 0.8 NO

2 0 1 1 0 1 0 1 0 0 1 0 1 0.2191 < 0.8 YES

3 0 0 1 0 1 0 1 1 1 1 0 0 0.4607 < 0.8 YES

4 0 1 0 1 0 0 1 0 0 0 1 1 0.6081 < 0.8 YES

5 1 0 0 0 1 0 1 0 1 0 0 1 0.8128 > 0.8 NO

6 1 0 1 1 1 1 0 0 0 0 1 1 0.9256 > 0.8 NO

7 0 0 1 0 1 0 1 1 0 1 1 0 0.7779 < 0.8 YES

8 0 1 1 1 1 0 0 1 1 1 0 1 0.4596 < 0.8 YES

0 1 0 1 0 1 0 1 1 0 0 1 0.9817 > 0.8 NO


9
1 0 0 0 1 1 1 1 1 1 0 0 0.7784 < 0.8 YES
10
Chromosomes Random values [0,1]
Step 3: Reproduction (Cont.)

Solution
Parents Selected Offspring
Selected
2 0 1 1 0 1 0 1 0 0 1 0 1 0 1 1 0 1 0 1 1 0 1 0 1
3 0 0 1 0 1 0 1 1 1 1 0 0 0 0 1 0 1 0 1 0 1 1 0 0

4 0 1 0 1 0 0 1 0 0 0 1 1 0 1 0 1 0 0 1 1 0 1 1 1
7 0 0 1 0 1 0 1 1 0 1 1 0 0 0 1 0 1 0 1 0 0 0 1 0

Crossover Points

8 0 1 1 1 1 0 0 1 1 1 0 1 0 1 0 0 1 0 0 1 1 1 0 1
10 1 0 0 0 1 1 1 1 1 1 0 0 1 0 1 1 1 1 1 1 1 1 0 0
Step 3: Reproduction (Cont.)

Mutation operation (based on mutation probability


pm)

• each bit of every individual is modified with probability


pm

• main operator for global search (looking at new areas of


the search space)

•p m usually small {0.001,…,0.01}


 rule of thumb pm = 1/no. of bits in chromosome
Step 3: Reproduction (Cont.)

ith solution string from the population


For optimization
problem 0 0 1 0 1 0 1 1 0 1 0 0

Minimize: F (x1, x2, x3)


0.12 0.57 0.62 0.31 0. 01 0.73 0.83 0.63 0.02 0.26 0.94 0.63
Let pm = 1/12 = 0.083
Generate Random
number [0,1] for each Mutation
bit
Select bits having
probability less than 0 0 1 0 11 0 1 1 00 1 0 0
pm
Interchange the bits
with each other
Step 4: Selection (“Survival of the fittest”)

Directs the search Population


(pop_size)
towards promising
regions in the search Crossover operation

space Mutation operation


Basic issues involved
in selection phase:
• Sampling space:
Parents and Offspring
 Regular sampling
space: all offspring +
few parent = pop_size
Offspring produced
Step 4: Selection (“Survival of the fittest”) (Cont.)

Basic issues involved in selection phase:


• Sampling space:
 Enlarged sampling space: All offspring + All parent

Crossover operation

Population
(pop_size) Mutation operation

Offspring produced
Step 4: Selection (“Survival of the fittest”) (Cont.)

Selection probability for kth individual


Sampling
fk
Mechanism: How to pk  pop _ size
select chromosomes  fj
j 1
from sampling space
Based on pk, cumulative probability is
Basic approaches calculated, and roulette wheel is
Stochastic Samplings constructed
Roulette Wheel Zone of kth
selection: individual
 To determine survival
probability proportional to
the fitness value
 randomly generate a
number between [0,1]
and select the individual
fk is the fitness value of kth individual
Step 4: Selection (“Survival of the fittest”) (Cont.)

Deterministic Samplings:
• select best pop_size individuals from the parents and offspring
• No duplication of the individuals
Mixed Samplings:
• both random and deterministic samplings are done
Step 5: Termination Criteria
Repeating the above steps until the termination criteria is not
satisfied
Termination criteria
 maximum number of generations
 no improvement in fitness values for fixed generation
Summary of Genetic Algorithms

Begin
{
initialize population;
evaluate population;
while (TerminationCriteriaNotSatisfied)
{
select parents for reproduction;
perform Crossover and mutation;
evaluate population;
}
}
Issues for GA Practitioners

Choosing basic implementation issues:


• Encoding
• Population size, Mutation rate, Crossover rate …..
• Selection, Deletion policies
• Types of Crossover, Mutation operators
Termination Criteria
Performance, scalability
Solution is only as good as the evaluation function
(often hardest part)
Benefits of Genetic Algorithms

Concept is easy to understand


Modular, separate from application
Supports multi-objective optimization
Good for “noisy” environments
Always an answer; answer gets better with time
Inherently parallel; easily distributed
Many ways to speed up and improve a GA-based application as knowledge
about problem domain is gained
Easy to exploit previous or alternate solutions
Flexible building blocks for hybrid applications
Substantial history and range of use
When to Use a GA

Alternate solutions are too slow or overly


complicated
Need an exploratory tool to examine new approaches
Problem is similar to one that has already been
successfully solved by using a GA
Want to hybridize with an existing solution
Benefits of the GA technology meet key problem
requirements
Some GA Application Types

Domain Application Types

Control gas pipeline, pole balancing, missile evasion, pursuit

Design semiconductor layout, aircraft design, keyboard configuration,


communication networks

Scheduling manufacturing, facility scheduling, resource allocation

Robotics trajectory planning

Machine Learning designing neural networks, improving classification algorithms, classifier


systems

Signal Processing filter design

Game Playing poker, checkers, prisoner’s dilemma

Combinatorial set covering, travelling salesman, routing, bin packing, graph colouring
and partitioning
Optimization

You might also like