Professional Documents
Culture Documents
02/25/2022
Multiple-solution Optimization Algorithms
Step 1: Define a fitness (objective) function for a given
optimization problem
Step 2: Define a function to generate solutions for a
given optimization problem
Step 3: Generate a set of solutions (population) using
the generation function and then evaluate their fitness
values using the fitness function
Step 4: Calculate the best solution X * from the
population
02/25/2022
Multiple-solution Optimization Algorithms
Step 5: Generate new solutions using the generation function
and then evaluate their fitness using the defined fitness
function
Step 5: Mutate some solutions in the population to generate
new solutions
Step 6: If the fitness values of the new solutions are
comparable or better than some of the solutions of the
population, insert the new solutions to the population
*
Step 7: Calculate the best solution X from the population
Step 8: If the stopping condition is satisfied, return X*.
Otherwise go to Step 5
02/25/2022
Sphere function
Question) Choose 4 integer numbers between -100
and 100 such that the sum of their squares is
minimized?
02/25/2022
Multiple-solution Optimization Algorithms
A typical candidate solution for the former sphere function
can be represented as X=<x1,x2,x3,x4> . Let us assume that
the number of candidate solutions in the population is 3.
Step 1: The fitness function is
Steps 2 and 3: Generate three solutions where each
solution contains 4 integer numbers between -100 and 100
X1=<-5,2,-8,3>,
X2=<-1,2,-8,7>, X3=<10,2,3,-10>
f(X1)=102, f(X2)=118, f(X3)=213
Step 4: X1 is X*
02/25/2022
Multiple-solution Optimization Algorithms
Iteration 1
Step 5: X4=<-1,2,-2,1>, X5=<-1,0,-8,0>, X6=<5,4,3,-8>
Step 6: f(X4)=10, f(X5)=65, f(X6)=114
Add X4 and X5 to the population and remove X2 and X3
(You also can keep X2 and X3 )
Current population X1, X4 and X5
Step 7: X4 is X*
02/25/2022
Multiple-solution Optimization Algorithms
Iteration 2
Step 5: X7=<-1,5,-2,10>, X8=<-1,10,-8,10>, X9=<9,4,3,-8>
Step 6: f(X7)=130, f(X8)=265, f(X9)=170
Do not change the population.
Step 7: X4 is X*
etc…
02/25/2022
Multiple-solution Optimization Algorithms
Sort the list L=<10,5,8,6> in ascending order using
multiple-solution optimization algorithm?
Hint: The fitness function is the number of digits
sorted correctly in the solution starting from the first
number
02/25/2022
Multiple-solution Optimization Algorithms
A typical candidate solution for can be represented as
X=<x1,x2,x3,x4> . Let us assume that the number of candidate
solutions in the population is 3.
Step 1: The fitness function is the number of digits sorted
correctly in the solution starting from the first number
Steps 2 and 3: Generate three solutions where each
solution contains 4 integer numbers between -100 and 100
X1=<10,8, 5, 6>, X2=< 5, 10. 8,6 >, X3 =< 5,6,10,8 >
f(X1) = 0, f(X2) = 2, f(X3) = 3
Step 4: X3 is X*
02/25/2022
Multiple-solution Optimization Algorithms
Iteration 1
Step 5: X4=<8, 6, 10, 5>, X5=< 6,8,10,5 > X6=< 10, 8. 6,5 >
Step 6: f(X4)=0, f(X5)=3, f(X6)=0
Add X5 to the population and remove (X1)
Current population X2, X3 and X5
Step 7: X5 is X*
02/25/2022
Multiple-solution Optimization Algorithms
Iteration 2
Step 5: X7= <8, 5, 10, 6> X8= <8, 10, 6, 5> X9=<8, 10, 5,
6>
Step 6: f(X7)=0, f(X8)=2, f(X9)=2
Do not change the population.
Step 7: X5 is X*
etc…
02/25/2022