SlideShare a Scribd company logo
Genetic Algorithms
           NEURAL NETWORKS                                                            The genetic algorithms follow the evolution process in the nature
                                                                                      to find the better solutions of some complicated problems.
            (ELEC 5240 and ELEC 6240)                                                 Foundations of genetic algorithms are given in Holland (1975) and
                                                                                      Goldberg (1989) books.
          Generic Algorithms
     (Evolutionary Computations)                                                      Genetic algorithms consist the following steps:

                                                                                           Initialization
                                                                                           Selection
                                                                                           Reproduction with crossover and mutation
        Bodgan M. Wilamowski - Fall 2006                                              Selection and reproduction are repeated for each generation until a
                                                                                      solution is reached

                                                                                      During this procedure a certain strings of symbols, known as
                                                                                  1   chromosomes, evaluate toward better solution.                                            2




                                                                                                                            0.08

Genetic Algorithms 2                                                                  Genetic Algorithms 2                  0.07


                                                                                                                            0.06


All significant steps of the genetic algorithm will be explained                                                            0.05



using a simple example of finding a maximum of the function                                                                 0.04



(sin2(x)-0.5*x)2 with the range of x from 0 to 1.6. Note, that in this                                                      0.03


                                                                                                                            0.02
range the function has global maximum at x=1.309, and local                                                                 0.01

maximum at x=0.262.                                                                                                           0
                         0.08                                                                                                      0   0.2   0.4   0.6   0.8   1   1.2   1.4       1.6

                                                                                       Coding and initialization
                         0.07
                                                                                               At first, the variable x has to be represented as a string of
                         0.06
                                                                                       symbols. With longer strings process converges usually faster, so
                         0.05
                                                                                       less symbols for one string field are used it is the better. While
                         0.04
                                                                                       this string may be the sequence of any symbols, the binary
                         0.03                                                          symbols "0" and "1" are usually used. In our example, let us use
                         0.02                                                          for coding six bit binary numbers having a decimal value of 40x.
                         0.01                                                          Process starts with a random generation of the initial population
                           0
                                                                                       given in Table
                                0   0.2   0.4   0.6   0.8   1   1.2   1.4   1.6
                                                                                  3                                                                                            4




                                                                                                                                                                                         1
Genetic Algorithms 3                                                         Genetic Algorithms 4
                          Initial Population                                Selection and reproduction
                string    decimal    variable    function    fraction               Selection of the best members of the population is an important
                           value      value        value     of total       step in the genetic algorithm. Many different approaches can be used to
     1         101101       45        1.125       0.0633      0.2465
                                                                            rank individuals. In our example the ranking function is given. Highest
     2         101000       40        1.000      0.0433       0.1686        rank has member number 6 and lowest rank has member number 3.
     3         010100       20        0.500      0.0004       0.0016        Members with higher rank should have higher chances to reproduce.
                                                                            The probability of reproduction for each member can be obtained as
     4         100101       37        0.925      0.0307       0.1197        fraction of the sum of all objective function values. This fraction is
     5         001010       10        0.250      0.0041       0.0158        shown in the last column of the Table.
     6         110001       49        1.225      0.0743       0.2895
                                                                                    Using a random reproduction process the following population
                                                                            arranged in pairs could be generated:
     7         100111       39        0.975      0.0390       0.1521
     8         000100        4        0.100      0.0016       0.0062               101101 -> 45 110001 -> 49 100101 -> 37 110001 -> 49
    Total                                        0.2568       1.0000
                                                                                   100111 -> 39 101101 -> 45 110001 -> 49 101000 -> 40
                                                                        5                                                                     6




Genetic Algorithms 5                                                         Genetic Algorithms 6
Reproduction                                                                 Mutation
      101101 -> 45 110001 -> 49 100101 -> 37 110001 -> 49                            On the top of properties inherited from parents they
      100111 -> 39 101101 -> 45 110001 -> 49 101000 -> 40                    are acquiring some new random properties. This process is
                                                                             known as mutation. In most cases mutation generates low
If size of the population from one generation to another is the same,        ranked children, which are eliminated in reproduction
therefore two parents should generate two children. By combining             process. Sometimes however, the mutation may introduce a
two strings two another strings should be generated. The simples             better individual with a new property into. This prevents
way to do it is to split in half each of the parent string and exchange      process of reproduction from degeneration.        In genetic
substrings between parents. For example from parent strings                  algorithms mutation plays usually secondary role. Mutation
010100 and 100111 the following child strings will be generated              rate is usually assumed on the level much below 1%. In our
010111 and 100100. This process is known as the crossover and                example mutation is equivalent to the random bit change of a
resultant children are shown below                                           given pattern. In this simple example with short strings and
                                                                             small population with a typical mutation rate of 0.1%, our
         101111 -> 47 110101 -> 53 100001 -> 33 110000 -> 48                 patterns remain practically unchanged by the mutation
         100101 -> 37101001 -> 41110101 -> 53101001 -> 417                   process. The second generation for our example is shown in 8
                                                                             Table




                                                                                                                                                      2
