Top Banner
1 Exact and heuristics algorithms
9

1 Exact and heuristics algorithms. 2 Exercice1 Model charging station deployement problem. Program the Genetic algorithm to solve it.

Dec 14, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 1 Exact and heuristics algorithms. 2 Exercice1 Model charging station deployement problem. Program the Genetic algorithm to solve it.

1

Exact and heuristics algorithms

Page 2: 1 Exact and heuristics algorithms. 2 Exercice1 Model charging station deployement problem. Program the Genetic algorithm to solve it.

2

Exercice1

• Model charging station deployement problem.

• Program the Genetic algorithm to solve it.

Page 3: 1 Exact and heuristics algorithms. 2 Exercice1 Model charging station deployement problem. Program the Genetic algorithm to solve it.

3

Genetic algorithm: Chromosomes

• Chromosomes are used to code information.

• Example: 3 warehouses, 5 clients

W1 W2 W3 C1 C2 C3 C4 C5

1 0 1 3 2 1 1 2

Page 4: 1 Exact and heuristics algorithms. 2 Exercice1 Model charging station deployement problem. Program the Genetic algorithm to solve it.

4

Genetic algorithm: OperatorsPopulationPopulation

SelectSelect

CrossoverCrossover

MutationMutation

Recombination

Recombination

Best solution

Best solution

Final iterati

on

Final iterati

on

Yes

No

Page 5: 1 Exact and heuristics algorithms. 2 Exercice1 Model charging station deployement problem. Program the Genetic algorithm to solve it.

5

Genetic algorithm: OperatorsPopulationPopulation

SelectSelect

1- Randomly generate an initial population (random chromosomes)

3-Select some chromosomes from the population as an offspring individual:

-Randomly - using stochastic method

2 -Compute and save the fitness (Objective function F) for each individual (chromosomes) in the current population

Page 6: 1 Exact and heuristics algorithms. 2 Exercice1 Model charging station deployement problem. Program the Genetic algorithm to solve it.

6

Genetic algorithm: Operators• The crossover is done on a selected part of

population (offspring) to create the basis of the next generation (exchange information).

• This operator is applied with propability Pc

CrossoverCrossover

W1 W2 W3 C1 C2 C3 C4 C5

1 0 1 3 2 1 1 2

W1 W2 W3 C1 C2 C3 C4 C5

1 0 1 3 2 1 1 2

Father

Mother

Page 7: 1 Exact and heuristics algorithms. 2 Exercice1 Model charging station deployement problem. Program the Genetic algorithm to solve it.

7

Genetic algorithm: Operators

CrossoverCrossover

Child 1

Child 2

W1

W2

W3

C1 C2 C3 C4 C5

1 0 1 3 2 1 1 2

W1

W2

W3

C1 C2 C3 C4 C5

1 0 1 3 3 1 2 2

W1

W2

W3

C1 C2 C3 C4 C5

1 0 1 3 3 1 1 2

W1

W2

W3

C1 C2 C3 C4 C5

1 0 1 3 2 1 2 2

Father

Mother

Page 8: 1 Exact and heuristics algorithms. 2 Exercice1 Model charging station deployement problem. Program the Genetic algorithm to solve it.

8

Genetic algorithm: Operators• This operation is a random change in

the population. It modifies one or• more gene values in a chromosome to

have a new chromosom value in the pool.

• This operator is applied with propability Pm

MutationMutation

W1 W2 W3 C1 C2 C3 C4 C5

1 0 1 3 2 1 1 2

W1 W2 W3 C1 C2 C3 C4 C5

0 0 1 3 2 1 1 2

Current

New

Page 9: 1 Exact and heuristics algorithms. 2 Exercice1 Model charging station deployement problem. Program the Genetic algorithm to solve it.

9

Genetic algorithm: Operators• Recombination combines the

chromosomes from the initial population and the new offspring chromosomes.

Recombination

Recombination

Final iterati

on

Final iterati

on

• Repeat a fixed number of iteration or until the solution converge to one solution (always with the best fitness) .