0% found this document useful (0 votes)
33 views35 pages

Chap 4 Partie 2 RS

The document discusses genetic algorithms, which are a type of metaheuristic optimization technique. It provides an overview of the basic genetic algorithm approach, including representing solutions, evaluating fitness, selecting parents via techniques like roulette wheel selection, performing crossover and mutation to generate new solutions, and replacing parents. It also discusses considerations for ensuring feasible solutions and handling constraints.

Uploaded by

Ines Bouhelal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views35 pages

Chap 4 Partie 2 RS

The document discusses genetic algorithms, which are a type of metaheuristic optimization technique. It provides an overview of the basic genetic algorithm approach, including representing solutions, evaluating fitness, selecting parents via techniques like roulette wheel selection, performing crossover and mutation to generate new solutions, and replacing parents. It also discusses considerations for ensuring feasible solutions and handling constraints.

Uploaded by

Ines Bouhelal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 35

Generated by Foxit PDF Creator © Foxit Software

http://www.foxitsoftware.com For evaluation only.

Mastère de Recherche MeRSI-Smart Systems − ENSI

Optimisation Combinatoire

Par
Dr. Rihab SAID
Maître Assistante en Informatique de Gestion
[email protected]

Département: Systèmes d'Information et prise de Décision, ENSI Manouba


Laboratoire de Recherche: SMART (Strategies for Modeling & ARTificial intelligence)

Dr. Rihab SAID 1 Optimisation Combinatoire


Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

Chaptire 4
Optimization using Metaheuristics

Dr. Rihab SAID 2 Optimisation Combinatoire


Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

6) Overview of metaheuristics

Population-based metaheuristics: Genetic Algorithm (GA)


GA algorithm
Input
Param: Parameter set; 1) Population size;
Output 2) Stopping criterion;
Pt+1: Best population; 3) Crossover probability;
Begin 4) Mutation probability.
t 0; We may have others.
Pt Initialize(P t);
While (NOT Param.Stop) do
Pt Evaluate(Pt);
Parents Select(Pt);
Qt Crossover_Mutate(Parents);
Qt Evaluate(Qt);
Pt+1 Replace(Pt, Qt);
t t+1;
End While
End
Dr. Rihab SAID 33 Optimisation Combinatoire
Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

6) Overview of metaheuristics

Population-based metaheuristics: Genetic Algorithm (GA)

Vocabulary (1/2):
- Representation: This is a common search component for all metaheuristics. In
GA, the encoded solution is referred as chromosome while the decision variables
within a solution (chromosome) are genes. The possible values of variables (genes)
are the alleles and the position of an element (gene) within a chromosome is
named locus.
- Population initialization: This step could be performed using random generation
or some heuristic methods. The initial population should be diversified as possible
to cover the whole search space; otherwise the GA could face the premature
convergence phenomenon.
- Evaluation: This step is based on the fitness function. Usually, in mono-objective
optimization, the fitness function is the same as the objective function; which is not
the case for multi-objective optimization.

Dr. Rihab SAID 34 Optimisation Combinatoire


Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

6) Overview of metaheuristics

Population-based metaheuristics: Genetic Algorithm (GA)

Vocabulary (2/2):
-Selection strategy: The selection strategy addresses the following question:
“Which parents for the next generation are chosen with a bias towards better
fitness?” There are several selection strategies such as Roulette Weel Selection
(RWS), Stochastic Universal Sampling (SUS), Tournament Selection (TS), Rank-
based Selection (RS), etc.
- Recombination strategy: The recombination (reproduction) strategy consists in
designing suitable mutation and crossover operators to generate new individuals
(offsprings).
- Replacement strategy: The new offsprings (children) compete with old
individuals (parents) for their place in the next generation (survival of the fittest!).
- Stopping criterion: There are several criteria that could be used such as a
maximum number of generations or evaluations, reaching a satisfactory solution, a
certain number of generations without fitness improvement, etc.
Dr. Rihab SAID 35 Optimisation Combinatoire
Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

6) Overview of metaheuristics

Population-based metaheuristics: Genetic Algorithm (GA)


How to encode (represent) a solution?

Dr. Rihab SAID 36 Optimisation Combinatoire


Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

6) Overview of metaheuristics

Population-based metaheuristics: Genetic Algorithm (GA)


How to ensure solution feasibility?

Constraint handling strategies

Reject infeasible Repair infeasible Ensure solution


solutions solutions feasibility

