SlideShare a Scribd company logo
Evolutionary Computing Technology
Sina Mohammadi, Mohammad Pourmojdeh, Alireza Bahremand, Hojjat allah Rezapour
IAU-Rasht Branch
Supervisor: Aref Safari Ph.D.
Spring 2019
Implementing The Genetic Algorithm in CPU and GPU
Table of Content
• Introduction to Evolutionary Computing
• Definition of Evolutionary Algorithms
• Components of Evolutionary Algorithms
• Review of Genetic Algorithm
• Implementation and Evaluation
• References
• Evolutionary Computing is a research area within computer science that transforms
computers into automatic optimization and design tools, utilizing the power of the
natural selection mechanisms.
• The contemporary terminology denotes the whole field by EC and the algorithms
involved are termed Evolutionary Algorithms.
Evolutionary Computing (EC)
3
1948
Genetical or evolutionary search
(Turing)
1962
Executed optimization
(Bremermann)
1965
Evolutionary Strategies
(Rechenberg, Schwefel)
1966
Evolutionary Programming
(Fogel)
1967
Genetic Algorithm
(Holland)
Evolutionary Algorithms (EA)
4
1992
Genetic Programming
(Koza)
1992
ACO Algorithm
(Dorigo)
1995
PSO Algorithm
(Kennedy and Eberhart)
Evolutionary Algorithms (EA)
5
• Algorithms that perform optimization or learning tasks with the ability to evolve.
• There are many different variants of evolutionary algorithms but the common
underlying idea behind all these techniques is the same.
3 main characteristics:
• Population-based • Fitness-oriented • Variation-driven
Evolutionary Algorithms (EA)
6
• GA came from the research of John Holland, in the University of Michigan.
• Main purpose is to be used to solve problems where deterministic algorithms are too costly.
• Travelling salesman problem or the knapsack problem fit the description.
Genetic Algorithm (GA)
7
Genetic Algorithm (GA)
8
INITIALISE population with random candidate solutions;
EVALUATE each candidate;
REPEAT UNTIL ( TERMINATION CONDITION is satisfied ) DO
I. SELECT parents;
II. RECOMBINE pairs of parents;
III. MUTATE the resulting offspring;
IV. EVALUATE new candidates;
V. SELECT individuals for the next generation;
END
• The first step is to decide how possible solutions should be specified and stored in
a way that can be manipulated by a computer.
• Objects forming possible solutions within the original problem context are referred
to as phenotypes and their encoding that is the individuals within the EA, are called
genotypes.
Representation
9
• The role of the evaluation function is to represent the requirements the population
should adapt to meet.
• More accurately, it defines what improvement means.
• Fitness Function is not a constant mathematical formula but changes with the
context of the problem.
Evaluation Function (Fitness Func.)
10
• The role of parent selection or mate selection is to distinguish among individuals
based on their quality and in particular to allow the better individuals to become
parents of the next generation.
• Roulette Wheel has one of the most uses in the genetic algorithm.
Parent Selection Mechanism
11
• This operator merges information from two parent genotypes into one or two
offspring genotypes.
• The role of recombination differs between EC dialects, For instance in genetic
programming it is often the only variation operator whereas in evolutionary
programming it is never used.
• Single Point • Multi Point • Uniform
Crossover
12
0 1 2 3 4 5 6 7 8 9
5 8 9 4 2 3 5 7 5 8
0 1 2 3 4 3 5 7 5 8
5 8 9 4 2 5 6 7 8 9
Selection Point could be anywhere in genotype
Recombination – Single Point
13
Parent A
Parent B
Offspring A
Offspring B
0 1 2 3 4 5 6 7 8 9
5 8 9 4 2 3 5 7 5 8
0 1 2 4 2 3 6 7 8 9
5 8 9 3 4 5 5 7 5 8
Selection Points could be anywhere in genotype
Recombination – Multi Point
14
Parent A
Parent B
Offspring A
Offspring B
0 1 2 3 4 5 6 7 8 9
5 8 9 4 2 3 5 7 5 8
5 1 9 4 4 5 5 7 5 9
0 8 2 3 2 3 6 7 8 8
Recombination – Uniform
15
Parent A
Parent B
Offspring A
Offspring B
• In simple terms, mutation may be defined as a small random tweak in the
chromosome, to get a new solution.
• Mutation is usually applied with a low probability because if the probability is very
high, the GA gets reduced to a random search.
0 0 1 1 0 1 0 0 1 0 0 0 1 0 0 1 0 0 1 0
Mutation
16
• Similar to parent selection, the role of survivor selection or environmental selection is to
distinguish among individuals based on their quality, but In contrast to parent selection
which is typically stochastic, survivor selection is often deterministic.
• For example, two common methods are the fitness-based method of ranking the unified
multiset of parents and offspring and selecting the top segment, or the age-biased
approach of selecting only from the offspring.
Survivor Selection Mechanism (Replacement)
17
• The maximally allowed CPU time elapses.
• The total number of fitness evaluations reaches a given limit.
• The fitness improvement remains under a threshold value for a given period of time
• The population diversity drops under a given threshold.
Termination Condition
18
• A CPU is basically a microprocessor that executes instructions given by a program
based on operations for arithmetic, control, logic, and input-output.
• The fundamental components of a CPU include an arithmetic logic unit (ALU),
processor registers that provide operations to the ALU and store the results, a
control unit (CU) that executes instructions from memory, and various registers.
Central Processing Units (CPU)
19
Central Processing Units (CPU)
20
• A CPU is designed for low latency (quick response time) by implementing a large
cache that is used for intermediate storage to avoid reading from global memory,
which is very slow.
• Core’s concept
Central Processing Units (CPU)
21
• Originally, the GPU was made for rendering images in computer games and was optimized
for the fact that each pixel value can be processed independently from the others.
• Instead of focusing on low latency as a CPU does, a GPU focuses on high throughputs that
is, calculating on as much data as possible. Thus a GPU has more hardware allocated to
computation and less to fast cache memory, the opposite of a CPU.
Graphic Processing Unit (GPU)
22
• Another main difference between a CPU and a GPU is that a CPU has a few
powerful cores while a GPU has thousands of weaker cores.
• This gives the GPU an advantage in highly parallelizable applications, while the
CPU is better for sequential runs.
Graphic Processing Unit (GPU)
23
CPU architecture (to the left) and GPU architecture (to the right)
24
Code written for a CPU cannot be run on a GPU since the two platforms are based on different
hardware and thus require code specifically written for each specific platform. For NVIDIA
graphics cards the language is CUDA, which is accessible as a superset of C++, among others.
From a programmer’s perspective, CUDA code looks like normal C++ code, except that
functions are marked as being run able on CPU, GPU, or both.
Programming
25
The code run on the GPU is called a “kernel.” The difference from code run on the
CPU is that the each kernel will be executed by thousands, or even millions, of
threads.
The programmer can specify the number of blocks and the number of threads per
block to be run. The threads in a block will all run on the same core.
Programming
26
27
Programming
28
Implementation
References
• A.E. Eiben, J.E. Smith. Introduction to Evolutionary Computing, Second Edition. 2015
• Yu, Xinjie, Gen, Mitsuo. Introduction to Evolutionary Algorithms. 2010
• Adrian Horga. Genetic algorithms – CPU vs GPU implementation discussion, Metaheuristics course report.
•‫مرادی‬,،‫قیداری‬ ‫شیری‬ ‫سعید‬ ‫و‬ ‫سجاد‬۱۳۸۴،‫سازی‬ ‫بهینه‬‫یازدهمی‬ ،‫ژنتیکی‬ ‫های‬ ‫الگوریتم‬ ‫از‬ ‫استفاده‬ ‫با‬ ‫کلید‬ ‫صفحه‬ ‫روی‬ ‫بر‬ ‫فارسی‬ ‫حروف‬ ‫چینش‬‫ن‬
‫و‬ ‫نظری‬ ‫فیزیک‬ ‫تحقیقات‬ ‫مرکز‬ ،‫ایران‬ ‫کامپیوتر‬ ‫انجمن‬ ،‫تهران‬ ،‫ایران‬ ‫کامپیوتر‬ ‫انجمن‬ ‫ساالنه‬ ‫کنفرانس‬‫مخابرات‬
•‫یزد‬ ‫میبد‬ ‫واحد‬ ‫آزاد‬ ‫دانشگاه‬ ،‫آن‬ ‫های‬ ‫کاربرد‬ ‫و‬ ‫موازی‬ ‫ژنتیک‬ ‫الگوریتم‬ ،‫بافقی‬ ‫کارگران‬ ‫فاطمه‬ ،‫بدرآبادی‬ ‫میرزایی‬ ‫کمال‬ ،‫هاشمی‬ ‫محسن‬ ‫سید‬
•‫زیستی‬ ‫محاسبات‬ ‫نرم‬ ‫رایانش‬ ‫مبانی‬ ،‫ویسی‬ ‫هادی‬:‫تهران‬ ‫دانشگاه‬ ،‫تکاملی‬ ‫پردازش‬–‫نوین‬ ‫فنون‬ ‫و‬ ‫علوم‬ ‫دانشکده‬
Any Question?
E B R A Z

