14
03/02/2017 1 (ITNPDB8) Evolutionary and Heuristic Optimisation Lecture 4: Population-based Algorithms Gabriela Ochoa http://www.cs.stir.ac.uk/~goc/ Computing Science and Mathematics, School of Natural Sciences University of Stirling, Stirling, Scotland Outline Optimisation Problems The travelling salesman problem Vehicle routing Other ‘fun’ and practical examples Optimisation methods Heuristics, metaheuristcis Single point algorithms Population-based algorithms Inspired by evolution by natural selection Outline of an evolutionary algorithm Origins of evolutionary algorithms Main variants (GA, Memetic, ES, GP) Case studies with DEMOS! (Plants and Creatures) Other population based approaches Gabriela Ochoa, [email protected] 2

(ITNPDB8) Evolutionary and Heuristic Optimisation Lecture 4: Population-based Algorithms · 2017. 2. 3. · Other evolutionary algorithms Evolution Strategies • Specialised in continuous

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: (ITNPDB8) Evolutionary and Heuristic Optimisation Lecture 4: Population-based Algorithms · 2017. 2. 3. · Other evolutionary algorithms Evolution Strategies • Specialised in continuous

03/02/2017

1

(ITNPDB8) Evolutionary and Heuristic Optimisation Lecture 4: Population-based Algorithms

Gabriela Ochoa http://www.cs.stir.ac.uk/~goc/

Computing Science and Mathematics,

School of Natural Sciences

University of Stirling, Stirling, Scotland

Outline Optimisation Problems

– The travelling salesman problem – Vehicle routing – Other ‘fun’ and practical examples

Optimisation methods – Heuristics, metaheuristcis – Single point algorithms – Population-based algorithms

• Inspired by evolution by natural selection • Outline of an evolutionary algorithm • Origins of evolutionary algorithms • Main variants (GA, Memetic, ES, GP) • Case studies with DEMOS! (Plants and Creatures) • Other population based approaches

Gabriela Ochoa, [email protected] 2

Page 2: (ITNPDB8) Evolutionary and Heuristic Optimisation Lecture 4: Population-based Algorithms · 2017. 2. 3. · Other evolutionary algorithms Evolution Strategies • Specialised in continuous

03/02/2017

2

Travelling salesman problem (TSP)

• A salesman must visit number of cities minimising the total cost of traveling

• Most prominent classical example of an NP-complete combinatorial optimisation problem

• Configurations: permutation (ordering) of cities. – s1= (A B C D), f(s1)= 20+30+12+35= 97

– s2= (A B D C), f(s2)= 20+34+12+42=108

– s3= (A C B D), f(s3)= 42+30+34+35= 141

• Local change (move): swap two cities – s1 = (A B C D)

– s1’ = (A D C B)

Check: Permutation Generator

Gabriela Ochoa, [email protected] 4

Page 3: (ITNPDB8) Evolutionary and Heuristic Optimisation Lecture 4: Population-based Algorithms · 2017. 2. 3. · Other evolutionary algorithms Evolution Strategies • Specialised in continuous

03/02/2017

3

The Vehicle Routing Problem

Gabriela Ochoa, [email protected]

• Given: A set of customers, a set of vehicles and a central depot

• Goal: Design minimum cost routes visiting all customers

• Representation: A set of routes one for each truck

• Fitness Function: Reduce the number of trucks used and the total distance travelled

Classification of optimisation algorithms

Gabriela Ochoa, [email protected] 6

• Single solution algorithms are exploitation oriented • Popuplation-based algorithms are exploration oriented

Page 4: (ITNPDB8) Evolutionary and Heuristic Optimisation Lecture 4: Population-based Algorithms · 2017. 2. 3. · Other evolutionary algorithms Evolution Strategies • Specialised in continuous

03/02/2017

4

Classification of metaheuristics

Gabriela Ochoa, [email protected] 7

What is an Evolutionary Algorithm?

• EAs fall into the category of “generate and test” algorithms

• They are stochastic, population-based algorithms

• Inspired by the process of Evolution by Natural Selection

• Variation operators (recombination and mutation) create the necessary diversity and thereby facilitate novelty

• Selection reduces diversity and acts as a force pushing quality

