Presentation is loading. Please wait.

Presentation is loading. Please wait.

Population Based Metaheuristics

Similar presentations


Presentation on theme: "Population Based Metaheuristics"— Presentation transcript:

1 Population Based Metaheuristics
ENM 450 Introduction to Metaheuristic Optimization Spring 2019 Emine AKYOL ÖZER, PhD

2 Population-based metaheuristics (P-metaheuristics)
An iterative improvement in a population of solutions. First, the population is initialized. A new population of solutions is generated. Finally, this new population is integrated into the current one using some selection procedures. The search process is stopped when a given condition is satisfied (stopping criterion). Algorithms such as evolutionary algorithms (EAs), scatter search (SS), estimation of distribution algorithms (EDAs), particle swarm optimization (PSO), bee colony (BC), and artificial immune systems (AISs) belong to this class of metaheuristics.

3 Genetic Algorithm(GA)
A class of probabilistic optimization algorithms Inspired by the biological evolution process. GA are nature-inspired algorithms. Uses concepts of “Natural Selection” and “Genetic Inheritance” (Based on ideas from Darwinian Evolution 1859) Originally developed by John Holland (1975)

4 Genetic Algorithm Genetic algorithms are categorized as global search heuristics. GA is an iterative process during which an optimization problem is “encouraged” to produce better solutions at each iteration.

5 Genetic Algorithm The evolution usually starts from a population of randomly generated individuals and happens in generations. Commonly, the algorithm terminates when either a maximum number of generations has been produced, or a satisfactory objective function value level has been reached for the population.

6 A Simple Genetic Algorithm
{ initialize population; evaluate population; while TerminationCriteriaNotSatisfied select parents for reproduction; perform recombination and mutation; }

7 Genetic Algorithm – Back to the Biology
Genotype : – Particular set of genes in a genome, e.g. an organism’s full hereditary information Phenotype: – Physical characteristic of the genotype (smart, beautiful, healthy, etc.)

8 Genetic Algorithm – Back to the Biology

9 Genetic Algorithm - Representation
A potential solution to a problem may be coded or represented by a set of variables. In GAs, each of these variables (solution components) is called a gene. A string of genes, representing a complete solution, is called a chromosome.

10 Genetic Algorithm - Representation

11 Genetic Algorithm-Representation
Traditionally, solutions are represented as binary strings of 0s and 1s, but other encodings are also possible. Chromosomes could be: Bit strings ( ) Real numbers ( ) Permutations of element (E11 E3 E7 ... E1 E15) Lists of rules (R1 R2 R3 ... R22 R23) ... any data structure ...

12 GA:Representation Example
Assignment problem Phenotype: facility f1 is assigned to location l1, f2 to l4, f3 to l2 Genotype: ?

13 GA:Representation Example
TSP Phenotype: the tour Genotype: ?

14 GA:Representation Example
Machine Scheduling Phenotype: There are 4 machines and 6 jobs. Genotype: ?

15 GA:Representation Example - Binary coding
Optimization of function f(x,y,z) (assuming 0 ≤ x, y, z ≤ 25 −1) Phenotype: x=46, y=24, z=13 Genotype: | |

16 GA:Presentation Example
R: If (input1=Low OR High)AND(input2=High) THEN Output=Low Rules of this type can be encoded in 9 bits where the first 6 represent the antecedent (alternative conditions for Input 1 and 2) and the last 3 bits the value(s) of the consequent E.g. the first 3 bit represent the conditions for input 1, e.g: 000=no constraints, 001=low, 010=high, 011=low or high…

17 GA: Key Terms Individual - Any possible solution
Population - Group of all individuals. Usually has a fixed size and is a multiset of genotypes Search Space - All possible solutions to the problem Fitness function – Objective function value for a chromosome

18 Components of a GA Genetic operators (crossover, mutation)
Encoding technique (gene, chromosome) Initialization procedure Evaluation function (fitness function) Selection of parents Genetic operators (crossover, mutation) Parameter settings (practice and art)

19 Initialization procedure
Initially many individual solutions are randomly generated to form an initial population. The population size depends on the nature of the problem, but typically contains several hundreds or thousands of possible solutions. Traditionally, the population is generated randomly, covering the entire range of possible solutions (the search space). Occasionally, the solutions may be "seeded" in areas where optimal solutions are likely to be found.