More Related Content

PDF
Design of-an-artificial-intelligence-based-automatic-task-planner-or-a-roboti...
PDF
04 1 evolution
PPTX
Genetic Algorithm
PDF
3_GO_Olesya_Genetic_AlgorithmsOPTIMZTION.p.pdf
PPTX
Introduction to genetic algorithms
PPTX
Nature’s Algorithm: Cracking Problems with Evolutionary Computation
PDF
PDF
ABOU-NAOUM_AMANE_ROUGUI_Article
Design of-an-artificial-intelligence-based-automatic-task-planner-or-a-roboti...
04 1 evolution
Genetic Algorithm
3_GO_Olesya_Genetic_AlgorithmsOPTIMZTION.p.pdf
Introduction to genetic algorithms
Nature’s Algorithm: Cracking Problems with Evolutionary Computation
ABOU-NAOUM_AMANE_ROUGUI_Article

Similar to Evolutionary Computing Technology - Genetic Algorithm (20)

PPTX
WIX3001 Lecture 6 Principles of GA.pptx
PDF
CSA 3702 machine learning module 4
PPT
Genetic Algorithms-1.ppt
PPTX
genetic algorithm artificial intelligence for AI sublect
PDF
04 2 machine evolution
PPTX
Genetic Algorithm
PDF
Genetic Algorithm
PPT
Evolutionary algorithms
PPTX
Genetic algorithm
PDF
Introduction to Genetic Algorithms
PPT
Introduction to Genetic Algorithms
PPTX
GA of a Paper 2012.pptx
PDF
Evolutionary (deep) neural network
PDF
Data Science - Part XIV - Genetic Algorithms
PPT
Genetic_Algorithms.ppt
PPT
Genetic_Algorithms.ppt
PPT
Genetic_Algorithms_genetic for_data .ppt
PPTX
PPT
GENETIC ALGORITHM
PPTX
Introduction to Genetic Algorithms
WIX3001 Lecture 6 Principles of GA.pptx
CSA 3702 machine learning module 4
Genetic Algorithms-1.ppt
genetic algorithm artificial intelligence for AI sublect
04 2 machine evolution
Genetic Algorithm
Genetic Algorithm
Evolutionary algorithms
Genetic algorithm
Introduction to Genetic Algorithms
Introduction to Genetic Algorithms
GA of a Paper 2012.pptx
Evolutionary (deep) neural network
Data Science - Part XIV - Genetic Algorithms
Genetic_Algorithms.ppt
Genetic_Algorithms.ppt
Genetic_Algorithms_genetic for_data .ppt
GENETIC ALGORITHM
Introduction to Genetic Algorithms
Ad