Page 5: (ITNPDB8) Evolutionary and Heuristic Optimisation Lecture 4: Population-based Algorithms · 2017. 2. 3. · Other evolutionary algorithms Evolution Strategies • Specialised in continuous

03/02/2017

5

Natural Evolution: Fact and Theory

• Changes across successive generations in the heritable characteristics of biological populations

• Theory of Evolution: One of the great intellectual revolutions of human history

• Life on Earth evolved from a universal common ancestor approximately 3.8 billion years ago

Gabriela Ochoa, [email protected]

The Great Tree of Life

Examples of Apparent Design in Nature

Gabriela Ochoa, [email protected]

Page 6: (ITNPDB8) Evolutionary and Heuristic Optimisation Lecture 4: Population-based Algorithms · 2017. 2. 3. · Other evolutionary algorithms Evolution Strategies • Specialised in continuous

03/02/2017

6

Evolution by Natural Selection

Natural Selection

1.Variation

2.Hereditary transmission

3.High rate of population growth

4.Differential survival and reproduction

Gabriela Ochoa, [email protected]

Charles Darwin and Alfred Wallace: Theory of evolution by means of

Natural Selection.

1859: On the Origin of Species by Means of Natural Selection: Or, The

Preservation of Favoured Races in the Struggle for Life

Evolutionary Computing: the Analogy

Gabriela Ochoa, [email protected]

Nature Computer

Individual

Population

Fitness

Chromosome

Gene

Crossover and

Mutation

Natural Selection

Solution to a problem

Set of solutions

Quality of a solution

Encoding for a solution

Part of the encoding of a

solution

Search operators

Reuse of good (sub-)

solutions

Page 7: (ITNPDB8) Evolutionary and Heuristic Optimisation Lecture 4: Population-based Algorithms · 2017. 2. 3. · Other evolutionary algorithms Evolution Strategies • Specialised in continuous

03/02/2017

7

Outline of an Evolutionary Algorithm

Generate [P(0)]

t 0

WHILE NOT Termination_Criterion [P(t)] DO

Evaluate [P(t)]

P' (t) Select [P(t)]

P''(t) Apply_Variation_Operators [P'(t)]

P(t+1) Replace [P(t), P''(t)]

t t + 1

END

RETURN Best_Solution

Select Parents Select Parents

Recombination Recombination

Mutation Mutation Fitness

Evaluation Fitness

Evaluation

Select Survivors Select Survivors

Initial Population

Important Components

• Representation: Genetic material

• Fitness Function: Task to perform

Origins of evolutionary algorithms

• Evolutionary Programming

– Fogel, Owens, Walsh (1962)

• Evolution Strategy:

– 60s and 70s. I. Rechenberg & H-P Schwefel

• Genetic Algorithms:

– John Holland (1975).

– David Goldberg (1989)

Alan Turing (1912 – 1954). Mathematician, wartime code-breaker and pioneer of

computer science Article: ‘‘Computing Machinery and Intelligence,’’ (1950)

described how evolution and natural selection might be used to automatically

create an intelligent computer program

Google Scholar citations: 63,968

Gabriela Ochoa, [email protected] 14

Page 8: (ITNPDB8) Evolutionary and Heuristic Optimisation Lecture 4: Population-based Algorithms · 2017. 2. 3. · Other evolutionary algorithms Evolution Strategies • Specialised in continuous

03/02/2017

8

Genetic algorithms Procedure GA

Generate [P(0)] t = 0 while NOT Termination_Criterion {

Evaluate [P(t)] P' (t) = Select [P(t)] P''(t) = Apply_Operators [P'(t)] P(t+1) = Replace [P(t), P''(t)] t = t + 1

}

Tournament selection

Parent selection: Better individuals get higher chance (proportional to fitness). • Proportional selection (roulette wheel,

stochastic universal sampling) • Scaling methods • Rank selection • Tournament selection • (μ + λ)- and (μ , λ) selection

Replacement (population models) • Generational: each generation set of

parents replaced by the offspring • Steady-state: one offspring is generated

per generation. One member is replaced • Generation gap: a proportion of the

population is replaced

Gabriela Ochoa, [email protected] 15

Search operators for binary representation

Recombination:

• One-point

• N-point

• Uniform

• Pc typically in range (0.6, 0.9)

Mutation:

• Alter each gene independently with

a probability Pm (mutation rate)

