design of an evolutionary algorithm m&f, ch. 7 why i like this textbook and what i don’t like...
TRANSCRIPT
Design of an Evolutionary Algorithm
M&F, ch. 7
why I like this textbook and
what I don’t like about it!
M&F’s model ofEvolutionary Algorithm
Five aspects of specification1. (7.1) representation (e.g., set of variable values)
2. (7.5) initial population (e.g., random)
3. (7.2) evaluation function ( e.g., fitness)
4. (7.4) selection procedure (next generation pop.)
5. (7.3) random variation operators(e.g., crossover, mutation)
7.1 Representation
• SAT representation, n propositions– vector of n boolean values
• effective when variables are independent (no or few constraints between variables)
--> vector of parameters or symbols
7.1.1 Fixed length vector
V = {v1, v2, …, vn}, vi Di
size of search space is |D1| x |D2| x…x |Dn|
e.g., SAT, sum of integers puzzle
7.1.2 permutation
• for TSP and similar problems, the vector representation includes too many bad solutions (repeated or missing cities)– because all variables are from same domain
{D, A, E, C, B} “without replacement”
n variables as permutationsize of search space is n!
Vector vs PermutationVector
{x1, x2, x3}Space{1,1,1}, {1,1,2}, {1,1,3},{1,2,1}, {1,2,2}, {1,2,3}, {1,3,1}, {1,3,2}, {1,3,3},{2,1,1}, {2,1,2}, {2,1,3},{2,2,1}, {2,2,2}, {2,2,3},{2,3,1}, {2,3,2}, {2,3,3},{3,1,1}, {3,1,2}, {3,1,3},{3,2,1}, {3,2,2}, {3,2,3},{3,3,1}, {3,3,2}, {3,3,3}
Permutation
{x1, x2, x3}
Space{1,2,3}
{1,3,2}
{2,1,3}
{2,3,1}
{3,1,2}
{3,2,1}
Permutation applications
• TSP• job shop scheduling
– k processing machines– n jobs
• each job must be processed at some subset of the k machines in a specific order and takes some time to be processed at each machine
– determine best order of job processing at each machine to minimize time of processing schedule
7.1.3 Finite state machines
• extension of vector representation:
• e.g., DFA
(Q, ∑, , q0, F)
– Q: set of states {qi}
– ∑: alphabet of input symbols {sj}
: transition table Q x ∑ --> Q– F: subset of Q, accepting states
Searching for a DFA
: transition table Q x ∑ --> Q
s1 s2 s3 s4 s5
q1
q2 q22
q3
q4
(Q, ∑, , q0, F)
– Q: set of states {qi}
– ∑: alphabet of input symbols {sj}
: transition table Q x ∑ --> Q
– F: subset of Q, accepting states
representation*: {q11, …, q45,q0, f1, …, f4}
*could include number of states - variable length vector
7.1.4 Symbolic expressions
• searching for an expression defining a function based on input data and a set of available operations– learning programs– Spore game of evolution
Symbolic expression
• syntax tree, size variable
€
x + sin(3.y) +
sin
.
y3
x
example representation: PreOrder traversal
{+, x, sin, ., 3, y}
Symbolic expression
• syntax tree, size variable
vv, a value, belongs to domain that includes the input data (e.g., x and y) and the set of possible operations with operand(s) (tree is extended)
opop, an operator, belongs to domain that includes the set of possible operations with same number of operands and the input data (tree is pruned)
7.2 Evaluation function
• may be the fitness function of the problem, …, or not
• must measure progress toward an optimal or satisficing solution
• should operate on the chosen representation (avoid transformation)
Desirable evaluation features
• efficient - searches typically spend most resources on evaluation
• incremental - revise evaluation when going from one solution to a neighbour, instead of redo
7.3 Variation operators• equivalent of neighbourhood definition in local
search:– rules for getting next candidate solution(s)
• determining the connectivity of the solution space (edges) and the metric
• dependent on any number of current solutions:– 0: e.g., random– 1: e.g., mutation– 2: e.g., crossover
variation of fixed length vectors
• one parent: change value of one of n variables (mutation)– densely connected space - maximum n variation
between any two solution– less densely connected - vary by single step, 1
• two or more parents: crossover, many variations that each connect space differently– one or more cut points– random choice for each variable
• one parent: – 2-opt, etc.
• two or more parents: – many attempts to simulate crossover
• most need ‘repair’ to avoid repetition• most are more costly of resources• most inherit some properties but destroy others• e.g., p175
variation of permutations
variation offinite state machines
• like vectors
except
• when states and symbols can be added or deleted
variations ofsymbolic expressions
• one parent: see representation section
• two parents:– exchange subtrees
7.4 Selection
two selection factors1. which solutions
should contributed to variation?
2. which solutions should survive to next generation?
s1,s2,s3,s4,s5,s6 at t
SELECTIONSELECTION
VARIATION
s1,s2,s3,s4,s5,s6 , c1,c2,c3,c4
SELECTIONSELECTION
s1,s2,s3,s4,s5,s6 at t+1
selection strategies
deterministic
• evaluation comparison
• faster convergence
stochastic
• probabilistic selection
1. based on fitness
2. best of subsets
3. ranking in subsets
• broader sampling