SlideShare una empresa de Scribd logo
1 de 29
Descargar para leer sin conexión
计算智能导论
第二章 进化计算
第二节 遗传算法
西安电子科技大学 智能科学与技术系
2
遗传算法历史
 1965年,美国密西根大学的Holland教授首次提
出人工遗传操作的重要性,并把这些应用于自
然系统和人工系统中。
 1967年,Bagley 发表了关于遗传算法应用的论
文,首次提出了遗传算法这一术语,并讨论了
遗传算法在自动博弈中的应用。
 1970年,Cavicchio把遗传算法应用于模式识别
中。 Hollstien是第一个把遗传算法应用于函数优
化的人。
3
遗传算法历史
 70 年代初, Holland 教授提出了遗传算法的基
本定理——模式定理,从而奠定了遗传算法的
理论基础。模式定理揭示出群体中的优良个体
的样本数呈指数级增长的规律。
 1975年是遗传算法研究的历史上十分重要的一
年。这一年,Holland出版了他的著名专著《自
然系统和人工系统的适应性》该书系统地阐述
了遗传算法的基本理论和方法,并提出了对遗
传算法的理论研究和发展极为重要的模式理论
(schemata theory),该理论首次确认了结构重
组遗传操作对于获得隐并行性的重要性。
4
遗传算法历史
 同年,DeJong完成了他的重要论文《遗传自适
应系统的行为分析》。他在该论文中所做的研
究工作可看作是遗传算法发展过程中的一个里
程碑,这是因为他把Holland的模式理论与他的
计算使用结合起来。
 在一系列研究工作的基础上,上世纪80年代由
Goldberg进行归纳总结,形成了遗传算法的基本
框架。
5
遗传算法的特点
 遗传算法必须通过适当的方法对问题的可行解进行
编码。
 遗传算法基于个体的适应度来进行概率选择操作。
 在遗传算法中,个体的重组使用交叉算子。交叉算
子是遗传算法所强调的关键技术,它是遗传算法中
产生新个体的主要方法,也是遗传算法区别于其它
进化算法的一个主要特点。
 在遗传算法中,变异操作使用随机变异技术。
 遗传算法擅长对离散空间的搜索,它较多地应用于
组合优化问题。
除了上述基本形式外,遗传算法还有各种各样的其它变形。
6
遗传算法的基本思想
 首先实现从性状到基因的映射,即编码工作,
然后从代表问题可能潜在解集的一个种群开始
进行进化求解。
 初代种群(编码集合)产生后,按照优胜劣汰
的原则,根据个体适应度大小挑选(选择)个
体,进行复制、交叉、变异,产生出代表新的
解集的群体,再对其进行挑选以及一系列遗传
操作,如此往复,逐代演化产生出越来越好的
近似解。
7
遗传算法的基本思想
选择:通过适应度的计算,淘汰不合理的个体。类似
于自然界的物竞天择。
复制:编码的拷贝,类似于细胞分裂中染色体的复
制。
交叉:编码的交叉重组,类似于染色体的交叉重
组。
变异:编码按小概率扰动产生的变化,类似于基因
的突变。
这个过程将导致种群像自然进化一样,后代种群比
前代更加适应环境,末代种群中得最优个体经过解码
(从基因到性状的映射),可以作为问题近似最优解。
8
8
Initial population
9
Select
10
Crossover
11
Another Crossover
12
A mutation
13
Another Mutation
14
Old population + children
15
New Population: Generation 2
16
Generation 3
17
Generation 4, etc …
18
19
产生初
始种群
计算
适应度
是否满足
优化准则
最佳个体
选择
交叉
变异
编码
(性状到基因)
解码
(基因到性状)
Y
N
父 代
子
代
开始
结束
20
经典的优化方法
 共轭梯度法、拟牛顿法、单纯
形方法
• 特点:
• 渐进收敛;
• 经典的优化搜索算法往往是基
于梯度的,梯度方向提高个体
性能;
• 单点搜索;
• 局部最优。
initial single point
improvement
(problem-specific)
termination
condition?
start
stop
Conventional Method
Yes
No
21
遗传算法&经典方法
improvement
(problem-independent)
termination
condition?
start
stop
Genetic Algorithm
initial point
...
initial point
initial point
Initial population
Yes
No
 遗传算法以决策变量的编码
作为运算对象。
× 传统的优化算法往往直接利
用决策变量的实际值本身进
行优化计算。
 遗传算法不是直接以决策变
量的值,而是以决策变量的
某种形式的编码为运算对象,
从而可以很方便地引入和应
用遗传操作算子。
22
遗传算法&经典方法
 遗传算法直接以目标函数值作为搜索信息。