• Typically: 1/chromosome_length

Gabriela Ochoa, [email protected] 16

Page 9: (ITNPDB8) Evolutionary and Heuristic Optimisation Lecture 4: Population-based Algorithms · 2017. 2. 3. · Other evolutionary algorithms Evolution Strategies • Specialised in continuous

03/02/2017

9

Search operators for permutation representation

Recombination: Combining two permutations into two new permutations:

• choose random crossover point

• copy first parts into children

• create second part by inserting values from other parent:

• in the order they appear there

• beginning after crossover point

• skipping values already in child

8 7 6 4 2 5 3 1

1 3 5 2 4 6 7 8

8 7 6 4 5 1 2 3

1 3 5 6 2 8 7 4

Mutation: Small variation in one permutation, e.g.: swapping values of

two randomly chosen positions,

1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8

Gabriela Ochoa, [email protected] 17

Memetic (hybrid) algorithms

• Combination of GAs with local search operators, or GAs that use instance specific knowledge in operators

• Orders of magnitude faster and more accurate than GAs, and are the “state-of-the-art” on many problems

(Eiben, Smith, 2003)

• The term meme was coined by R. Dawkins (1976) • The term memetic algorithms by P. Moscato (1989) • The idea of hybridisation in GAs is older

Gabriela Ochoa, [email protected] 18

Page 10: (ITNPDB8) Evolutionary and Heuristic Optimisation Lecture 4: Population-based Algorithms · 2017. 2. 3. · Other evolutionary algorithms Evolution Strategies • Specialised in continuous

03/02/2017

10

Other evolutionary algorithms

Evolution Strategies

• Specialised in continuous search spaces: min. f : Rn R

• Rechenberg & Schwefel in the 60s, Technical University of Berlin. Applied to hydrodynamic shape optimisation

• Special feature: self-adaptation of mutation parameters

Gabriela Ochoa, [email protected] 19

Genetic Programming • Evolve a population of computer programs

• Applied to: machine learning tasks (prediction, classification…)

• Representation – Non-linear genomes: trees, graphs

– Linear genomes: grammatical evolution

Evolving Plant-Like Structures

Representation: Lidenmayer Systems (L-systems) • Hungarian Botanist Aristid Lindenmayer (1968)

• A model of morphogenesis, based on formal languages (set of rules and symbols)

Fitness function: What shaped the evolution of plants in Nature • Plants with branching patterns that gather the most light will be

more successful (photosynthesis)

• Need to support vertical branching patterns

Page 11: (ITNPDB8) Evolutionary and Heuristic Optimisation Lecture 4: Population-based Algorithms · 2017. 2. 3. · Other evolutionary algorithms Evolution Strategies • Specialised in continuous

03/02/2017

11

L-systems

• Alphabet = {a,b}

• Rules = {a → ab, b → a}

• Axiom: b

b

|

a

a b

┘ │

a b a

┘ │ └

a b a a b

_/ / ┘ └ \

a b a a b a b a

Example of a derivation in a L-

System Self-similarity in Nature Computer Graphics

w: F

p: F → F[-F]F[+F][F]

Angle (δ) = 60º

Graphical Interpretation of Strings Brackets [ ]: represent branches

