SlideShare a Scribd company logo
Introduction to Genetic
Algorithm (GA)
Presented By: Rabiya Khalid
Student of MS(CS)
Research Domain: Energy management in Smart Grid
Supervised By: Dr. Nadeem Javaid
GA (1/30)
• Introduction [1]
– Based on Darwin’s theory of evolution
– Used to find true or approximate solution
– Solves optimization based problems
– Techniques inspired by evolutionary biology
o Inheritance
o Mutation
o Selection
o Crossover
• History
– Evolutionary computing evolved in the 1960’s by I.Rechenberg
– GA’s were invented by John Holland in the mid-70’s.
2
[1]: Eiben, Agoston E., P-E. Raue, and Zs Ruttkay. "Genetic algorithms with multi-parent recombination."
In International Conference on Parallel Problem Solving from Nature, pp. 78-87. Springer Berlin
Heidelberg, 1994
GA (2/30)
3
[2]
[2]: Boultif, Ayache, Azeddine Kabouche, and Segni Ladjel. "Application of Genetic Algorithms (GA) and
Threshold Acceptance (TA) to a Ternary Liquid-Liquid Equilibrium System." International Review on
Modelling and Simulations (IREMOS) 9, no. 1 (2016): 29-36.
• Lets learn biology first [3]
– Our body is made up of trillions of cells
– Each cell has a core structure (nucleus)
that contains chromosomes
– Each chromosome is made up of tightly
coiled strands of deoxyribonucleic acid
(DNA)
– Genes are segments of DNA that
determine specific traits, such as
• Eye color
• Hair color
– A gene mutation is an alteration in DNA
– It can be inherited or acquired during
your lifetime
– Some changes in genes result in genetic
disorders.
GA (3/30)
4
[3]: http://www.yourgenome.org/facts/what-is-evolution (accessed:1Feb2017)
• Natural selection [4]
– Only the organisms best adapted to their environment tend to
survive
– Transmit their genetic characteristics in increasing numbers to
succeeding generations
– Those less adapted tend to be eliminated
• GA is inspired from nature [5]
– A genetic algorithm maintains
o Population of candidate solutions for the problem
o Makes it evolve by iteratively applying a set of stochastic operators
GA (4/30)
5[4]: https://www.doc.ic.ac.uk/~nd/surprise_96/journal/vol1/hmw/article1.html (accessed:1Feb2017)
[5]: https://en.wikipedia.org/wiki/Genetic_algorithm (accesed:1Feb2017)
GA (5/30)
6
[6]
[6]: http://mainroach.blogspot.com/2013/07/css-compression-genetic-minification.html
(accessed:1Feb2017)
• Key terms [7]
– Individual
o Any possible solution
– Population
o Group of all individuals
– Search Space
o All possible solutions to the problem
– Chromosome
o Blueprint for an individual
– Trait
o Possible aspect (features) of an individual
– Allele
o Possible settings of trait (black, blond, etc.)
– Locus
o The position of a gene on the chromosome
– Genome
o Collection of all chromosomes for an
individual
GA (6/30)
7
[7]: http://geneticalgorithms.ai-depot.com/Tutorial/Overview.html (accessed:1Feb2017)
• GA requirements
– A genetic representation of the solution domain (set search
space)
– A fitness function to evaluate the solution domain (objective
function according to system model in case of smart grid)
• Representation [8]
– Chromosomes could be
• Bit strings (0101 ... 1100)
• Real numbers (43.2 -33.1 ... 0.0 89.2)
• Permutations of element (E11 E3 E7 ... E1 E15)
• Lists of rules (R1 R2 R3 ... R22 R23)
• Program elements (genetic programming)
• ... any data structure ...
GA (7/30)
8[8]: http://www.obitko.com/tutorials/genetic-algorithms/ga-basic-description.php
(accessed:1Feb2017)
• Algorithm
1. Initialization
2. Generate population
3. Evaluate fitness
4. While gen<max_gen do
5. Select two parents
6. Crossover
7. Mutation
8. Evaluate fitness
9. Elitism
10. End
GA (8/30)
9
• Fitness function [7]
– The fitness function is always problem dependent
– Assigns fitness value to the individual
– It summarizes, how close a solution is to achieving the set aims
GA (9/30)
10
• Selection [7]
– Darwinian survival of fittest
– More preference to get better guys
– Ways to select
• Roulette wheel
• Tournament
• Truncation
– By itself, pick best
• Roulette wheel
– Probability of selection is assigned to individuals based on their
fitness value
– Two parents are selected randomly from set of individuals with high
selection probability
– Selected parents are used to produce off-springs
GA (10/30)
11
[9]
• Crossover [7]
– Single point crossover
– Two point crossover
– Uniform crossover
GA (11/30)
12
GA (12/30)
• Mutation [7]
– String subjected to mutation
after crossover
– It prevents falling all solutions
into local optimum
– It alters bits of chromosomes
to make the string better
– Bit wise mutation is
performed with probability of
mutation Po
– A random number ro is
generated and compared
with Po
– If Po>ro , then mutation
occurs
• Types of mutation
– Bit inversion
o Selected bits are inverted
– Order changing
o The number are selected and
exchanged
13
• Elitism
– Elitism involves copying a small proportion of the fittest
candidates, unchanged, into the next generation
– EA does not waste time re-discovering previously discarded
partial solutions
• Search space
– The set of solutions among which the desired solution resides
– Best solution among a number of possible solutions
– Represented by one point in the search space
GA (13/30)
14
• Advantages of GA [10]
– Concepts are easy to understand
– Always an answer; answer gets better with time
– Less time required for some special applications
– Chances of getting optimal solution are more
• Limitations [11]
– The population considered for the evolution should be moderate or
suitable
– One for the problem (normally 20-30 or 50-100)
– Crossover rate should be 80%-95%
– Mutation rate should be low i.e. 0.5%-1% assumed as best
– The method of selection should be appropriate
– Writing of fitness function must be accurate
GA (14/30)
15
[10]: Kim, Dong Hwa, Ajith Abraham, and Jae Hoon Cho. "A hybrid genetic algorithm and bacterial
foraging approach for global optimization." Information Sciences 177, no. 18 (2007): 3918-3937.
[11]: Morris, Garrett M., David S. Goodsell, Robert S. Halliday, Ruth Huey, William E. Hart, Richard K.
Belew, and Arthur J. Olson. "Automated docking using a Lamarckian genetic algorithm and an empirical
binding free energy function." Journal of computational chemistry 19, no. 14 (1998): 1639-1662
GA (15/30)
16
[12]
[12]: https://www.youtube.com/watch?v=ejxfTy4lI6I (accessed:2Feb2017)
GA (16/30)
17
GA (17/30)
18
GA (18/30)
19
GA (19/30)
20
GA(20/30)
21
GA (21/30)
22
GA (22/30)
23
GA (23/30)
24
GA (24/30)
25
GA (25/30)
26
GA (26/30)
27
GA (27/30)
28
GA (28/30)
29
GA (29/30)
30
GA(30/30)
31
• Appliances
• Home appliances are divided into
3 types
– Fixed appliances
– Shiftable appliances
– Elastic appliances
• This categorization is based on
– Power consumption pattern
– Time of use
– User comfort
32
Appliances Power
rating
Fan 0.6
Lights 0.75
Clothes iron 1.5
Microwave
oven
1.18
Toaster 0.5
Coffee
maker
0.8
[13]: Exploiting heuristic algorithms to efficiently utilize energy management controllers with renewable
energy sources", Energy and Buildings, Volume 129, 1 October 2016, Pages 452-470, ISSN 0378-7788,
Energy Optimization by GA (1/15) [13]
1. Fixed Appliances
– Regular appliances (basic
load)
– LOT cannot be modified
2. Shiftable appliances
– Can be shifted without
altering their load profile
– User specifies an operational
time interval for these
appliances
3. Elastic appliances
– Interruptible appliances
– Load profile can be modified
– Can be shifted to a suitable
time slot
33
Appliances Power
rating
Start
time
End
time
AC 1.44 6 24
refrigerator 0.73 6 24
Water
heater
4.45 6 24
Space
heater
1.50 6 24
Appliances Power
rating
Start
time
End
time
Waiting
time
Washing
machine
0.78 3 16 5
Dish washer 3.60 3 12 5
Cloth dryer 4.40 3 18 5
Energy Optimization by GA (2/15) [13]
• Pricing schemes
• TOU pricing scheme [14]
– Prices set for on peak and off peak
hours
– Hours are divided into blocks
– Each block has fixed price
• IBR pricing scheme [15]
– Prices are divided into several
blocks
– First block is at the lowest
electricity price
– With the increment in electricity
consumption price also increased
34
0
2
4
6
8
10
12
14
16
18
20
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
TOU
[14]: Waterloo North Hydro, https://www.wnhydro.com/en/your-
home/time-of-use-rates.asp. Last visited: 20 May 2016.
[15]: http://www.prepayment.eskom.co.za/IBT.asp
Energy Optimization by GA (3/15) [13]
35
• Pricing schemes
• Real time Pricing scheme (RTP) [14]
• Rates are based on hourly
consumption of electricity
• Utility regulates RTP into two parts
1. Base bill: It depends on customer’s
base load (CBL)
2. Hourly prices: Hourly prices are
applied according to customer’s
usage (difference between actual
and CBL)
0
5
10
15
20
25
30
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
RTP
Price
Unit
if Load<=Limit
Price
Unit
+Extra changes if Load>Limit
RTP =
Energy Optimization by GA (4/15) [13]
36
• Pricing schemes
• Variable Peak Pricing (VPP) [14]
• Critical Peak Pricing(CPP) [14]
• During power system emergency
conditions
• Usually occurs in hot summer week
days
• CPR [14]
• During critical events utility
increases price
• Refunds customer when demand
decreases
0
20
40
60
80
100
120
140
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
CPP
Energy Optimization by GA (5/15) [13]
• GA parametric list
• Input parameters for GA
• These inputs are problem dependent
• Values of these parameters can be changed to tune the
algorithm
• Following table shows values of parameters for our problem
37
Parameters Values
Population size 200
Selection Random selection
Crossover 0.8%
Mutation 0.2%
Stopping criteria Max.generation
Max.generation 800
Energy Optimization by GA (6/15) [13]
38
GA parameters General use HEM’s parameters
Individual Any possible solution On-off status of appliances
in a time slot
Population Group of all individuals Collection of all individuals
Search Space All possible solutions to the
problem
Any values in constraint
defined limits
Chromosome Blueprint for an individual Time slot of an hour
Allele Possible settings of trait
(black, blond, etc.)
Characteristics of defined
system to satisfy
optimization limits e.g 0/1
Locus The position of a gene on
the chromosome
Location of an appliance
Genome Collection of all
chromosomes for an
individual
Binary on /off (1/ 0) states
arrays for each appliance
Energy Optimization by GA (7/15) [13]
• Generate population
39
Washing
machine
Dish
washer
Cloth
dryer
Air
conditioner
Water
heater
1 0 0 1 0
0 1 1 1 1
1 1 0 0 1
1 0 0 1 1
1 1 1 0 0
0 1 0 1 1
1 1 0 1 0
for j=1:popsize
for i=1:tbits
if rand(1)>=0.1
X=1;
else
X=0;
end
pop(j,i)=X;
end
c=zeros(1,10);
if pop(j,:)==c
pop(j,:)= ones(1,10);
end
end
Energy Optimization by GA (8/15) [13]
• Evaluate Fitness
40
Washing
machine
Dish
washer
Cloth
dryer
Air
conditioner
Water
heater
Fitness
1 0 0 1 0 5.592
0 1 1 1 1 7.92
1 1 0 0 1 8.53
1 0 0 1 1 10.5
1 1 1 0 0 5.026
0 1 0 1 1 8.259
1 1 0 1 0 6.842
for t=1:24
for a=1:popsize
F(a,1)=electricity_cost*x(a,:)';
err=c_electricity_cost*x(a,:)'-d;
F(a,1)=F(a,1)+1000*abs(err);
end
end
Energy Optimization by GA (9/15) [13]
• Select best solution
41
Washing
machine
Dish
washer
Cloth
dryer
Air
conditioner
Water
heater
Fitness
1 0 0 1 0 5.592
0 1 1 1 1 7.92
1 1 0 0 1 8.53
1 0 0 1 1 10.5
1 1 1 0 0 5.026
0 1 0 1 1 8.259
1 1 0 1 0 6.842
Best
solution
Energy Optimization by GA (10/15) [13]
• Crossover
cpoint=floor(nn*rand);
if cpoint==0
cpoint=randi(10,1,1);
end
c=[a(1:cpoint) b(cpoint+1:end)];
d=[b(1:cpoint) a(cpoint+1:end)];
42
Washing
machine
Dish
washer
Cloth
dryer
Air
conditioner
Water
heater
1 0 1 0 0
0 1 0 1 0
1 1 1 1 1
1 0 0 0 0
1 1 1 0 0
0 1 1 0 0
1 1 1 1 1
New Population after crossover
Energy Optimization by GA (11/15) [13]
• Mutation
j=floor(rand*nn);
k=a(j);
if k==1
a(j)=0;
else
if k==0
a(j)=1;
end
end
43
Washing
machine
Dish
washer
Cloth
dryer
Air
conditioner
Water
heater
1 0 1 0 0
0 0 0 1 0
1 1 0 1 1
1 0 0 1 0
1 1 1 1 0
0 1 0 0 0
1 1 0 1 1
New Population after mutation
Energy Optimization by GA (12/15) [13]
• Comparison
– Check if all appliances are in off state in any individual
– Compare new population with appliances’ data
• Whether an appliance has finished it LOT
• What is the remaining waiting time of an appliance
for a=1:popsize
for bs=1:tbit
if time_slots(1,b)==0
popnew(a,b)=0;
end
if lgen<=time_slots(1,b)
popnew(a,b)=1;
end
end
z=zeros(1,10);
o=ones(1,10);
if popnew(a,:)=0;
popnew(a,:)=o;
end
end
44
Energy Optimization by GA (13/15) [13]
• Evaluate Fitness of updated population
45
Washing
machine
Dish
washer
Cloth
dryer
Air
conditioner
Water
heater
Fitness
1 0 1 0 0 5.592
0 0 0 1 0 7.92
1 1 0 1 1 8.53
1 0 0 1 0 10.5
1 1 1 1 0 9.026
0 1 0 0 0 8.259
1 1 0 1 1 6.842
Best
solution
Energy Optimization by GA (14/15) [13]
• Elitism
– After evaluating the new population
• New best solution is compared with previous best solution
• If fitness of new best solution is better
– It is copied as global best
– Else global best solution remains unchanged
if gbest>best
gbest=best;
end
– Algorithm will terminate when termination criteria
will be satisfied
46
Energy Optimization by GA (15/15) [13]
47