Penalize infeasible Decode infeasible


solutions solutions

Dr. Rihab SAID 37 Optimisation Combinatoire


Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

6) Overview of metaheuristics

Population-based metaheuristics: Genetic Algorithm (GA)


How to select Parents for recombination?

Roulette Wheel Selection: It is the most common selection strategy. It assign to


each individual a selection probability that is proportional to its relative fitness. Let
fi be the fitness value of the ith individual. The probability of the latter to be
selected would be:

Dr. Rihab SAID 38 Optimisation Combinatoire


Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

6) Overview of metaheuristics

Population-based metaheuristics: Genetic Algorithm (GA)


Shortcomings:
1) Outstanding individuals
will introduce a bias in the
beginning of the search
that may cause a
premature convergence
and a loss of diversity.
2) When all individuals are
equally fit, this selection
strategy does not introduce
a sufficient pressure to
select the best individuals.

Dr. Rihab SAID 39 Optimisation Combinatoire


Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

6) Overview of metaheuristics

Population-based metaheuristics: Genetic Algorithm (GA)


Stochastic Universal Sampling: To reduce the bias of the RWS, the SUS may be
used. An outer roulette wheel is placed around the pie with equally spaced
pointers. In the SUS strategy, a single spin (rotation) of the roulette wheel
simultaneously selects all the individuals for reproduction.

Dr. Rihab SAID 40 Optimisation Combinatoire


Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

6) Overview of metaheuristics

Population-based metaheuristics: Genetic Algorithm (GA)


Tournament Selection: Tournament selection consists in randomly selecting k
individuals; the parameter k is called the size of the tournament group. A
tournament is then applied to the k members of the group to select the best one.
To select individuals, the tournament procedure is then carried out times.

Dr. Rihab SAID 41 Optimisation Combinatoire


Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

6) Overview of metaheuristics

Population-based metaheuristics: Genetic Algorithm (GA)


Rank-based selection: This strategy ranks the population individuals according to
their fitness values and then bases the selection probabilities on the assigned ranks
where the fittest individual has the rank N and the worst individual has the rank 1.
Once chromosomes are sorted, a roulette wheel is applied based on ranks. There
are two versions to compute the ranks: (1) linear transformation and
(2) exponential one.

Fitness-based selection probabilities. Rank-based selection probabilities.


Shortcoming:
We can face a slow convergence because the best individual does not differ so
much from other ones.
Dr. Rihab SAID 42 Optimisation Combinatoire
Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

6) Overview of metaheuristics

Population-based metaheuristics: Genetic Algorithm (GA)


How to recombine parents?

Recombination is based on two operators:


1) Crossover: It is a binary (sometimes n-ary) operator. Its main role is to inherit
good genes from parents to generate the offsprings. Usually, two parents perform
crossover to generate two offsprings. The crossover probability is usually set too
high.
2) Mutation: It is an unary operator that is used to maintain genetic diversity. It is
analogous to biological mutation. Mutation alters one or more gene values in a
chromosome from its initial state. Mutation occurs during evolution according to a
user-definable mutation probability. This probability should be set low. If it is set
too high, the search will turn into a random search.

Dr. Rihab SAID 43 Optimisation Combinatoire


Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

6) Overview of metaheuristics

Population-based metaheuristics: Genetic Algorithm (GA)

Crossover operators

n-point crossover Mean-centric crossover Permutation crossover

Uniform crossover Parent-centric crossover

Dr. Rihab SAID 44 Optimisation Combinatoire


Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

6) Overview of metaheuristics

Population-based metaheuristics: Genetic Algorithm (GA)


How to make replacement to build the new population?
- General replacement: The replacement concerns the whole population of size .
The offspring population will replace systematically the parent population. This
strategy is applied in the canonical GA as proposed in (Holland 1975).
- Steady State replacement: At each generation, only one offspring is generated.
The latter replaces the worst individual of the parent population.
Remark: Between those two extreme replacement strategies, many distinct
schemes that consist in replacing a given number of individuals of the
population may be applied (1 < < ). Elitism always consists in selecting the best
individuals from the parents and the offsprings. This approach leads to a faster
convergence, but a premature convergence could occur. To avoid this issue,
selecting bad individuals may be necessary. Those replacement strategies may be
stochastic or deterministic.
Dr. Rihab SAID 45 Optimisation Combinatoire
Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

6) Overview of metaheuristics

Population-based metaheuristics: Ant Colony Optimization (ACO)