Turtle Graphics (x, y, α) F Move forward a step of length d. (x',y’,α), x'= x

+ d cos(α) and y'= y + d sin(α). Draw segment

+ Turn left by angle δ. The next state of the turtle

is (x,y, α+δ)

- Turn right by angle δ. The next state of the turtle

is (x,y, α-δ)

F

+ -

Page 12: (ITNPDB8) Evolutionary and Heuristic Optimisation Lecture 4: Population-based Algorithms · 2017. 2. 3. · Other evolutionary algorithms Evolution Strategies • Specialised in continuous

03/02/2017

12

Simulated Evolution of Virtual Block Creatures

• Virtual creatures (Karl Sims, 1994) • Representation: coded instructions

for their growth and locomotion • Fitness Function: ability to perform a

given task Swimming

Competing Hopping Following

Video

Evolved Antennas for Deployment on NASA’s

Space Technology 5 Mission

Evolved Antennas for Deployment on NASA’s

Space Technology 5 Mission

GECCO-2004, June 2004

J. D. Lohn, G. S. Hornby, D. S. Linden, Evolvable Systems Group, Computational Sciences Division

• Winner of the 2004 Hummies award • Evolved antenna scheduled to fly in space • One of the top evolvable hardware results to date

Previous human designed antenna (helical). Did not meet the requirements.

Evolved Antennas: Better than conventional

design.

Page 13: (ITNPDB8) Evolutionary and Heuristic Optimisation Lecture 4: Population-based Algorithms · 2017. 2. 3. · Other evolutionary algorithms Evolution Strategies • Specialised in continuous

03/02/2017

13

Original ST5 Antenna Requirements • Transmit: 8470 MHz

• Receive: 7209.125 MHz

• Gain: >= 0dBic, 40 to 80 degrees

>= 2dBic, 80 degrees

>= 4dBic, 90 degrees

• 50 Ohm impedance

• Voltage Standing Wave Ratio (VSWR): < 1.2 at Transmit Freq

< 1.5 at Receive Freq

• Fit inside a 6” cylinder

• Transmit Frequency: 8470 MHz

• Receive Frequency: 7209.125 MHz

• Antenna RF Input: 1.5W = 1.76 dBW = 31.76 dBm

• VSWR: < 1.2 : 1 at the antenna input port at Transmit Freq, < 1.5 : 1 at the antenna input port at Receive Freq

• Antenna Gain Pattern: Shall be 0 dBic or greater for angles 40 <= theta <=80; 0 <= phi <= 360

• Antenna pattern gain (this shall be obtained with the antenna mounted on the ST5 mock-up) shall be 0.0 dBic (relative to anisotropic circularly polarized reference) for angles 40 <= theta <=80; 0 <= phi <= 360, where theta and phi are the standard spherical coordinate angles as defined in the IEEE Standard Test Procedures for Antennas, with theta=0 to direction perpendicular to the spacecraft top deck. The antenna gain shall be measured in reference to a right hand circular polarized sense (TBR).

• Desired: 0 dBic for theta = 40, 2 dBic for theta = 80, 4 dBic for theta = 90, for 0 <= phi <= 360

• Antenna Input Impedance: 50 ohms at the antenna input port

• Magnetic dipole moment: < 60 mA-cm^2

• Grounding: Cable shields of all coaxial inputs and outputs shall be returned to RF ground at the transponder system chasis. The cases of all comm units will be electrically isolated from the mounting surface to prohibit current flow to the spacecraft baseplate.

• Antenna Size: diameter: < 15.24 cm (6 inches), height: < 15.24 cm (6 inches)

• Antenna Mass: < 165 g.

Parabon Watchman™: Sensor Placement Optimization

Gabriela Ochoa, [email protected]

Optimize sensor placement to cover as much area with as few cameras as possible, in urban environments or rocky terrain.

http://www.parabon.com/ Parabon Computation (Grid Computing)

Page 14: (ITNPDB8) Evolutionary and Heuristic Optimisation Lecture 4: Population-based Algorithms · 2017. 2. 3. · Other evolutionary algorithms Evolution Strategies • Specialised in continuous

03/02/2017

14

Other population-based algorithms: the social behaviour metaphor

Ant colony optimisation (ACO)

• Dorigo, Di Caro & Gambardella (1991).

• Inspired by the behaviour of real ant colonies

• A set of software agents artificial ants search for good solutions

• Problem transformed to finding the best path on a weighted graph.

• Ants build solutions incrementally by moving on the graph

• http://www.aco-metaheuristic.org/

• http://www.scholarpedia.org/article/Ant_colony_optimization

Particle Swarm Optimization (PSO)

• Eberhart & Kennedy, 1995

• Inspired by social behaviour of bird flocking or fish schooling

• Solutions (called particles) fly through the search space by following the current optimum particles

• At each iteration they accelerate towards the best locations

• http://www.swarmintelligence.org/

• http://www.scholarpedia.org/article/Particle_swarm_optimization

Gabriela Ochoa, [email protected] 27

Summary

Optimisation Problems – The travelling salesman problem

– Vehicle routing

– Other ‘fun’ and practical examples

Population-based algorithms – Inspired by evolution by natural selection

– Main variants (GA, Hybrid, ES, GP)

– Case studies with DEMOS

– Other population based approaches

Gabriela Ochoa, [email protected] 28