Falar claro… Dep. Carlos Coelho Dep. Gonçalo Capitão 10.Set.2004.
1 OPTIMIZAÇÃO COM ALGORITMOS EVOLUTIVOS Pedro Oliveira Dep. de Produção e Sistemas Universidade...
Transcript of 1 OPTIMIZAÇÃO COM ALGORITMOS EVOLUTIVOS Pedro Oliveira Dep. de Produção e Sistemas Universidade...
1
OPTIMIZAÇÃO COM ALGORITMOS EVOLUTIVOS
Pedro Oliveira
Dep. de Produção e Sistemas
Universidade do Minho
2
ORIGENS (I)
• Criar programas de computador com inteligência, com a possibilidade de se replicarem, e a capacidade adaptativa de aprenderem e controlarem os seus ambientes
• Interesse em biologia e psicologia, e procura de sistemas naturais como metáforas (Turing, von Neuman, Wiener)
3
ORIGENS (II)
• Modelar o cérebro (Redes Neuronais)
• Imitar a aprendizagem humana (Machine Learning)
• Simular a evolução biológica (Computação Evolucionária)
4
COMPUTAÇÃO EVOLUCIONÁRIA
• A evolução biológica é um processo de optimização
• Evolução como ferramenta de optimização em problemas de engenharia
• Estratégias Evolutivas [Rechenberg (1965, 1972), Schwefel(1975, 1977)]
• Programação Evolucionária [Fogel (1966)]
• Algoritmos Genéticos [Holland (1975), Goldberg (1989)]
5
ALGORITMO EVOLUCIONÁRIO (I)
• Noção darwiniana de evolução
• Elementos básicos:– população de indivíduos– noção de desmpenho (“fitness”)– ciclo de nascimento/morte enviesado pelo
desempenho– noção de hereditariedade
6
ALGORITMO EVOLUCIONÁRIO (II)
• Geração aleatória da população inicial
• Até que o critério de paragem seja satisfeito:– Selecção de indivíduos para progenitores– Geração de descendentes– Selecção de indivíduos para eliminar
• Apresentar resultado
7
ALGORITMO EVOLUCIONÁRIO (III)
• Dinâmica populacional:– Tamanho da população– Selecção de progenitores– Reprodução e hereditariedade– Competição dos sobreviventes
• Representação:– Mapeamento
• Desempenho
8
ESTRATÉGIAS EVOLUTIVAS
• Mudanças aleatórias nos parâmetros que definem a forma, em problemas aerodinâmicos
• As mudanças aleatórias como exemplo das mutações naturais
9
PROGRAMAÇÃO EVOLUCIONÁRIA
• As soluções são representadas como máquinas de estado finito
• Evolução como resultado de mutações aleatórias nos diagramas de transição de estado
10
ALGORITMOS GENÉTICOS
• Estudar a adaptação como ocorre na natureza
• Evolução a partir de uma população de cromossomas, através dos operadores genéticos (selecção, crossover, mutação e inversão)
11
ALGORITMOS EVOLUTIVOS
A lg oritm os G en é ticos E s tra té g ias E vo lu tivas
P rog ram açã o E vo lu c ion á ria P rog ram açã o G en é tica
S im u la ted A n n ea lin g C o ló n ias d e F orm ig as
... . . .
A lg oritm os E vo lu tivos
12
ESTRUTURA DE UM ALGORITMO EVOLUTIVO
GERAR POPULAÇÃO INICIAL
CRITÉRIO DE
PARAGEMSATISFEITO?
Não
Sim
SOLUÇÃO
INÍCIO
CALCULAR MEDIDA DE DESEMPENHO
GERAR NOVA POPULAÇÃO
SELECÇÃO
RECOMBINAÇÃO
MUTAÇÃO
13
PROPRIEDADES
• Aplicável a problemas de optimização contínuos, discretos e mistos
• nenhuma imposição de continuidade, convexidade, diferenciabilidade
• relativamente insensíveis ao ruído
• fáceis de paralelizar
14
ALGORITMOS GENÉTICOS
• Trabalham com uma codificação do
conjunto dos parâmetros
(representação binária)
• a procura é feita a partir de uma
população de pontos
15
ALGORITMOS GENÉTICOS
• a informação utilizada na procura é apenas baseada na função objectivo (e restrições, caso existam)
• em geral, as restrições são tratadas utilizando mecanismos de penalização
• as transições são baseadas em regras probabilísticas
16
ALGORITMOS GENÉTICOS1. INICIALIZAÇÃO
Inicializar uma população de k indivíduos, cada umconstituindo uma string de n bits.
2. MEDIÇÃO DO DESEMPENHO
Determinar uma medida de desempenho (na formamais simples, corresponde ao valor da funçãoobjectivo) para os k indivíduos da população.
Se se verificar o critério de paragem Entãoterminar.
3. SELECÇÃO
Escolher dois progenitores com probabilidadesproporcionais aos valores da medida de desempenho(selecção proporcional) ou da sua posição relativa napopulação (selecção baseada em graduações).
4. CROSSOVER
Gerar dois descendentes por recombinação, com umadeterminada probabilidade, das duas strings bináriasdos progenitores.
Repetir os passos 3. e 4. até se gerarem kindivíduos .
5. MUTAÇÃO
Mutar os descendentes, com uma determinadaprobabilidade, trocando, ao nível dos bits, os zerospor uns e vice-versa.
6. SUBSTITUIÇÃO
Substituir os indivíduos da geração anterior pelos kindivíduos descendentes gerados.
Voltar ao passo 2.
MEDIÇÃO DO
DESEMPENHO
CROSSOVER
MUTAÇÃO
SUBSTITUIÇÃO
CRITÉRIO
VERIFICADO?
INICIALIZAÇÃO
ÍNICIO
FIM
Não Sim
SELECÇÃO
17
ALGORITMO GENÉTICO
População de
Cromossomas
Reprodução
Avaliação dos
Cromossomas
Operadores
Genéticos
18
CROSSOVER
Dois pontos de crossover nas posições 2 e 4(representados pelo caracter “|”)
Antes Após
0 1 | 1 0 | 1 0 1 0 0 1
1 1 | 0 0 | 0 1 1 1 0 0
19
MUTAÇÃO
Mutação na posição 2 (representada pelo caracter “^”)
Antes Após
1 0 0 1 1 1 1 0 1 1 ^
20
EXEMPLO-GAGeração 0
-300
-200
-100
0
100
200
300
0 50 100 150 200 250 300 350
Geração 2
-300
-200
-100
0
100
200
300
0 50 100 150 200 250 300 350
f(x)=-xsin[|x|1/2]
21
EXEMPLO-GAGeração 4
-300
-200
-100
0
100
200
300
0 50 100 150 200 250 300 350
Geração 6
-300
-200
-100
0
100
200
300
0 50 100 150 200 250 300 350
Geração 8
-300
-200
-100
0
100
200
300
0 50 100 150 200 250 300 350
22
“0/1 Knapsack Problem”
n
iii pxxmaxP
1
)(
n
iii Cwx
1
23
“0/1 Knapsack Problem”
• x é um vector de n componentes xi binárias (xi{0,1})
• wi são valores inteiros positivos representando os pesos associados a cada uma das n componentes xi binárias
• pi são valores inteiros positivos representando os proveitos associados a cada uma das n componentes xi binárias
• C é um valor inteiro positivo representando a capacidade máxima
24
EXEMPLO
4321 8122216)( xxxxxmaxP
143475 4321 xxxx
25
x1 x2 x3 x4 f(x) R(x)0 0 0 0 0 01 0 0 0 16 50 1 0 0 22 70 0 1 0 12 40 0 0 1 8 31 1 0 0 38 121 0 1 0 28 91 0 0 1 24 80 1 1 0 34 110 1 0 1 30 100 0 1 1 20 71 1 1 0 50 161 1 0 1 46 151 0 1 1 36 120 1 1 1 42 141 1 1 1 58 19
26
PARÂMETROS
• População 100
• Bits 4
• Variáveis 4
• P(crossover) 0.7
• P(mutação) 0.1
• Penalização 100
27
EXEMPLO-GA
Geração 0
0 0 1 0 12
1 0 1 0 280 1 1 1 42 11 1 1 *58 0 00 1 8 0 0 00 0 0 0 1 1201 0 1 0 281 1 0 1 *46 00 0 0 0
Geração 1
0 0 0 1 8 00 1 0 12 0 01 0 12 0 0 00 0 1 0 0 0
16 1 0 1 0280 1 1 1 42 1
1 0 1 *46 0 00 1 8
1 0 1 0 28
28
EXEMPLO-GA
Geração 2
0 0 0 0 0
0 0 1 0 121 0 0 1 24 00 0 0 0 0 01 1 2 1 0 0016 0 1 1 1421 1 1 0 50 1 1 1 42 00 0 0 0
Geração 3
0 0 0 1 8 10 0 0 16 0 01 0 12 0 0 01 8 0 0 1 1
20 0 1 1 0340 1 1 1 42 0
1 1 1 42 0 00 1 8
1 0 0 0 16
29
EXEMPLO-GA
Geração 4
1 1 1 0 *50
0 1 1 1 420 1 1 0 34 10 0 1 24 1 11 0 *50 0 1 1142 0 0 1 120 0 0 1 1 200 0 1 0 12 01 1 1 42
Geração 5
0 0 1 1 20 00 1 0 12 0 11 0 34 0 1 11 42 0 0 0 18 1 1 1 0
*58 0 0 1 1200 1 0 1 30 0
0 1 1 20
0 1 1 0 34
30
RESULTADOS(RANKING)
Peanalização Convergência#,cromossoma, (f. obj.)
Gerações (DP)[min, max]
10 8-0111 (42)2-1100 (38)
23- (11)[11, 42]
100 9-0111 (42)1-1100 (38)
21- (12)[9, 46]
1000 9-0111 (42)1-1100 (38)
21- (12)[9, 46]
31
RESULTADOS(s/ RANKING)
Penalização Convergência#,cromossoma, (f. obj.)
Gerações (DP)[min, max]
10 7-0111 (42)3-1100 (38)
60- (37)[21, 138]
100 10-0111 (42) 72- (35)[17, 139]
1000 7-0111 (42)1-1100 (38)2-1011 (36)
49- (25)[19, 95]
32
ESQUEMAS
•A= 0 1 1 1 0 0 0
•H1= * 1 * * * * 0
•H2= * * * 1 0 * *
•Comprimento l
•Ordem o
•Comprimento definidor
33
BUILDING BLOCKS
f
HftHmtHm
)(),(),( 1
),()()(
),(),( tHmcf
fcftHmtHm
11
tcHmtHm ))(,(),( 101
111
lH
pf
HftHmtHm c
)()(),(),(
mc pHo
lH
pf
HftHmtHm )(
)()(),(),(
111
34
MINLP
L. Costa, P. Oliveira
35
MINLP
Mixed Integer Non Linear Problem
}{ uln ,|X xxxxxx
)(min xf
subject to
0xg
0xh
)(
)(
Ijx j integer,
36
RESTRIÇÕES
– Penalidade
– Método proposto por Deb (1998)
p
1k
m
llk hgRfF
1
22 )()}](,0[max{)()( xxxx
otherwise )()}](,0[max{
)( and )( if )(
)(
1max
p
1k
m
llk hgf
f
Fxx
0xh0xgx
x
37
PROBLEMAS
Prob. n r i b p m1 2 1 - 1 2 -2 3 2 - 1 1 13 3 2 - 1 3 -4 9 7 - 2 4 65 2 3 - 4 9 -6 5 3 2 - 3 -7 10 7 3 - 18 -
38
P roblem #1 (Kocis and Grossmann 1988, Floudas et al. 1989, Ryooand Sahinidis 1995)
minf (x;y) = 2x +y
subject to
1:25¡ x2 ¡ y 0; x +y 1:6
0 x 1:6
y 2 f0;1g
Theglobal optimumis (x;y;f ) = (0:5;1;2).
P roblem #2 (Kocis and Grossmann 1987, Salcedo 1992)
minf (x1;x2;y) = ¡ y+2x1 +x2
subject to
x1 ¡ 2exp(¡ x2) = 0
¡ x1 +x2 +y 0
0:5 x1 1:4y 2 f0;1g
Theglobal optimumis (x1;x2;y;f ) = (1:375;0:375;1;2:124).
P roblem #3 (Floudas 1995)
minf (x1;x2;y) = ¡ 0:7y+5(x1 ¡ 0:5)2 +0:8
subject to
¡ exp(x1 ¡ 0:2) ¡ x2 0; x2 +1:1y ¡ 1
0:2 x1 1; ¡ 2:22554 x2 ¡ 1
y 2 f0;1g
Theglobal optimumis (x1;x2;y;f ) = (0:94194;¡ 2:1;1;1:07654).
2
39
P roblem #4(KocisandGrossmann 1989, Diwekar et al. 1992, Diwekarand Rubin 1993)
minf (x;y1;y2;v1;v2) = 7:5y1 +5:5y2 +7v1 +6v2 +5x
subject to
y1 +y2 = 1; x1 +x2 = x
z1 = 0:9[1¡ exp(¡ 0:5v1)]x1; z2 = 0:8[1¡ exp(¡ 0:4v2)]x2
z1 +z2 = 10; z1y1 +z2y2 = 10
v1 10y1; v2 10y2
x1 20y1; x2 20y2
x1;x2;z1;z2;v1;v2 ¸ 0
y1;y2 2 f0;1g
Theglobal optimumis (x;y1;y2;v1;v2;f ) =(13:362272;1;0;3:514237;0;99:245209).
P roblem #5 (Floudaset al. 1989, Yuan et al. 1989, Salcedo1992, Ryooand Sahinidis 1995)
minf (x1;x2;x3;y1;y2;y3;y4) = (y1 ¡ 1)2 +(y2 ¡ 1)2
+(y3 ¡ 1)2 ¡ ln(y4 +1) +(x1 ¡ 1)2 +(x2 ¡ 2)2 +(x3 ¡ 3)2
subject to
y1 +y2 +y3 +x1 +x2 +x3 5; y23 +x2
1 +x22 +x2
3 5:5
y1 +x1 1:2; y2 +x2 1:8
y3 +x3 2:5; y4 +x1 1:2y2
2 +x22 1:64; y2
3 +x23 4:25; y2
2 +x23 4:64
x1;x2;x3 ¸ 0
y1;y2;y3;y4 2 f0;1g
Theglobal optimumis(x1;x2;x3;y1;y2;y3;y4; f ) = (0:2;1:280624;1:954483;1;0;0;1;3:557463).
3
40
P roblem #6 (Wong1990)
maxf (x1;x2;x3;y1;y2) = ¡ 5:357854x21 ¡ 0:835689y1x3 ¡
37:29329y1 +40792:141
subject to
a1 +a2y2x3 +a3y1x2 ¡ a4x1x3 92
a5 +a6y2x3 +a7y1y2 +a8x21 ¡ 90 20
a9 +a10x1x3 +a11y1x1 +a12x1x2 ¡ 20 5
27 x1;x2;x3 45
y1 2 f78;:::;102g;integer ; y2 2 f33;:::;45g;integer
wherea1 to a12 aregiven by thetable:
a1 85.334407 a5 80.51249 a9 9.300961a2 0.0056858 a6 0.0071317 a10 0.0047026a3 0.0006262 a7 0.0029955 a11 0.0012547a4 0.0022053 a8 0.0021813 a12 0.0019085
The global optimum is, for any combination of x2;y2, (x1;x3;y1;f ) =(78;27;27;32217:4).
4
41
P roblem #7 (Grossmann and Sargent 1979)
minf =MX
j =1
®j Nj V¯ jj
subject to
NX
i=1
QiTL i
BiH; Vj ¸ Sij B i; Nj TL i ¸ ti j
1 Nj N uj ; V l
j Vj Vuj
T lL i TL i Tu
L i; B lj B j Bu
j
Nj ; integer
where, for the speci…c problem considered, M = 3, N = 2, H = 6000,®j = 250; ¯ j = 0:6,
N uj = 3, V l
j = 250and Vuj = 2500. Thevalues of T l
L i , TuL i , B l
j and Buj are
given by:
T lL i = max
tijN u
j; Tu
L i = maxj
tij
B li =
Qi
HTL i; Bu
j = min(Qi;minj
Vuj
Sij)
Thenext tablegives thevalues of Sij and tij .
Sij tij2 3 4 8 20 84 6 3 16 4 4
Theglobal optimumis(N1;N2;N3;V1;V2;V3;B1;B2;TL1;TL2;f ) =(1;1;1;480;720;960;240;120;20;16;38499:8).
5
42
P roblem #1 R #G #F #CWithout 10 78 2988 0Speci…c 102 101 3146 10
Operators 103 99 3802 10for Binary 1010 121 4242 10Variables 1030 121 4242 10
With 10 78 3194 0Speci…c 102 93 3292 9
Operators 103 112 4211 6for Binary 1010 76 3216 7Variables 1030 76 3214 7
P roblem #2 R #G #F #CWithout 10 1991 48583 1Speci…c 102 662 22862 5
Operators 103 2595 92483 1for Binary 1010 118 4181 0Variables 1030 137 4373 1
With 10 1342 30601 5Speci…c 102 513 18391 0
Operators 103 1678 60931 0for Binary 1010 139 4257 2Variables 1030 153 4426 1
P roblem #2’ R #G #F #CWithout 10 93 3389 10Speci…c 102 72 2812 10
Operators 103 183 5141 9for Binary 1010 96 3521 7Variables 1030 111 3901 7
With 10 359 8610 9Speci…c 102 63 2765 2
Operators 103 54 2627 0for Binary 1010 81 3232 0Variables 1030 81 3241 0
1
43
P roblem #3 R #G #F #CWithout 10 456 15622 1Speci…c 102 2045 84332 6
Operators 103 1549 56034 6for Binary 1010 1069 37419 8Variables 1030 2155 69097 9
With 10 2192 60396 0Speci…c 102 2936 124151 4
Operators 103 4128 155907 1for Binary 1010 583 18920 2Variables 1030 1256 39147 2
P roblem #4 R #G #F #CWithout 10 4448 173948 0Speci…c 102 4557 117214 0
Operators 103 5000 126123 0for Binary 1010 4412 111707 0Variables 1030 4650 112689 0
With 10 4430 184304 0Speci…c 102 4632 115133 0
Operators 103 4357 111275 0for Binary 1010 4913 121993 0Variables 1030 5000 120478 0
P roblem #4’ R #G #F #CWithout 10 4805 146753 6Speci…c 102 5000 185725 5
Operators 103 5000 177124 5for Binary 1010 1003 24186 5Variables 1030 1559 33029 4
With 10 5000 145885 5Speci…c 102 5000 187408 6
Operators 103 5000 177403 6for Binary 1010 1882 31652 6Variables 1030 1739 38180 4
2
44
P roblem #5 R #G #F #CWithout 10 1694 42064 8Speci…c 102 2060 77064 9
Operators 103 3322 119837 8for Binary 1010 615 16530 10Variables 1030 1055 42064 6
With 10 2833 62797 8Speci…c 102 2470 79796 8
Operators 103 1932 46485 7for Binary 1010 1679 34390 7Variables 1030 2718 48391 5
P roblem #6 R #G #F #CWithout 10 5000 258694 10Speci…c 102 5000 257667 10
Operators 103 5000 258495 10for Binary 1010 5000 258052 10Variables 1030 5000 257859 10
P roblem #7 R #G #F #CWithout 10 3828 213647 4Speci…c 102 5000 263104 4
Operators 103 4057 221583 2for Binary 1010 2999 177115 0Variables 1030 1911 113411 0
DebScheme Problem # #G #F #C1 121 4242 10
Without 2’ 111 3901 7Speci…c 3 2499 69479 5
Operators 4’ 914 21962 5for Binary 5 697 17973 3Variables 6 5000 257581 10
7 5000 166759 10With 1 154 5090 5
Speci…c 2’ 198 5989 0Operators 3 1665 52033 3for Binary 4’ 1647 27080 6Variables 5 2090 30852 5
3
45
DebScheme Problem# #G #F #C1 500 28619 10
Without 2’ 500 35610 10Speci…c 3 500 255356 10
Operators 4’ 500 127746 8for Binary 5 500 142413 9Variables 6 500 295847 10
7 500 353422 0With 1 500 37525 7
Speci…c 2’ 500 42306 0Operators 3 500 111675 2for Binary 4’ 500 130591 10Variables 5 500 140286 9
GA (Pen.) GA (Deb) M-SIMPSAProblem# #F #C #F #C #F #C
1 3146 100% 4242 100% 607 99%2’ 2812 100% 35610 100% 10528 83%3 6909 90% 255356 100% - 0%4’ 146753 60% 127746 80% 14738 100%5 16530 100% 142413 90% 22309 (60%)6 257667 100% 257581 100% 27410 87%7 213649 40% 166759 100% 257536 92%
R - penalty parameter#G - mean number of generations#F - mean number of objective function evaluations#C - number of convergencies to theglobal optimum
4
46
OPTIMIZAÇÃO DE PLACAS
L. Costa, I. Figueiredo, J. Júdice,
R. Leal, L. Merca, P. Oliveira
47
DESCRIÇÃO (I)
48
DESCRIÇÃO (II)
min(a;m)2C
12
F Tu
subject to : K (a;m) u =F
2
6666666666666666666666666666664
K ! BENDING STIFFNESSMATRIX
F ! FORCE VECTOR
u ! DISPLACEMENT VECTOR
C ! CONSTRAINT SET
4n ! NUMBER OF LAYERS
2
66666666666666664
VARIABLES :
a=(a1;a2;:::;an)
m=(m1;m2;:::;mn)
4
49
m1 m2 m3 m4
Example for n=4 (16 layers), 6 materials and 7 angles
a1 a2 a3 a4
0 mi 56 Materials
0 ai 67 Angles
0 000 Glass1 (G1)1 001 Glass2 (G2)2 010 Glass3 (G3)3 011 Graphite1 (C1)4 100 Graphite2 (C2)5 101 Graphite3 (C3)6 110 ---7 111 ---
0 000 0º1 001 15º2 010 30º3 011 45º4 100 60º5 101 75º6 110 90º7 111 ---
50
m1 m2 m3m4
Example for n=4 (16 layers), 2 materials, 7 angles
a1 a2 a3 a4
0 mi 12 Materials
0 ai 67 Angles
0 000 0º1 001 15º2 010 30º3 011 45º4 100 60º5 101 75º6 110 90º7 111 ---
0 0 Glass (G)1 1 Graphite (C)
51
C C C G60º 0º 0º 0º
1 1 1 01 0 0 0 0 0 0 0 0 0 0 0
C C C C0º 30º 0º 15º
1 1 1 10 0 0 0 1 0 0 0 0 0 0 1
Par
ents
Off
spri
ng
C C C G60º 30º 0º 0º
1 1 1 01 0 0 0 1 0 0 0 0 0 0 0
C C C C0º 0º 0º 15º
1 1 1 10 0 0 0 0 0 0 0 0 0 0 1
Random numbers: 5 and 12
207 Nm
230 Nm
187 Nm
264 Nm
52
G C C C45º 60º 45º 60º
0 1 1 10 1 1 1 0 0 0 1 1 1 0 0 245 Nm
167 Nm
C C C C45º 60º 45º 60º
1 1 1 10 1 1 1 0 0 0 1 1 1 0 0
or
G C C C45º 60º 45º 60º
0 1 1 10 1 1 1 0 0 0 1 1 1 0 0 245 Nm
312 Nm
G G C C45º 60º 45º 60º
0 0 1 10 1 1 1 0 0 0 1 1 1 0 0
53
A40%
B30%
C20%
D10%
4
RANK
C G G C30º 60º 90º 60º
1 0 0 10 1 0 1 0 0 1 1 0 1 0 0 228 NmBG C G G30º 75º 45º 60º
0 1 0 00 1 0 1 0 1 0 1 1 1 0 0 310 NmCG G G C15º 0º 30º 0º
0 0 0 10 0 1 0 0 0 0 1 0 0 0 0 428 NmD
C C C G45º 60º 15º 75º
1 1 1 00 1 1 1 0 0 0 0 1 1 0 1 173 NmA
3
2
1
54
OPTIMIZAÇÃO MULTIOBJECTIVO
212
211
2
xfmin
xfmin
55
FUNÇÕES SCHAFFER
0
10
20
30
-3 -2 -1 0 1 2 3 4
x
f11,
f12
f11
f12
56
FRONTEIRA DE PARETO
0
2
4
6
8
10
0 2 4 6 8 10
f11
f12
57
0
1
2
3
4
0 1 2 3 4
f11
f12
Run 5
0
1
2
3
4
0 1 2 3 4
f11
f12
Run 6
0
1
2
3
4
0 1 2 3 4
f11
f12
Run 7
0
1
2
3
4
0 1 2 3 4
f11
f12
Run 8
58
0
1
2
3
4
0 1 2 3 4
f11
f12
Run 14
0
1
2
3
4
0 1 2 3 4
f11
f12
Run 15
0
1
2
3
4
0 1 2 3 4
f11
f12
Run 16
0
1
2
3
4
0 1 2 3 4
f11
f12
Run 17
59
EXTRUSÃO
A. G. Cunha, J. Covas, P. Oliveira
60
ESTRATÉGIAS EVOLUTIVAS
• Representação real
• Mecanismo de sobrevivência baseado em truncatura
• Selecção uniforme dos progenitores
• Eliminação dos pontos não admissíveis
• Estratégias:+,
61
ESTRATÉGIA (1+1)1. INICIALIZATION
)0(
n
)0(1
)0(
x
x
x such that 0)x(jg )0( for all j=1,…,m
0k
2. MUTATION
)k(nz
)k(nx
)k(1z
)k(1x
)k(z
)k(x
)k(Nx
3. SELECTION
otherwise
all for and
(k)
x
,...,m1j0))k(
Nx(jg))k(
x(f))k(
Nx(f)k(
Nx)1k(x
1kk
If Stop Criterion is not true Then return to step 2. Else End.
62
ESTRATÉGIA (1+1)Requirements for the random numbers )k(z :
1.
0zE )k(i
with i=1,…,n;
2. 2i , with i=1,…,n, must be small.
),0(Nz 2i
)k(i
Initial step lengths i :
n
x i)0(i
1/5 Success Rule (Control of the step lengths i ):
“From time to time during the optimum search obtain the frequency ofsuccesses, i.e., the ratio of the number of successes to the total numberof trials (mutations). If the ration is greater than 1/5, increase thevariance, if it is less than 1/5, decrease the variance.”
51
suc)k(
i
51
suc)k(
iinc
51
suc)k(
idec
)1k(i
)p(Pr
)p(Prc
)p(Prc
63
ESTRATÉGIA (,)1 . I N I C I A L I Z A T I O N
)0(
n,p
)0(1,p
)0(p
x
x
x s u c h t h a t 0)x(jg )0(p f o r a l l m,...,1j a n d ,...,1p
0k
2 . M U T A T I O N
)dk(n
)k(n,u
)dk(1
)k(1,u
)dk()k(u
)k(N,d
zx
zx
zxx s u c h t h a t 0)x(j
g )k(N,d f o r a l l
m,...,1j , ,...,1p a n d ,1u , e . g . ,
otherwise
integer K with
d//
K,...,2,du
3 . S E L E C T I O N
S o r t t h e )k(N,dx , w i t h ,...,1d , s o t h a t )x(f)x(f )k(
N,b)k(
N,a f o r a l l ,...,1a
a n d ,...,b
)k(N,a
)1k(p xx w i t h ,...,1p a n d ,...,1a
1kk
I f S t o p C r i t e r i o n i s n o t t r u e T h e n r e t u r n t o s t e p 2 . E l s e E n d .
64
ESTRATÉGIA (,)R e q u i r e m e n t s f o r t h e r a n d o m n u m b e r s )k(z :
1 . 0zE )k(i w i t h i = 1 , … , n ;
2 . 2i , w i t h i = 1 , … , n , m u s t b e s m a l l .
),0(Nz 2i
)k(i
I n i t i a l s t e p l e n g t h s i :
n
x i)0(i
C o n t r o l o f t h e s t e p l e n g t h s i :
)k(iz)k(
i)1k(
i e
w h e r e
),0(Nz 2)k(i
a n d i s a p a r a m e t e r
65
EXEMPLO-ES
0
20
40
60
80
100
120
-4 -2 2 4x
f(x)=ex-x3
66
EXEMPLO-ES
=1=1
• cdec=0.85
• Aproximação inicial x0=-4
x=1=1
67
EXEMPLO-ESGer. f(x) x Suc.
0 +6.401e+001 -4.000 01 +2.676e+001 -2.989 12 +2.402e+001 -2.883 23 +2.402e+001 -2.883 24 +3.500 -1.484 35 +9.603e-001 -4.054e-002 46 +7.417e-001 -3.689e-001 57 +7.417e-001 -3.689e-001 58 +7.417e-001 -3.689e-001 59 +7.417e-001 -3.689e-001 5
10 +7.417e-001 -3.689e-001 511 +7.417e-001 -3.689e-001 512 -1.035 +2.088 613 -1.035 +2.088 614 -6.735 +2.974 715 -6.735 +2.974 7
68
EXEMPLO-ESGer. f(x) x Suc.16 -6.735 +2.974 717 -6.735 +2.974 718 -6.735 +2.974 719 -7.471 +3.082 820 -9.733 +3.942 921 -9.733 +3.942 922 -9.733 +3.942 923 -9.733 +3.942 924 -9.733 +3.942 925 -9.733 +3.942 9
... ... ... ...
98 -1.022e+001 +3.733 1499 -1.022e+001 +3.733 14
69
COMPARAÇÃO GA-ES
Parameter ValueNumber of experiments 10Maximum number of generations 5000Population Size 100Crossover probability 0.700Mutation probability 0.001Penalty coefficient 100Gap 1.0Coding Gray code
Genetic Algorithm Parameters
70
COMPARAÇÃO GA-ES
Parameter ValueNumber of experiments 10Maximum number of generations 2000Lower bound of step lengths (absolute) 0.00001Lower bound of step lengths (relative) 0.00001Factor de ajuste dos desvios 0.85Periodicidade do teste de convergência 40
Evolution Strategy (1+1) Parameters
Evolution Strategy (+) ParametersParameter ValueNumber of experiments 10Maximum number of generations 2000Lower bound of step lengths (absolute) 0.00001Lower bound of step lengths (relative) 0.00001Factor de ajuste dos desvios 0.85Periodicidade do teste de convergência 40
71
COMPARAÇÃO GA-ES
72
QUESTÕES (I)
• Quais as leis que descrevem o comportamento macroscópico dos Algoritmos Evolutivos?
• Em que tipos de problemas os Algoritmos Evolutivos apresentam um bom desempenho?
• Em que problemas exibem um comportamento decepcionante?
73
QUESTÕES (II)
• O que significa um bom desempenho?
• Em que problemas os Algoritmos Evolutivos podem ultrapassar os algoritmos convencionais?
74
NOVAS QUESTÕES
• Incorporar as interacções ecológicas
• Incorporar novas ideias da genética e da biologia
• Compreensão dos esquemas nos Ags
• Compreensão do papel do crossover
• Fundamentação matemática dos Algoritmos Evolutivos