Genetic Algorithms 7                                                     Genetic Algorithms 8
                                                                                 Note, that two identical highest ranking members of the
 Population of Second Generation                                         second generation are very close to the solution x=1.309. The
   string    string   decimal      variable   function   fraction        randomly chosen parents for third generation are
  number               value        value       value    of total                010111 -> 47 110101 -> 53 110000 -> 48 101001 -> 41
      1     010111      47          1.175      0.0696     0.1587                 110101 -> 53 110000 -> 48 101001 -> 41 110101 -> 53
    2       100100      37          0.925     0.0307     0.0701           which produces following children:
                                                                                 010101 -> 21 110000 -> 48 110001 -> 49 101101 -> 45
    3       110101      53          1.325     0.0774     0.1766
                                                                                 110111 -> 55 110101 -> 53 101000 -> 40 110001 -> 49
    4       010001      41          1.025     0.0475     0.1084                  The best result in the third population is the same as in the
    5       100001      33          0.825     0.0161     0.0368          second one. By careful inspection of all strings from second or third
                                                                         generation one may conclude that using crossover, where strings are
    6       110101      53          1.325     0.0774     0.1766
                                                                         always split into half, the best solution 110100 -> 52 will never be
    7       110000      48          1.200     0.0722     0.1646          reached no matter how many generations are created.
    8       101001      41          1.025     0.0475     0.1084                  The genetic algorithm is very rapid and it leads to a good
                                                                         solution within a few generations. This solution is usually close to
   Total                                      0.4387     1.0000
                                                                     9   global maximum, but not the best.                                10




Genetic Algorithms 9                                                     Genetic Algorithms 10




                                                                    11                                                                   12




                                                                                                                                                 3
Genetic Algorithms 11        Genetic Algorithms 12




                        13                                        14




Genetic Algorithms 13        Genetic Algorithms 14
                                 format compact, clear all,
                                 n=100; m=40; st=1; xo=1;
                                 for ite=1:10,
                                    x=xo+(2*rand(1,n)-1)*st;
                                    f=x-0.025*log((5-x)/1e-12);
                                    mat=f.*f;
                                    [mat,ii]=sort(mat);
                                    win=x(ii(1:m));
                                    st=std(win);
                                    xo=mean(win)
                                 end;




                        15                                        16




                                                                       4
Genetic Algorithms 15

format compact, clear all,
n=10; m=4; st=1; xo=1;
for ite=1:15,
   x=xo+(2*rand(1,n)-1)*st;
   f=x-0.025*log((5-x)/1e-12);
   mat=f.*f;
   [mat,ii]=sort(mat);
   win=x(ii(1:m));
   mat(m);
   mat(1:m);
   xn=x(ii(1:m));
   weig=mat(m)-mat(1:m);
   xo=sum(weig.*xn)/sum(weig);
   st=std(xn);
 % res=[xo,st,xo-0.025*log((5-xo)/1e-12)]
   disp(sprintf('x=%12.8g std=%12.5g f=%12.5g',xo,st,xo-
0.025*log((5-xo)/1e-12)));
end;

                                                           17




                                                                5

More Related Content

Viewers also liked

검색어 대중도, 연결망 분석 - 21021899 김수빈
검색어 대중도, 연결망 분석 - 21021899 김수빈검색어 대중도, 연결망 분석 - 21021899 김수빈
검색어 대중도, 연결망 분석 - 21021899 김수빈Webometrics Class
 
Machine Learning in the age of Big Data
Machine Learning in the age of Big DataMachine Learning in the age of Big Data
Machine Learning in the age of Big Data
Daniel Sârbe
 
3 problem-solving-
3 problem-solving-3 problem-solving-
3 problem-solving-
Mhd Sb
 
[Webinar] How Big Data and Machine Learning Are Transforming ITSM
[Webinar] How Big Data and Machine Learning Are Transforming ITSM[Webinar] How Big Data and Machine Learning Are Transforming ITSM
[Webinar] How Big Data and Machine Learning Are Transforming ITSM
SunView Software, Inc.
 