20 GA: Fitness Function Fitness function may simply be the objective function where we optimize a single criterion. It may also be a more complicated measure involving multiple criteria and penalties for infeasibility. It should reflect real value of a chromosome.

21 GA: Selection of parents
During each successive generation, a proportion of the existing population is selected to breed a new generation. Individual solutions are selected through a fitness-based process, where fitter solutions (as measured by a fitness function) are typically more likely to be selected. Certain selection methods rate the fitness of each solution and preferentially select the best solutions. Other methods rate only a random sample of the population, as this process may be very time-consuming. Selection Methods; Tournament selection Roulette wheel selection Stochastic universal sampling Rank-based selection Elitist strategy

22 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.

23 Tournament selection: A TSP Example
1 2 3 4 5 - 40 21 35 79 92 9 52 61 7 84 46 8 67 11 39 24 97 Distance matrix is given above. A tournament of size 2 is performed. Number of population is 5. Apply elitist srategy.

24 Roulette wheel selection
It is the most common selection strategy. It will assign to each individual a selection probability that is proportional to its relative fitness. Let fi be the fitness of the individual pi in the population P. Its probability to be selected is 𝑝 𝑖 = 𝑓 𝑖 𝑗=1 𝑛 𝑓 𝑖

25 Roulette wheel selection: Example 1
TSP problem in tournament selection example. Random numbers: (0.96, 0.11, 0.64, 0.44) Apply elitist srategy.

26 Roulette wheel selection: Example 2
𝑚𝑎𝑥 𝑓 𝑥 =𝑥 2 , 𝑥∈ 0,1,…,31 Population number is 6. Random numbers: (0.337, 0.567, 0.468, 0.059, 0.239, 0.936)

27 GA: Genetic Operators The next step is to generate a second generation population of solutions from those selected through genetic operators: crossover (also called recombination), and/or mutation. For each new solution to be produced, a pair of "parent" solutions is selected for breeding from the pool selected previously. By producing a "child" solution using the above methods of crossover and mutation, a new solution is created which typically shares many of the characteristics of its "parents". New parents are selected for each child, and the process continues until a new population of solutions of appropriate size is generated.

28 GA: Crossover Operator
Typically, crossover takes two parents, cuts their chromosome strings at a randomly chosen position, swaps the head (or tail) segments to produce two offspring Crossover is not necessarily applied to all pairs of parents selected for mating . Probability of crossover being applied to a pair, pc, is usually between 0.6 and 1.0

29 GA:Crossover Operator
Most common crossover operators for binary representation are: 1-point crossover 2-point crossover Uniform crossover

30 GA:Crossover Operator – 1 point
Parent 1: | Parent 2: | Offspring 1: | Offspring 2: |

31 GA:Crossover Operator – 2 point
Parent 1: | | Parent 2: | | Offspring 1: | | Offspring 2: | | 0 1 0

32 GA:Crossover Operator – Uniform
A binary crossover mask is used to determine which gene will be taken from which parent. Parent 1: Parent 2: Crossover mask: Offspring(Child) 1: Offspring(Child) 2:

33 GA: Mutation Operator Mutation is applied to every offspring by altering each binary gene with a small probability, pm (typically between 0.1 and 0.001) Offspring: Mutated offspring: Alternatively, the entire chromosome may be mutated at once by a higher pm, particularly when a non-binary representation and problem specific genetic operators are used.

34 GA: Mutation Operator Mutation is fairly simple. You just change the selected gene based on what you feel is necessary and move on. Mutation is, however, vital to ensuring genetic diversity within the population.

35 Crossover and Mutation for TSP: An example
Consider an 8-city TSP where city 1 is home city and links exit between all pairs of cities. For each following pairs of parents, generate their two children. (mutation rate: 0.09) The parents are and The parents are and

36 Basics of GA The most common type of genetic algorithm works like this: a population is created with a group of individuals created randomly. The individuals in the population are then evaluated. The evaluation function is provided by the programmer and gives the individuals a score based on how well they perform at the given task. Two individuals are then selected based on their fitness, the higher the fitness, the higher the chance of being selected. These individuals then "reproduce" to create one or more offspring, after which the offspring are mutated randomly. This continues until a suitable solution has been found or a certain number of generations have passed, depending on the needs of the programmer.

37 The GA Cycle of Reproduction
children reproduction modification modified children parents population evaluation evaluated children deleted members discard

38 Genetic Algorithm

39 Genetic Algorithm


Download ppt "Population Based Metaheuristics"

Similar presentations


Ads by Google