× 传统的优化算法往往不只需要目标函数值,还
需要目标函数的导数等其它信息。
 这样对许多目标函数无法求导或很难求导的函
数,遗传算法就比较方便。
23
遗传算法&经典方法
 遗传算法同时进行解空间的多点搜索。
× 传统的优化算法往往从解空间的一个初始点开始搜
索,这样容易陷入局部极值点。
 遗传算法进行群体搜索,而且在搜索的过程中引入
遗传运算,使群体又可以不断进化。这些是遗传算
法所特有的一种隐含并行性。
Search space
Fitness
f(x)
local optimum
global optimum
local optimum
local optimum
0 x
x1 x2 x4 x5
x3
24
遗传算法的优点
 遗传算法直接以目标函数值作为搜索信息,
对许多目标函数无法求导或很难求导的函数,
比较方便。
 遗传算法同时进行解空间的多点搜索,进行
群体搜索,而且在搜索的过程中引入遗传运
算,使群体又可以不断进化。这些是遗传算
法所特有的一种隐含并行性,因此,遗传算
法更适合大规模复杂问题的优化。
25
遗传算法的优点
 遗传算法使用概率搜索技术。遗传算法属于
一种自适应概率搜索技术,其选择、交叉、
变异等运算都是以一种概率的方式来进行的,
从而增加了其搜索过程的灵活性。实践和理
论都已证明了在一定条件下遗传算法总是以
概率 1 收敛于问题的最优解。
 遗传算法在解空间进行高效启发式搜索,而
非盲目地穷举或完全随机搜索。
 遗传算法计算简单,功能强。
26
遗传算法的关键问题
 In general, a GA has five basic components, as
summarized by Michalewicz. (米卡列维奇)
用遗传算法求解问题需要解决以下五个问题
1. A genetic representation of potential solutions to the problem.(编码)
2. A way to create a population (an initial set of potential solutions).(群
体初始化)
3. An evaluation function rating solutions in terms of their fitness.(个体
评价)
4. Genetic operators that alter the genetic composition of offspring
(selection, crossover, mutation, etc.).(遗传算子)
5. Parameter values that genetic algorithm uses (population size,
probabilities of applying genetic operators, etc.).(参数选择).
27
遗传算法的基本过程
General Structure of Genetic Algorithms
 Genetic Representation and Initialization:
 The genetic algorithm maintains a population P(t) of chromosomes or individuals
vk(t), k=1, 2, …, popSize for generation t. (保持一个规模不变群体)
 Each chromosome represents a potential solution to the problem at hand.
 Evaluation:
 Each chromosome is evaluated to give some measure of its fitness eval(vk).
 Genetic Operators:
 Some chromosomes undergo stochastic transformations by means of genetic
operators to form new chromosomes, i.e., offspring.
 There are two kinds of transformation:
 Crossover, which creates new chromosomes by combining parts from two
chromosomes.
 Mutation, which creates new chromosomes by making changes in a single
chromosome.
 New chromosomes, called offspring C(t), are then evaluated.
 Selection:
 A new population is formed by selecting the more fit chromosomes from the
parent population and the offspring population.
 Best solution:
 After several generations, the algorithm converges to the best chromosome, which
hopefully represents an optimal or suboptimal solution to the problem.
28
遗传算法的基本过程
Initial
solutions
start
1100101010
1011101110
0011011001
1100110001
编码
encoding
Chromosome
染色体
1100101010
1011101110
1100101110
1011101010
0011011001
0011001001
交叉
crossover
变异
mutation
1100101110
1011101010
0011001001
solutions candidates
Decoding 解码
fitness computation
Evaluation 评估
roulette wheel
选择
Selection
termination
condition?
Y
N
best solution
stop
new
population
 The general structure of genetic algorithms
Gen, M. & R. Cheng: Genetic Algorithms and Engineering Design, John Wiley, New York, 1997.
子代offspring
offspring
t 0 P(t)
CC(t)
CM(t)
P(t) + C(t)
XiDian UNIVERSITY 29
遗传算法的基本过程
 Procedure of Simple GA
procedure: Simple GA
input: GA parameters
output: best solution
begin
t  0; // t: generation number
initialize P(t) by encoding routine; // P(t): population of chromosomes
fitness eval(P) by decoding routine;
while (not termination condition) do
crossover P(t) to yield C(t); // C(t): offspring
mutation P(t) to yield C(t);
fitness eval(C) by decoding routine;
select P(t+1) from P(t) and C(t);
t  t+1;
end
output best solution;
end

Más contenido relacionado

Destacado

Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Saba Software
 
Introduction to C Programming Language
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming Language
Simplilearn
 

Destacado (20)

How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 
Introduction to C Programming Language
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming Language
 

2-2.pdf