More Related Content

PPTX
Genetic Algorithm
PPTX
Genetic algorithm raktim
PPTX
Genetic Algorithm by Example
PPT
Genetic algorithms
PPT
Genetic Algorithms
PPTX
Genetic algorithm
PPTX
Genetic Algorithm
PDF
Genetic Algorithms
Genetic Algorithm
Genetic algorithm raktim
Genetic Algorithm by Example
Genetic algorithms
Genetic Algorithms
Genetic algorithm
Genetic Algorithm
Genetic Algorithms

What's hot (20)

PPTX
Genetic Algorithm
PDF
Genetic Algorithms
PPTX
Decision Trees
PPTX
Hyperparameter Tuning
PPT
Introduction to Genetic algorithms
PPT
Machine Learning 3 - Decision Tree Learning
PDF
Introduction to Optimization with Genetic Algorithm (GA)
PPTX
Genetic algorithm
PDF
Genetic Algorithms Made Easy
PPT
Genetic algorithm
PPTX
Genetic algorithm
PPTX
Genetic Algorithms
PPTX
implementation of travelling salesman problem with complexity ppt
PDF
Genetic Algorithm (GA) Optimization - Step-by-Step Example
PPT
Evolutionary-Algorithms.ppt
PPT
Soft computing06
PPTX
Artificial Intelligence Searching Techniques
PPTX
MACHINE LEARNING - GENETIC ALGORITHM
PPTX
GENETIC ALGORITHM
PPT
Backtracking
Genetic Algorithm
Genetic Algorithms
Decision Trees
Hyperparameter Tuning
Introduction to Genetic algorithms
Machine Learning 3 - Decision Tree Learning
Introduction to Optimization with Genetic Algorithm (GA)
Genetic algorithm
Genetic Algorithms Made Easy
Genetic algorithm
Genetic algorithm
Genetic Algorithms
implementation of travelling salesman problem with complexity ppt
Genetic Algorithm (GA) Optimization - Step-by-Step Example
Evolutionary-Algorithms.ppt
Soft computing06
Artificial Intelligence Searching Techniques
MACHINE LEARNING - GENETIC ALGORITHM
GENETIC ALGORITHM
Backtracking
Ad