Big data, new epistemologies and paradigm shifts
Big data, new epistemologies and paradigm shiftsBig data, new epistemologies and paradigm shifts
Big data, new epistemologies and paradigm shifts
robkitchin
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial Intelligence
Mhd Sb
 
Big Data and Machine Learning
Big Data and Machine LearningBig Data and Machine Learning
Big Data and Machine Learning
Michel Bruley
 
2-Agents- Artificial Intelligence
2-Agents- Artificial Intelligence2-Agents- Artificial Intelligence
2-Agents- Artificial Intelligence
Mhd Sb
 
5 csp
5 csp5 csp
5 csp
Mhd Sb
 
20120924134035 빅데이터시대,ai의새로운의미와가치
20120924134035 빅데이터시대,ai의새로운의미와가치20120924134035 빅데이터시대,ai의새로운의미와가치
20120924134035 빅데이터시대,ai의새로운의미와가치
Webometrics Class
 
4 informed-search
4 informed-search4 informed-search
4 informed-search
Mhd Sb
 
Big Data & Artificial Intelligence
Big Data & Artificial IntelligenceBig Data & Artificial Intelligence
Big Data & Artificial Intelligence
Zavain Dar
 
Introduction to Big Data/Machine Learning
Introduction to Big Data/Machine LearningIntroduction to Big Data/Machine Learning
Introduction to Big Data/Machine Learning
Lars Marius Garshol
 

Viewers also liked (13)

검색어 대중도, 연결망 분석 - 21021899 김수빈
검색어 대중도, 연결망 분석 - 21021899 김수빈검색어 대중도, 연결망 분석 - 21021899 김수빈
검색어 대중도, 연결망 분석 - 21021899 김수빈
 
Machine Learning in the age of Big Data
Machine Learning in the age of Big DataMachine Learning in the age of Big Data
Machine Learning in the age of Big Data
 
3 problem-solving-
3 problem-solving-3 problem-solving-
3 problem-solving-
 
[Webinar] How Big Data and Machine Learning Are Transforming ITSM
[Webinar] How Big Data and Machine Learning Are Transforming ITSM[Webinar] How Big Data and Machine Learning Are Transforming ITSM
[Webinar] How Big Data and Machine Learning Are Transforming ITSM
 
Big data, new epistemologies and paradigm shifts
Big data, new epistemologies and paradigm shiftsBig data, new epistemologies and paradigm shifts
Big data, new epistemologies and paradigm shifts
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial Intelligence
 
Big Data and Machine Learning
Big Data and Machine LearningBig Data and Machine Learning
Big Data and Machine Learning
 
2-Agents- Artificial Intelligence
2-Agents- Artificial Intelligence2-Agents- Artificial Intelligence
2-Agents- Artificial Intelligence
 
5 csp
5 csp5 csp
5 csp
 
20120924134035 빅데이터시대,ai의새로운의미와가치
20120924134035 빅데이터시대,ai의새로운의미와가치20120924134035 빅데이터시대,ai의새로운의미와가치
20120924134035 빅데이터시대,ai의새로운의미와가치
 
4 informed-search
4 informed-search4 informed-search
4 informed-search
 
Big Data & Artificial Intelligence
Big Data & Artificial IntelligenceBig Data & Artificial Intelligence
Big Data & Artificial Intelligence
 
Introduction to Big Data/Machine Learning
Introduction to Big Data/Machine LearningIntroduction to Big Data/Machine Learning
Introduction to Big Data/Machine Learning
 

Similar to 13 genetic algorithms

Stephen Friend Institute of Development, Aging and Cancer 2011-11-28
Stephen Friend Institute of Development, Aging and Cancer 2011-11-28Stephen Friend Institute of Development, Aging and Cancer 2011-11-28
Stephen Friend Institute of Development, Aging and Cancer 2011-11-28
Sage Base
 
Stephen Friend IBC Next Generation Sequencing & Genomic Medicine 2011-08-03
Stephen Friend IBC Next Generation Sequencing & Genomic Medicine 2011-08-03Stephen Friend IBC Next Generation Sequencing & Genomic Medicine 2011-08-03
Stephen Friend IBC Next Generation Sequencing & Genomic Medicine 2011-08-03
Sage Base
 
Stephen Friend Norwegian Academy of Science and Letters 2011-11-02
Stephen Friend Norwegian Academy of Science and Letters 2011-11-02Stephen Friend Norwegian Academy of Science and Letters 2011-11-02
Stephen Friend Norwegian Academy of Science and Letters 2011-11-02
Sage Base
 
Faster, More Effective Flowgraph-based Malware Classification
Faster, More Effective Flowgraph-based Malware ClassificationFaster, More Effective Flowgraph-based Malware Classification
Faster, More Effective Flowgraph-based Malware ClassificationSilvio Cesare
 