Let’s have an idea about ACO based on the following video:

Dr. Rihab SAID 46 Optimisation Combinatoire


Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

6) Overview of metaheuristics

Population-based metaheuristics: Ant Colony Optimization (ACO)


ACO is one of the most successful algorithms in Swarm Intelligence.
Swarm intelligence is originated from the social behavior of several species such as
ants, bees, fish and birds.
The main characteristics of swarm-intelligence-based algorithms are particles that
are simple and non-sophisticated agents. The latter cooperate by an indirect
communication and do movements in the decision space.
The basic idea of the ACO algorithm is to imitate the cooperative behavior of real
ants to solve optimization problems. ACO mimics (imitates) the principle that
using very simple communication mechanism, an ant colony is able to find the
shortest path between two points.

Dr. Rihab SAID 47 Optimisation Combinatoire


Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

6) Overview of metaheuristics

Population-based metaheuristics: Ant Colony Optimization (ACO)

Figure 11. Illustration of an experiment with (blind) real ants to find the shortest path.

Dr. Rihab SAID 48 Optimisation Combinatoire


Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

6) Overview of metaheuristics

Population-based metaheuristics: Ant Colony Optimization (ACO)


1) The colony has access to a food source linked by two paths to
the colony’s nest.
2) During their trips, a chemical trail (pheromone) is left on
the ground. The pheromone is an olfactive and volatile
substance.
3) The role of this trail is to guide the other ants towards the
target point. The larger the amount of pheromone on a
particular path is, the larger the probability that the ants will This indirect
select the path. communication is
4) For a given ant, the path is chosen according to the smelt called stigmergy.
quantity of pheromone.
5) Furthermore, this chemical substance has a decreasing
action over time (evaporation process) and the quantity left by
one ant depends on the amount of food (reinforcement).
Dr. Rihab SAID 49 Optimisation Combinatoire
Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

6) Overview of metaheuristics

Population-based metaheuristics: Ant Colony Optimization (ACO)


ACO algorithm
Input
Trails: Pheromone trails;
Stop: Stopping criterion;
Output
S*: Best solution or Set of solutions;
Begin
P Ø;
While (NOT Stop) do
For each Ant do
S Construct(Trails);
S Evaluate(S); P Save(P, S);
Trails Evaporate(Trails);
Trails Reinforce(Trails);
End For
S* Best(P); P Update(P);
End While
End
Dr. Rihab SAID 50 Optimisation Combinatoire
Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

6) Overview of metaheuristics

Population-based metaheuristics: Ant Colony Optimization (ACO)


Solution construction: The construction of solutions is done according to a
probabilistic state transition rule. Artificial ants can be considered as stochastic
greedy procedures that construct a solution in a probabilistic manner by adding
solution components to partial ones until a complete solution is derived. The target
optimization problem can be seen as a decision graph (or construction graph)
where an ant will construct a path. Usually, this iterative process is based on:

a) Pheromone trails b) Specific heuristic

Dr. Rihab SAID 51 Optimisation Combinatoire


Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

6) Overview of metaheuristics

Population-based metaheuristics: Ant Colony Optimization (ACO)


a) Pheromone trails: It memorize the characteristics of good generated solutions,
which will guide the construction of new solutions by the ants. The pheromone
trails change dynamically during the search to reflect the acquired knowledge. It
represents the memory of the whole ant search process.
b) Specific heuristic: In ACO, we use a problem-dependent heuristic to construct
the solution component by component (e.g., in the knapsack problem, we use the
ratio « return/weight » to add an object to the decision vector at each time).

Pheromone update: The update of the pheromone is carried out using the
generated solutions. A global pheromone updating rule is applied in two
phases:

a) Evaporation b) Reinforcement
Dr. Rihab SAID 52 Optimisation Combinatoire
Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

6) Overview of metaheuristics

Population-based metaheuristics: Ant Colony Optimization (ACO)


a) Evaporation: In this phase, the pheromone trail decreases automatically. Each
pheromone value is reduced by a fixed proportion:
Pheromone Pheromone(1 - EvaporationRate)
where the 0 < EvaporationRate ≤ 1.

What is the goal of the evaporation?

The goal of the evaporation is to avoid for all ants a premature convergence
towards local optimal solutions and then to encourage the diversification in the
search space (exploration).

Dr. Rihab SAID 53 Optimisation Combinatoire


Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

6) Overview of metaheuristics

Population-based metaheuristics: Ant Colony Optimization (ACO)