Viewers also liked (20)

PPT
Genetic Algorithms - Artificial Intelligence
PPTX
Introduction to Genetic Algorithms
PDF
OPTIMAL ECONOMIC LOAD DISPATCH USING FUZZY LOGIC & GENETIC ALGORITHMS
PDF
Genetic Algorithm for Solving the Economic Load Dispatch
PDF
Prix logos
PPT
ZIG ZAG FEEDER
PDF
Amiina Bakunowicz: Genetic Algorithm, Fitness vs Crossover vs Mutation
PDF
Hybrid Approach to Economic Load Dispatch
PDF
A review
PDF
Recognize learning with the ELD method
PDF
Economic Load Dispatch Optimization of Six Interconnected Generating Units Us...
PDF
Ll1411
PPT
PDF
Toward a Natural Genetic / Evolutionary Algorithm for Multiobjective Optimiza...
PPTX
A multilevel automatic thresholding method based on a genetic algorithm for a...
PPTX
Advance operator and technique in genetic algorithm
PPTX
Newton raphson
PPTX
Edge detection using evolutionary algorithms new
PPTX
Lecture 28 genetic algorithm
PDF
Economic Dispatch of Generated Power Using Modified Lambda-Iteration Method
Genetic Algorithms - Artificial Intelligence
Introduction to Genetic Algorithms
OPTIMAL ECONOMIC LOAD DISPATCH USING FUZZY LOGIC & GENETIC ALGORITHMS
Genetic Algorithm for Solving the Economic Load Dispatch
Prix logos
ZIG ZAG FEEDER
Amiina Bakunowicz: Genetic Algorithm, Fitness vs Crossover vs Mutation
Hybrid Approach to Economic Load Dispatch
A review
Recognize learning with the ELD method
Economic Load Dispatch Optimization of Six Interconnected Generating Units Us...
Ll1411
Toward a Natural Genetic / Evolutionary Algorithm for Multiobjective Optimiza...
A multilevel automatic thresholding method based on a genetic algorithm for a...
Advance operator and technique in genetic algorithm
Newton raphson
Edge detection using evolutionary algorithms new
Lecture 28 genetic algorithm
Economic Dispatch of Generated Power Using Modified Lambda-Iteration Method
Ad