Recently uploaded (20)

PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPTX
Big Data Technologies - Introduction.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
MYSQL Presentation for SQL database connectivity
PDF
cuic standard and advanced reporting.pdf
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPTX
Cloud computing and distributed systems.
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Spectroscopy.pptx food analysis technology
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Empathic Computing: Creating Shared Understanding
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
NewMind AI Weekly Chronicles - August'25-Week II
Big Data Technologies - Introduction.pptx
Encapsulation_ Review paper, used for researhc scholars
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
MYSQL Presentation for SQL database connectivity
cuic standard and advanced reporting.pdf
sap open course for s4hana steps from ECC to s4
Unlocking AI with Model Context Protocol (MCP)
Building Integrated photovoltaic BIPV_UPV.pdf
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Cloud computing and distributed systems.
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Spectroscopy.pptx food analysis technology
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Programs and apps: productivity, graphics, security and other tools
Per capita expenditure prediction using model stacking based on satellite ima...
20250228 LYD VKU AI Blended-Learning.pptx
Empathic Computing: Creating Shared Understanding
Ad

Evolutionary Computing Technology - Genetic Algorithm

  • 1. Evolutionary Computing Technology Sina Mohammadi, Mohammad Pourmojdeh, Alireza Bahremand, Hojjat allah Rezapour IAU-Rasht Branch Supervisor: Aref Safari Ph.D. Spring 2019 Implementing The Genetic Algorithm in CPU and GPU
  • 2. Table of Content • Introduction to Evolutionary Computing • Definition of Evolutionary Algorithms • Components of Evolutionary Algorithms • Review of Genetic Algorithm • Implementation and Evaluation • References
  • 3. • Evolutionary Computing is a research area within computer science that transforms computers into automatic optimization and design tools, utilizing the power of the natural selection mechanisms. • The contemporary terminology denotes the whole field by EC and the algorithms involved are termed Evolutionary Algorithms. Evolutionary Computing (EC) 3
  • 4. 1948 Genetical or evolutionary search (Turing) 1962 Executed optimization (Bremermann) 1965 Evolutionary Strategies (Rechenberg, Schwefel) 1966 Evolutionary Programming (Fogel) 1967 Genetic Algorithm (Holland) Evolutionary Algorithms (EA) 4
  • 5. 1992 Genetic Programming (Koza) 1992 ACO Algorithm (Dorigo) 1995 PSO Algorithm (Kennedy and Eberhart) Evolutionary Algorithms (EA) 5
  • 6. • Algorithms that perform optimization or learning tasks with the ability to evolve. • There are many different variants of evolutionary algorithms but the common underlying idea behind all these techniques is the same. 3 main characteristics: • Population-based • Fitness-oriented • Variation-driven Evolutionary Algorithms (EA) 6
  • 7. • GA came from the research of John Holland, in the University of Michigan. • Main purpose is to be used to solve problems where deterministic algorithms are too costly. • Travelling salesman problem or the knapsack problem fit the description. Genetic Algorithm (GA) 7
  • 8. Genetic Algorithm (GA) 8 INITIALISE population with random candidate solutions; EVALUATE each candidate; REPEAT UNTIL ( TERMINATION CONDITION is satisfied ) DO I. SELECT parents; II. RECOMBINE pairs of parents; III. MUTATE the resulting offspring; IV. EVALUATE new candidates; V. SELECT individuals for the next generation; END
  • 9. • The first step is to decide how possible solutions should be specified and stored in a way that can be manipulated by a computer. • Objects forming possible solutions within the original problem context are referred to as phenotypes and their encoding that is the individuals within the EA, are called genotypes. Representation 9
  • 10. • The role of the evaluation function is to represent the requirements the population should adapt to meet. • More accurately, it defines what improvement means. • Fitness Function is not a constant mathematical formula but changes with the context of the problem. Evaluation Function (Fitness Func.) 10
  • 11. • The role of parent selection or mate selection is to distinguish among individuals based on their quality and in particular to allow the better individuals to become parents of the next generation. • Roulette Wheel has one of the most uses in the genetic algorithm. Parent Selection Mechanism 11
  • 12. • This operator merges information from two parent genotypes into one or two offspring genotypes. • The role of recombination differs between EC dialects, For instance in genetic programming it is often the only variation operator whereas in evolutionary programming it is never used. • Single Point • Multi Point • Uniform Crossover 12
  • 13. 0 1 2 3 4 5 6 7 8 9 5 8 9 4 2 3 5 7 5 8 0 1 2 3 4 3 5 7 5 8 5 8 9 4 2 5 6 7 8 9 Selection Point could be anywhere in genotype Recombination – Single Point 13 Parent A Parent B Offspring A Offspring B
  • 14. 0 1 2 3 4 5 6 7 8 9 5 8 9 4 2 3 5 7 5 8 0 1 2 4 2 3 6 7 8 9 5 8 9 3 4 5 5 7 5 8 Selection Points could be anywhere in genotype Recombination – Multi Point 14 Parent A Parent B Offspring A Offspring B
  • 15. 0 1 2 3 4 5 6 7 8 9 5 8 9 4 2 3 5 7 5 8 5 1 9 4 4 5 5 7 5 9 0 8 2 3 2 3 6 7 8 8 Recombination – Uniform 15 Parent A Parent B Offspring A Offspring B
  • 16. • In simple terms, mutation may be defined as a small random tweak in the chromosome, to get a new solution. • Mutation is usually applied with a low probability because if the probability is very high, the GA gets reduced to a random search. 0 0 1 1 0 1 0 0 1 0 0 0 1 0 0 1 0 0 1 0 Mutation 16
  • 17. • Similar to parent selection, the role of survivor selection or environmental selection is to distinguish among individuals based on their quality, but In contrast to parent selection which is typically stochastic, survivor selection is often deterministic. • For example, two common methods are the fitness-based method of ranking the unified multiset of parents and offspring and selecting the top segment, or the age-biased approach of selecting only from the offspring. Survivor Selection Mechanism (Replacement) 17
  • 18. • The maximally allowed CPU time elapses. • The total number of fitness evaluations reaches a given limit. • The fitness improvement remains under a threshold value for a given period of time • The population diversity drops under a given threshold. Termination Condition 18
  • 19. • A CPU is basically a microprocessor that executes instructions given by a program based on operations for arithmetic, control, logic, and input-output. • The fundamental components of a CPU include an arithmetic logic unit (ALU), processor registers that provide operations to the ALU and store the results, a control unit (CU) that executes instructions from memory, and various registers. Central Processing Units (CPU) 19
  • 21. • A CPU is designed for low latency (quick response time) by implementing a large cache that is used for intermediate storage to avoid reading from global memory, which is very slow. • Core’s concept Central Processing Units (CPU) 21
  • 22. • Originally, the GPU was made for rendering images in computer games and was optimized for the fact that each pixel value can be processed independently from the others. • Instead of focusing on low latency as a CPU does, a GPU focuses on high throughputs that is, calculating on as much data as possible. Thus a GPU has more hardware allocated to computation and less to fast cache memory, the opposite of a CPU. Graphic Processing Unit (GPU) 22
  • 23. • Another main difference between a CPU and a GPU is that a CPU has a few powerful cores while a GPU has thousands of weaker cores. • This gives the GPU an advantage in highly parallelizable applications, while the CPU is better for sequential runs. Graphic Processing Unit (GPU) 23
  • 24. CPU architecture (to the left) and GPU architecture (to the right) 24
  • 25. Code written for a CPU cannot be run on a GPU since the two platforms are based on different hardware and thus require code specifically written for each specific platform. For NVIDIA graphics cards the language is CUDA, which is accessible as a superset of C++, among others. From a programmer’s perspective, CUDA code looks like normal C++ code, except that functions are marked as being run able on CPU, GPU, or both. Programming 25
  • 26. The code run on the GPU is called a “kernel.” The difference from code run on the CPU is that the each kernel will be executed by thousands, or even millions, of threads. The programmer can specify the number of blocks and the number of threads per block to be run. The threads in a block will all run on the same core. Programming 26
  • 29. References • A.E. Eiben, J.E. Smith. Introduction to Evolutionary Computing, Second Edition. 2015 • Yu, Xinjie, Gen, Mitsuo. Introduction to Evolutionary Algorithms. 2010 • Adrian Horga. Genetic algorithms – CPU vs GPU implementation discussion, Metaheuristics course report. •‫مرادی‬,،‫قیداری‬ ‫شیری‬ ‫سعید‬ ‫و‬ ‫سجاد‬۱۳۸۴،‫سازی‬ ‫بهینه‬‫یازدهمی‬ ،‫ژنتیکی‬ ‫های‬ ‫الگوریتم‬ ‫از‬ ‫استفاده‬ ‫با‬ ‫کلید‬ ‫صفحه‬ ‫روی‬ ‫بر‬ ‫فارسی‬ ‫حروف‬ ‫چینش‬‫ن‬ ‫و‬ ‫نظری‬ ‫فیزیک‬ ‫تحقیقات‬ ‫مرکز‬ ،‫ایران‬ ‫کامپیوتر‬ ‫انجمن‬ ،‫تهران‬ ،‫ایران‬ ‫کامپیوتر‬ ‫انجمن‬ ‫ساالنه‬ ‫کنفرانس‬‫مخابرات‬ •‫یزد‬ ‫میبد‬ ‫واحد‬ ‫آزاد‬ ‫دانشگاه‬ ،‫آن‬ ‫های‬ ‫کاربرد‬ ‫و‬ ‫موازی‬ ‫ژنتیک‬ ‫الگوریتم‬ ،‫بافقی‬ ‫کارگران‬ ‫فاطمه‬ ،‫بدرآبادی‬ ‫میرزایی‬ ‫کمال‬ ،‫هاشمی‬ ‫محسن‬ ‫سید‬ •‫زیستی‬ ‫محاسبات‬ ‫نرم‬ ‫رایانش‬ ‫مبانی‬ ،‫ویسی‬ ‫هادی‬:‫تهران‬ ‫دانشگاه‬ ،‫تکاملی‬ ‫پردازش‬–‫نوین‬ ‫فنون‬ ‫و‬ ‫علوم‬ ‫دانشکده‬