b) Reinforcement: In this phase, the pheromone trails are updated according to the
generated solutions. Three different strategies may be applied:

b.1) Online step-by-step pheromone update: The pheromone trail is updated


by an ant at each step of the solution construction.
b.2) Online delayed pheromone update: The pheromone update is applied
once an ant generates a complete solution. For instance, in the ACS, each ant will
update the pheromone information with a value that is proportional to the quality
of the solution found. The better the solution found is, the more accumulated the
pheromone is.
b.3) Offline pheromone update: The pheromone trail update is applied once
all ants generate a complete solution. This is the most popular approach where
different strategies can be used:

Dr. Rihab SAID 54 Optimisation Combinatoire


Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

6) Overview of metaheuristics

Population-based metaheuristics: Ant Colony Optimization (ACO)


b.3.1) Quality-based pheromone update: This strategy updates the pheromone
value associated with the best found solution among all ants (or the best k
solutions where the number k is smaller than the number of ants). The added
values depend on the quality of the selected solutions.

b.3.2) Rank-based pheromone update: The best k ant solutions are allowed to
update the pheromone with an amount depending on the ranking of the solutions.
b.3.3) Worst pheromone update: The ant generating the worst solution will
decrease the pheromone trails related to the components of the solution.
b.3.4) Elitist pheromone update: The best solution found so far will update the
pheromone to enforce an intensification of the search.

Dr. Rihab SAID 55 Optimisation Combinatoire


Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

Correction de l’exercice

Dr. Rihab SAID 56 Optimisation Combinatoire


Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

6) Overview of metaheuristics

Population-based metaheuristics: Particle Swarm Optimization (PSO)


Student’s presentation based on « PSO.ppt ».

https://www.youtube.com/watch?v=
JnhJQe2sAno

Dr. Rihab SAID 57 Optimisation Combinatoire


Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

7) Performance assessment of mono-objective


metaheuristics
Performance assessment means evaluating the metaheuristic(s) output(s) using
some measures, called metrics (performance indicators), on some test problems,
called benchmarks.
A benchmark is a test problem for which the optimal solution is known. The latter
serves as reference when evaluating the metaheuristic results.
Here are some examples of Web links to various benchmarks:
▪ KP: https://people.sc.fsu.edu/~jburkardt/datasets/knapsack_01/knapsack_01.html
▪ Continuous functions: http://www.uni-graz.at/imawww/kuntsevich/solvopt/results/moreset.html

What are the steps to follow?

Dr. Rihab SAID 58 Optimisation Combinatoire


Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

7) Performance assessment of mono-objective


metaheuristics
To evaluate the performance of a metaheuristic in a rigorous manner, the following
three steps should be considered:
1) Experimental design: In the first step, the goals of the experiments (called
research questions), the selected benchmarks, and parameters have to be defined.
2) Measurement: In the second step, the measures to compute are selected. After
executing the different experiments (at least 30 times), statistical analysis is applied
to the obtained results. The performance analysis should be usually done based on
comparisons against state-of-the-art optimization algorithms dedicated to the
problem.
3) Reporting: Finally, the results are presented in a comprehensive way (using
tables, figures, plots, etc.), and an analysis is carried out following the defined
goals. Another main issue here is to ensure the reproducibility of the
computational experiments.

Dr. Rihab SAID 59 Optimisation Combinatoire


Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

Correction exercice 2

Dr. Rihab SAID 60 Optimisation Combinatoire


Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

Correction exercice 3 (1/3)

Dr. Rihab SAID 61 Optimisation Combinatoire


Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

Correction exercice 3 (2/3)

Dr. Rihab SAID 62 Optimisation Combinatoire


Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

Correction exercice 3 (3/3)

Dr. Rihab SAID 63 Optimisation Combinatoire


Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

Correction exercice 4 (Case study of GA application for job shop


scheduling problem) (1/2)
Job Sequences: Example of an individual noted s (solution):

It is a matrix as follows:

Selection through a ranking method:


Initialization step:
Randomly

Recombination:
• Subsequence exchange crossover
• ShiftChange mutation

Since we are tackling a minimization problem, solutions s3 and s2 are


selected for the subsequent recombination step.

Dr. Rihab SAID 64 Optimisation Combinatoire


Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

Correction exercice 4 (Case study of GA application for job shop


scheduling problem) (2/2)

SXX operator: SC operator:

Dr. Rihab SAID 65 Optimisation Combinatoire

You might also like