Similar to Genetic algorithm (20)

PPTX
PPTX
Genetic Algorithm
PPTX
2020 6 16_ga_introduction
PPT
Genetic algorithms
PPT
Genetic algorithms full lecture
PPT
Genetic algorithms
PPT
Genetic-Algorithms for engineering appl.ppt
PPT
Genetic-Algorithms SDSDa SDD dfsAFF fsaf
PPTX
GA of a Paper 2012.pptx
PDF
3_GO_Olesya_Genetic_AlgorithmsOPTIMZTION.p.pdf
PDF
Introduction to Genetic Algorithms and Evolutionary Computation
PDF
Genetic algorithm
PPTX
Genetic algorithm optimization technique.pptx
PPTX
Genetic Algorithm Fundamentals and Applications.pptx
PDF
Genetic algorithm fitness function
PDF
Comparison
PDF
Introduction to Genetic Algorithms 2014
PPTX
WIX3001 Lecture 6 Principles of GA.pptx
PPT
ga-2.ppt
PDF
09 genetic algorithms by Priyesh Marvi
Genetic Algorithm
2020 6 16_ga_introduction
Genetic algorithms
Genetic algorithms full lecture
Genetic algorithms
Genetic-Algorithms for engineering appl.ppt
Genetic-Algorithms SDSDa SDD dfsAFF fsaf
GA of a Paper 2012.pptx
3_GO_Olesya_Genetic_AlgorithmsOPTIMZTION.p.pdf
Introduction to Genetic Algorithms and Evolutionary Computation
Genetic algorithm
Genetic algorithm optimization technique.pptx
Genetic Algorithm Fundamentals and Applications.pptx
Genetic algorithm fitness function
Comparison
Introduction to Genetic Algorithms 2014
WIX3001 Lecture 6 Principles of GA.pptx
ga-2.ppt
09 genetic algorithms by Priyesh Marvi