Genetic Algorithms - Artificial Intelligence
Genetic Algorithms - Artificial IntelligenceGenetic Algorithms - Artificial Intelligence
Genetic Algorithms - Artificial Intelligence
Sahil Kumar
 
Clustering Methods with R
Clustering Methods with RClustering Methods with R
Clustering Methods with R
Akira Murakami
 
Ga ppt (1)
Ga ppt (1)Ga ppt (1)
Ga ppt (1)
RAHUL SOLANKI
 

Similar to 13 genetic algorithms (7)

Stephen Friend Institute of Development, Aging and Cancer 2011-11-28
Stephen Friend Institute of Development, Aging and Cancer 2011-11-28Stephen Friend Institute of Development, Aging and Cancer 2011-11-28
Stephen Friend Institute of Development, Aging and Cancer 2011-11-28
 
Stephen Friend IBC Next Generation Sequencing & Genomic Medicine 2011-08-03
Stephen Friend IBC Next Generation Sequencing & Genomic Medicine 2011-08-03Stephen Friend IBC Next Generation Sequencing & Genomic Medicine 2011-08-03
Stephen Friend IBC Next Generation Sequencing & Genomic Medicine 2011-08-03
 
Stephen Friend Norwegian Academy of Science and Letters 2011-11-02
Stephen Friend Norwegian Academy of Science and Letters 2011-11-02Stephen Friend Norwegian Academy of Science and Letters 2011-11-02
Stephen Friend Norwegian Academy of Science and Letters 2011-11-02
 
Faster, More Effective Flowgraph-based Malware Classification
Faster, More Effective Flowgraph-based Malware ClassificationFaster, More Effective Flowgraph-based Malware Classification
Faster, More Effective Flowgraph-based Malware Classification
 
Genetic Algorithms - Artificial Intelligence
Genetic Algorithms - Artificial IntelligenceGenetic Algorithms - Artificial Intelligence
Genetic Algorithms - Artificial Intelligence
 
Clustering Methods with R
Clustering Methods with RClustering Methods with R
Clustering Methods with R
 
Ga ppt (1)
Ga ppt (1)Ga ppt (1)
Ga ppt (1)
 

Recently uploaded

Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
chanes7
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
Chapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdfChapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdf
Kartik Tiwari
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
ArianaBusciglio
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
kimdan468
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 

Recently uploaded (20)

Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
Chapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdfChapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdf
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 

13 genetic algorithms

  • 1. Genetic Algorithms NEURAL NETWORKS The genetic algorithms follow the evolution process in the nature to find the better solutions of some complicated problems. (ELEC 5240 and ELEC 6240) Foundations of genetic algorithms are given in Holland (1975) and Goldberg (1989) books. Generic Algorithms (Evolutionary Computations) Genetic algorithms consist the following steps: Initialization Selection Reproduction with crossover and mutation Bodgan M. Wilamowski - Fall 2006 Selection and reproduction are repeated for each generation until a solution is reached During this procedure a certain strings of symbols, known as 1 chromosomes, evaluate toward better solution. 2 0.08 Genetic Algorithms 2 Genetic Algorithms 2 0.07 0.06 All significant steps of the genetic algorithm will be explained 0.05 using a simple example of finding a maximum of the function 0.04 (sin2(x)-0.5*x)2 with the range of x from 0 to 1.6. Note, that in this 0.03 0.02 range the function has global maximum at x=1.309, and local 0.01 maximum at x=0.262. 0 0.08 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 Coding and initialization 0.07 At first, the variable x has to be represented as a string of 0.06 symbols. With longer strings process converges usually faster, so 0.05 less symbols for one string field are used it is the better. While 0.04 this string may be the sequence of any symbols, the binary 0.03 symbols "0" and "1" are usually used. In our example, let us use 0.02 for coding six bit binary numbers having a decimal value of 40x. 0.01 Process starts with a random generation of the initial population 0 given in Table 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 3 4 1
  • 2. Genetic Algorithms 3 Genetic Algorithms 4 Initial Population Selection and reproduction string decimal variable function fraction Selection of the best members of the population is an important value value value of total step in the genetic algorithm. Many different approaches can be used to 1 101101 45 1.125 0.0633 0.2465 rank individuals. In our example the ranking function is given. Highest 2 101000 40 1.000 0.0433 0.1686 rank has member number 6 and lowest rank has member number 3. 3 010100 20 0.500 0.0004 0.0016 Members with higher rank should have higher chances to reproduce. The probability of reproduction for each member can be obtained as 4 100101 37 0.925 0.0307 0.1197 fraction of the sum of all objective function values. This fraction is 5 001010 10 0.250 0.0041 0.0158 shown in the last column of the Table. 6 110001 49 1.225 0.0743 0.2895 Using a random reproduction process the following population arranged in pairs could be generated: 7 100111 39 0.975 0.0390 0.1521 8 000100 4 0.100 0.0016 0.0062 101101 -> 45 110001 -> 49 100101 -> 37 110001 -> 49 Total 0.2568 1.0000 100111 -> 39 101101 -> 45 110001 -> 49 101000 -> 40 5 6 Genetic Algorithms 5 Genetic Algorithms 6 Reproduction Mutation 101101 -> 45 110001 -> 49 100101 -> 37 110001 -> 49 On the top of properties inherited from parents they 100111 -> 39 101101 -> 45 110001 -> 49 101000 -> 40 are acquiring some new random properties. This process is known as mutation. In most cases mutation generates low If size of the population from one generation to another is the same, ranked children, which are eliminated in reproduction therefore two parents should generate two children. By combining process. Sometimes however, the mutation may introduce a two strings two another strings should be generated. The simples better individual with a new property into. This prevents way to do it is to split in half each of the parent string and exchange process of reproduction from degeneration. In genetic substrings between parents. For example from parent strings algorithms mutation plays usually secondary role. Mutation 010100 and 100111 the following child strings will be generated rate is usually assumed on the level much below 1%. In our 010111 and 100100. This process is known as the crossover and example mutation is equivalent to the random bit change of a resultant children are shown below given pattern. In this simple example with short strings and small population with a typical mutation rate of 0.1%, our 101111 -> 47 110101 -> 53 100001 -> 33 110000 -> 48 patterns remain practically unchanged by the mutation 100101 -> 37101001 -> 41110101 -> 53101001 -> 417 process. The second generation for our example is shown in 8 Table 2
  • 3. Genetic Algorithms 7 Genetic Algorithms 8 Note, that two identical highest ranking members of the Population of Second Generation second generation are very close to the solution x=1.309. The string string decimal variable function fraction randomly chosen parents for third generation are number value value value of total 010111 -> 47 110101 -> 53 110000 -> 48 101001 -> 41 1 010111 47 1.175 0.0696 0.1587 110101 -> 53 110000 -> 48 101001 -> 41 110101 -> 53 2 100100 37 0.925 0.0307 0.0701 which produces following children: 010101 -> 21 110000 -> 48 110001 -> 49 101101 -> 45 3 110101 53 1.325 0.0774 0.1766 110111 -> 55 110101 -> 53 101000 -> 40 110001 -> 49 4 010001 41 1.025 0.0475 0.1084 The best result in the third population is the same as in the 5 100001 33 0.825 0.0161 0.0368 second one. By careful inspection of all strings from second or third generation one may conclude that using crossover, where strings are 6 110101 53 1.325 0.0774 0.1766 always split into half, the best solution 110100 -> 52 will never be 7 110000 48 1.200 0.0722 0.1646 reached no matter how many generations are created. 8 101001 41 1.025 0.0475 0.1084 The genetic algorithm is very rapid and it leads to a good solution within a few generations. This solution is usually close to Total 0.4387 1.0000 9 global maximum, but not the best. 10 Genetic Algorithms 9 Genetic Algorithms 10 11 12 3
  • 4. Genetic Algorithms 11 Genetic Algorithms 12 13 14 Genetic Algorithms 13 Genetic Algorithms 14 format compact, clear all, n=100; m=40; st=1; xo=1; for ite=1:10, x=xo+(2*rand(1,n)-1)*st; f=x-0.025*log((5-x)/1e-12); mat=f.*f; [mat,ii]=sort(mat); win=x(ii(1:m)); st=std(win); xo=mean(win) end; 15 16 4
  • 5. Genetic Algorithms 15 format compact, clear all, n=10; m=4; st=1; xo=1; for ite=1:15, x=xo+(2*rand(1,n)-1)*st; f=x-0.025*log((5-x)/1e-12); mat=f.*f; [mat,ii]=sort(mat); win=x(ii(1:m)); mat(m); mat(1:m); xn=x(ii(1:m)); weig=mat(m)-mat(1:m); xo=sum(weig.*xn)/sum(weig); st=std(xn); % res=[xo,st,xo-0.025*log((5-xo)/1e-12)] disp(sprintf('x=%12.8g std=%12.5g f=%12.5g',xo,st,xo- 0.025*log((5-xo)/1e-12))); end; 17 5