Recently uploaded (20)

DOCX
Viruses (History, structure and composition, classification, Bacteriophage Re...
PPTX
EPIDURAL ANESTHESIA ANATOMY AND PHYSIOLOGY.pptx
PPTX
DRUG THERAPY FOR SHOCK gjjjgfhhhhh.pptx.
PDF
An interstellar mission to test astrophysical black holes
PDF
. Radiology Case Scenariosssssssssssssss
PPTX
G5Q1W8 PPT SCIENCE.pptx 2025-2026 GRADE 5
PDF
HPLC-PPT.docx high performance liquid chromatography
PDF
Sciences of Europe No 170 (2025)
PDF
Formation of Supersonic Turbulence in the Primordial Star-forming Cloud
PPTX
GEN. BIO 1 - CELL TYPES & CELL MODIFICATIONS
PPTX
Protein & Amino Acid Structures Levels of protein structure (primary, seconda...
PPTX
ANEMIA WITH LEUKOPENIA MDS 07_25.pptx htggtftgt fredrctvg
PPTX
7. General Toxicologyfor clinical phrmacy.pptx
PPTX
2. Earth - The Living Planet Module 2ELS
PPTX
Derivatives of integument scales, beaks, horns,.pptx
PDF
Phytochemical Investigation of Miliusa longipes.pdf
PDF
ELS_Q1_Module-11_Formation-of-Rock-Layers_v2.pdf
PPT
protein biochemistry.ppt for university classes
PDF
VARICELLA VACCINATION: A POTENTIAL STRATEGY FOR PREVENTING MULTIPLE SCLEROSIS
PPTX
microscope-Lecturecjchchchchcuvuvhc.pptx
Viruses (History, structure and composition, classification, Bacteriophage Re...
EPIDURAL ANESTHESIA ANATOMY AND PHYSIOLOGY.pptx
DRUG THERAPY FOR SHOCK gjjjgfhhhhh.pptx.
An interstellar mission to test astrophysical black holes
. Radiology Case Scenariosssssssssssssss
G5Q1W8 PPT SCIENCE.pptx 2025-2026 GRADE 5
HPLC-PPT.docx high performance liquid chromatography
Sciences of Europe No 170 (2025)
Formation of Supersonic Turbulence in the Primordial Star-forming Cloud
GEN. BIO 1 - CELL TYPES & CELL MODIFICATIONS
Protein & Amino Acid Structures Levels of protein structure (primary, seconda...
ANEMIA WITH LEUKOPENIA MDS 07_25.pptx htggtftgt fredrctvg
7. General Toxicologyfor clinical phrmacy.pptx
2. Earth - The Living Planet Module 2ELS
Derivatives of integument scales, beaks, horns,.pptx
Phytochemical Investigation of Miliusa longipes.pdf
ELS_Q1_Module-11_Formation-of-Rock-Layers_v2.pdf
protein biochemistry.ppt for university classes
VARICELLA VACCINATION: A POTENTIAL STRATEGY FOR PREVENTING MULTIPLE SCLEROSIS
microscope-Lecturecjchchchchcuvuvhc.pptx

Genetic algorithm

  • 1. Introduction to Genetic Algorithm (GA) Presented By: Rabiya Khalid Student of MS(CS) Research Domain: Energy management in Smart Grid Supervised By: Dr. Nadeem Javaid
  • 2. GA (1/30) • Introduction [1] – Based on Darwin’s theory of evolution – Used to find true or approximate solution – Solves optimization based problems – Techniques inspired by evolutionary biology o Inheritance o Mutation o Selection o Crossover • History – Evolutionary computing evolved in the 1960’s by I.Rechenberg – GA’s were invented by John Holland in the mid-70’s. 2 [1]: Eiben, Agoston E., P-E. Raue, and Zs Ruttkay. "Genetic algorithms with multi-parent recombination." In International Conference on Parallel Problem Solving from Nature, pp. 78-87. Springer Berlin Heidelberg, 1994
  • 3. GA (2/30) 3 [2] [2]: Boultif, Ayache, Azeddine Kabouche, and Segni Ladjel. "Application of Genetic Algorithms (GA) and Threshold Acceptance (TA) to a Ternary Liquid-Liquid Equilibrium System." International Review on Modelling and Simulations (IREMOS) 9, no. 1 (2016): 29-36.
  • 4. • Lets learn biology first [3] – Our body is made up of trillions of cells – Each cell has a core structure (nucleus) that contains chromosomes – Each chromosome is made up of tightly coiled strands of deoxyribonucleic acid (DNA) – Genes are segments of DNA that determine specific traits, such as • Eye color • Hair color – A gene mutation is an alteration in DNA – It can be inherited or acquired during your lifetime – Some changes in genes result in genetic disorders. GA (3/30) 4 [3]: http://www.yourgenome.org/facts/what-is-evolution (accessed:1Feb2017)
  • 5. • Natural selection [4] – Only the organisms best adapted to their environment tend to survive – Transmit their genetic characteristics in increasing numbers to succeeding generations – Those less adapted tend to be eliminated • GA is inspired from nature [5] – A genetic algorithm maintains o Population of candidate solutions for the problem o Makes it evolve by iteratively applying a set of stochastic operators GA (4/30) 5[4]: https://www.doc.ic.ac.uk/~nd/surprise_96/journal/vol1/hmw/article1.html (accessed:1Feb2017) [5]: https://en.wikipedia.org/wiki/Genetic_algorithm (accesed:1Feb2017)
  • 7. • Key terms [7] – Individual o Any possible solution – Population o Group of all individuals – Search Space o All possible solutions to the problem – Chromosome o Blueprint for an individual – Trait o Possible aspect (features) of an individual – Allele o Possible settings of trait (black, blond, etc.) – Locus o The position of a gene on the chromosome – Genome o Collection of all chromosomes for an individual GA (6/30) 7 [7]: http://geneticalgorithms.ai-depot.com/Tutorial/Overview.html (accessed:1Feb2017)
  • 8. • GA requirements – A genetic representation of the solution domain (set search space) – A fitness function to evaluate the solution domain (objective function according to system model in case of smart grid) • Representation [8] – Chromosomes could be • Bit strings (0101 ... 1100) • Real numbers (43.2 -33.1 ... 0.0 89.2) • Permutations of element (E11 E3 E7 ... E1 E15) • Lists of rules (R1 R2 R3 ... R22 R23) • Program elements (genetic programming) • ... any data structure ... GA (7/30) 8[8]: http://www.obitko.com/tutorials/genetic-algorithms/ga-basic-description.php (accessed:1Feb2017)
  • 9. • Algorithm 1. Initialization 2. Generate population 3. Evaluate fitness 4. While gen<max_gen do 5. Select two parents 6. Crossover 7. Mutation 8. Evaluate fitness 9. Elitism 10. End GA (8/30) 9
  • 10. • Fitness function [7] – The fitness function is always problem dependent – Assigns fitness value to the individual – It summarizes, how close a solution is to achieving the set aims GA (9/30) 10
  • 11. • Selection [7] – Darwinian survival of fittest – More preference to get better guys – Ways to select • Roulette wheel • Tournament • Truncation – By itself, pick best • Roulette wheel – Probability of selection is assigned to individuals based on their fitness value – Two parents are selected randomly from set of individuals with high selection probability – Selected parents are used to produce off-springs GA (10/30) 11 [9]
  • 12. • Crossover [7] – Single point crossover – Two point crossover – Uniform crossover GA (11/30) 12
  • 13. GA (12/30) • Mutation [7] – String subjected to mutation after crossover – It prevents falling all solutions into local optimum – It alters bits of chromosomes to make the string better – Bit wise mutation is performed with probability of mutation Po – A random number ro is generated and compared with Po – If Po>ro , then mutation occurs • Types of mutation – Bit inversion o Selected bits are inverted – Order changing o The number are selected and exchanged 13
  • 14. • Elitism – Elitism involves copying a small proportion of the fittest candidates, unchanged, into the next generation – EA does not waste time re-discovering previously discarded partial solutions • Search space – The set of solutions among which the desired solution resides – Best solution among a number of possible solutions – Represented by one point in the search space GA (13/30) 14
  • 15. • Advantages of GA [10] – Concepts are easy to understand – Always an answer; answer gets better with time – Less time required for some special applications – Chances of getting optimal solution are more • Limitations [11] – The population considered for the evolution should be moderate or suitable – One for the problem (normally 20-30 or 50-100) – Crossover rate should be 80%-95% – Mutation rate should be low i.e. 0.5%-1% assumed as best – The method of selection should be appropriate – Writing of fitness function must be accurate GA (14/30) 15 [10]: Kim, Dong Hwa, Ajith Abraham, and Jae Hoon Cho. "A hybrid genetic algorithm and bacterial foraging approach for global optimization." Information Sciences 177, no. 18 (2007): 3918-3937. [11]: Morris, Garrett M., David S. Goodsell, Robert S. Halliday, Ruth Huey, William E. Hart, Richard K. Belew, and Arthur J. Olson. "Automated docking using a Lamarckian genetic algorithm and an empirical binding free energy function." Journal of computational chemistry 19, no. 14 (1998): 1639-1662
  • 32. • Appliances • Home appliances are divided into 3 types – Fixed appliances – Shiftable appliances – Elastic appliances • This categorization is based on – Power consumption pattern – Time of use – User comfort 32 Appliances Power rating Fan 0.6 Lights 0.75 Clothes iron 1.5 Microwave oven 1.18 Toaster 0.5 Coffee maker 0.8 [13]: Exploiting heuristic algorithms to efficiently utilize energy management controllers with renewable energy sources", Energy and Buildings, Volume 129, 1 October 2016, Pages 452-470, ISSN 0378-7788, Energy Optimization by GA (1/15) [13]
  • 33. 1. Fixed Appliances – Regular appliances (basic load) – LOT cannot be modified 2. Shiftable appliances – Can be shifted without altering their load profile – User specifies an operational time interval for these appliances 3. Elastic appliances – Interruptible appliances – Load profile can be modified – Can be shifted to a suitable time slot 33 Appliances Power rating Start time End time AC 1.44 6 24 refrigerator 0.73 6 24 Water heater 4.45 6 24 Space heater 1.50 6 24 Appliances Power rating Start time End time Waiting time Washing machine 0.78 3 16 5 Dish washer 3.60 3 12 5 Cloth dryer 4.40 3 18 5 Energy Optimization by GA (2/15) [13]
  • 34. • Pricing schemes • TOU pricing scheme [14] – Prices set for on peak and off peak hours – Hours are divided into blocks – Each block has fixed price • IBR pricing scheme [15] – Prices are divided into several blocks – First block is at the lowest electricity price – With the increment in electricity consumption price also increased 34 0 2 4 6 8 10 12 14 16 18 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 TOU [14]: Waterloo North Hydro, https://www.wnhydro.com/en/your- home/time-of-use-rates.asp. Last visited: 20 May 2016. [15]: http://www.prepayment.eskom.co.za/IBT.asp Energy Optimization by GA (3/15) [13]
  • 35. 35 • Pricing schemes • Real time Pricing scheme (RTP) [14] • Rates are based on hourly consumption of electricity • Utility regulates RTP into two parts 1. Base bill: It depends on customer’s base load (CBL) 2. Hourly prices: Hourly prices are applied according to customer’s usage (difference between actual and CBL) 0 5 10 15 20 25 30 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 RTP Price Unit if Load<=Limit Price Unit +Extra changes if Load>Limit RTP = Energy Optimization by GA (4/15) [13]
  • 36. 36 • Pricing schemes • Variable Peak Pricing (VPP) [14] • Critical Peak Pricing(CPP) [14] • During power system emergency conditions • Usually occurs in hot summer week days • CPR [14] • During critical events utility increases price • Refunds customer when demand decreases 0 20 40 60 80 100 120 140 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 CPP Energy Optimization by GA (5/15) [13]
  • 37. • GA parametric list • Input parameters for GA • These inputs are problem dependent • Values of these parameters can be changed to tune the algorithm • Following table shows values of parameters for our problem 37 Parameters Values Population size 200 Selection Random selection Crossover 0.8% Mutation 0.2% Stopping criteria Max.generation Max.generation 800 Energy Optimization by GA (6/15) [13]
  • 38. 38 GA parameters General use HEM’s parameters Individual Any possible solution On-off status of appliances in a time slot Population Group of all individuals Collection of all individuals Search Space All possible solutions to the problem Any values in constraint defined limits Chromosome Blueprint for an individual Time slot of an hour Allele Possible settings of trait (black, blond, etc.) Characteristics of defined system to satisfy optimization limits e.g 0/1 Locus The position of a gene on the chromosome Location of an appliance Genome Collection of all chromosomes for an individual Binary on /off (1/ 0) states arrays for each appliance Energy Optimization by GA (7/15) [13]
  • 39. • Generate population 39 Washing machine Dish washer Cloth dryer Air conditioner Water heater 1 0 0 1 0 0 1 1 1 1 1 1 0 0 1 1 0 0 1 1 1 1 1 0 0 0 1 0 1 1 1 1 0 1 0 for j=1:popsize for i=1:tbits if rand(1)>=0.1 X=1; else X=0; end pop(j,i)=X; end c=zeros(1,10); if pop(j,:)==c pop(j,:)= ones(1,10); end end Energy Optimization by GA (8/15) [13]
  • 40. • Evaluate Fitness 40 Washing machine Dish washer Cloth dryer Air conditioner Water heater Fitness 1 0 0 1 0 5.592 0 1 1 1 1 7.92 1 1 0 0 1 8.53 1 0 0 1 1 10.5 1 1 1 0 0 5.026 0 1 0 1 1 8.259 1 1 0 1 0 6.842 for t=1:24 for a=1:popsize F(a,1)=electricity_cost*x(a,:)'; err=c_electricity_cost*x(a,:)'-d; F(a,1)=F(a,1)+1000*abs(err); end end Energy Optimization by GA (9/15) [13]
  • 41. • Select best solution 41 Washing machine Dish washer Cloth dryer Air conditioner Water heater Fitness 1 0 0 1 0 5.592 0 1 1 1 1 7.92 1 1 0 0 1 8.53 1 0 0 1 1 10.5 1 1 1 0 0 5.026 0 1 0 1 1 8.259 1 1 0 1 0 6.842 Best solution Energy Optimization by GA (10/15) [13]
  • 42. • Crossover cpoint=floor(nn*rand); if cpoint==0 cpoint=randi(10,1,1); end c=[a(1:cpoint) b(cpoint+1:end)]; d=[b(1:cpoint) a(cpoint+1:end)]; 42 Washing machine Dish washer Cloth dryer Air conditioner Water heater 1 0 1 0 0 0 1 0 1 0 1 1 1 1 1 1 0 0 0 0 1 1 1 0 0 0 1 1 0 0 1 1 1 1 1 New Population after crossover Energy Optimization by GA (11/15) [13]
  • 43. • Mutation j=floor(rand*nn); k=a(j); if k==1 a(j)=0; else if k==0 a(j)=1; end end 43 Washing machine Dish washer Cloth dryer Air conditioner Water heater 1 0 1 0 0 0 0 0 1 0 1 1 0 1 1 1 0 0 1 0 1 1 1 1 0 0 1 0 0 0 1 1 0 1 1 New Population after mutation Energy Optimization by GA (12/15) [13]
  • 44. • Comparison – Check if all appliances are in off state in any individual – Compare new population with appliances’ data • Whether an appliance has finished it LOT • What is the remaining waiting time of an appliance for a=1:popsize for bs=1:tbit if time_slots(1,b)==0 popnew(a,b)=0; end if lgen<=time_slots(1,b) popnew(a,b)=1; end end z=zeros(1,10); o=ones(1,10); if popnew(a,:)=0; popnew(a,:)=o; end end 44 Energy Optimization by GA (13/15) [13]
  • 45. • Evaluate Fitness of updated population 45 Washing machine Dish washer Cloth dryer Air conditioner Water heater Fitness 1 0 1 0 0 5.592 0 0 0 1 0 7.92 1 1 0 1 1 8.53 1 0 0 1 0 10.5 1 1 1 1 0 9.026 0 1 0 0 0 8.259 1 1 0 1 1 6.842 Best solution Energy Optimization by GA (14/15) [13]
  • 46. • Elitism – After evaluating the new population • New best solution is compared with previous best solution • If fitness of new best solution is better – It is copied as global best – Else global best solution remains unchanged if gbest>best gbest=best; end – Algorithm will terminate when termination criteria will be satisfied 46 Energy Optimization by GA (15/15) [13]
  • 47. 47

Editor's Notes

  • #3: Genetic algorithms are a part of evolutionary computing, which is a rapidly growing area of artificial intelligence.