an introduction to nature inspired...

36
An Introduction to Nature Inspired Algorithms Karthik Sindhya, PhD Postdoctoral Researcher Industrial Optimization Group Department of Mathematical Information Technology [email protected] http://users.jyu.fi/~kasindhy/ 24-10-2012

Upload: others

Post on 16-Sep-2019

8 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: An Introduction to Nature Inspired Algorithmsusers.jyu.fi/~jhaka/opt/An_Introduction_to_Nature_Inspired_Algorithms.pdf · An Introduction to Nature Inspired Algorithms Karthik Sindhya,

An Introduction to Nature Inspired Algorithms

Karthik Sindhya, PhD Postdoctoral Researcher

Industrial Optimization Group Department of Mathematical Information Technology

[email protected] http://users.jyu.fi/~kasindhy/

24-10-2012

Page 2: An Introduction to Nature Inspired Algorithmsusers.jyu.fi/~jhaka/opt/An_Introduction_to_Nature_Inspired_Algorithms.pdf · An Introduction to Nature Inspired Algorithms Karthik Sindhya,

• Nature Inspired Algorithms

• Differential Evolution algorithm

• Constraint handling

• Applications

Overview

Page 3: An Introduction to Nature Inspired Algorithmsusers.jyu.fi/~jhaka/opt/An_Introduction_to_Nature_Inspired_Algorithms.pdf · An Introduction to Nature Inspired Algorithms Karthik Sindhya,

Nature Inspired Algorithms

• Nature provide some of the efficient ways to solve problems

– Algorithms imitating processes in nature/inspired from nature – Nature Inspired Algorithms.

• What type of problems?

– Aircraft wing design

Page 4: An Introduction to Nature Inspired Algorithmsusers.jyu.fi/~jhaka/opt/An_Introduction_to_Nature_Inspired_Algorithms.pdf · An Introduction to Nature Inspired Algorithms Karthik Sindhya,

• Wind turbine design

• Bionic car

Nature Inspired Algorithms

BBC

Performance improvement by 40%. They reduce turbulence across the surface, increasing angle of attack and decreasing drag. (Source: Popular Mechanics)

Hexagonal plates - resulting in door paneling one-third lighter than conventional paneling, but just as strong. (Source: Popular Mechanics)

Page 5: An Introduction to Nature Inspired Algorithmsusers.jyu.fi/~jhaka/opt/An_Introduction_to_Nature_Inspired_Algorithms.pdf · An Introduction to Nature Inspired Algorithms Karthik Sindhya,

• Bullet train

Nature Inspired Algorithms

NATGEO

Train's nose is designed after the beak of a kingfisher, which dives smoothly into water. (Source: Popular Mechanics)

Page 6: An Introduction to Nature Inspired Algorithmsusers.jyu.fi/~jhaka/opt/An_Introduction_to_Nature_Inspired_Algorithms.pdf · An Introduction to Nature Inspired Algorithms Karthik Sindhya,

• Optimization – An act, process, or methodology of making something (as a design, system, or

decision) as fully perfect, functional, or effective as possible. (http://www.merriam-

webster.com/dictionary)

• Nature as an optimizer – Birds: Minimize drag.

– Humpback whale: Maximize maneuverability (enhanced lift devices to control flow over the flipper and maintain lift at high angles of attack).

– Boxfish: Minimize drag and maximize rigidity of exoskeleton.

– Kingfisher: Minimize micro-pressure waves.

• Consider an optimization problem of the form

Nature Inspired Algorithms for Optimization

Page 7: An Introduction to Nature Inspired Algorithmsusers.jyu.fi/~jhaka/opt/An_Introduction_to_Nature_Inspired_Algorithms.pdf · An Introduction to Nature Inspired Algorithms Karthik Sindhya,

• Objective and constraint functions can be non-differentiable.

• Constraints nonlinear. • Discrete/Discontinuous search space. • Mixed variables (Integer, Real, Boolean etc.) • Large number of constraints and variables. • Objective functions can be multimodal.

– Multimodal functions have more than one optima, but can either have a single or more than one global optima.

• Computationally expensive objective functions and constraints.

Practical Optimization Problems – Charecteristics!

Page 8: An Introduction to Nature Inspired Algorithmsusers.jyu.fi/~jhaka/opt/An_Introduction_to_Nature_Inspired_Algorithms.pdf · An Introduction to Nature Inspired Algorithms Karthik Sindhya,

Practical Optimization Problems – Charecteristics!

Simulation model

Decision vector Objective vector

Optimization algorithm

Page 9: An Introduction to Nature Inspired Algorithmsusers.jyu.fi/~jhaka/opt/An_Introduction_to_Nature_Inspired_Algorithms.pdf · An Introduction to Nature Inspired Algorithms Karthik Sindhya,

• Different methods for different types of problems.

• Constraint handling e.g. using panalty method is sensitive to penalty parameters.

• Often get stuck in local optima (lack global perspective).

• Usually need knowledge of first/second order derivatives of objective functions and constraints.

Traditional Optimization Techniques – Problems!

Page 10: An Introduction to Nature Inspired Algorithmsusers.jyu.fi/~jhaka/opt/An_Introduction_to_Nature_Inspired_Algorithms.pdf · An Introduction to Nature Inspired Algorithms Karthik Sindhya,

Computational intelligence

Nature inspired algorithms

Fuzzy logic systems

Neural networks

Nature Inspired Algorithms for Optimization

Page 11: An Introduction to Nature Inspired Algorithmsusers.jyu.fi/~jhaka/opt/An_Introduction_to_Nature_Inspired_Algorithms.pdf · An Introduction to Nature Inspired Algorithms Karthik Sindhya,

Nature inspired algorithms

Evolutionary algorithms

Genetic algorithm

Differential evolution

Swarm optimization

Particle swarm optimization

Ant colony optimization

.... and many more.

Nature Inspired Algorithms for Optimization

Page 12: An Introduction to Nature Inspired Algorithmsusers.jyu.fi/~jhaka/opt/An_Introduction_to_Nature_Inspired_Algorithms.pdf · An Introduction to Nature Inspired Algorithms Karthik Sindhya,

Evolution

Humans

Macintosh

Nokia

Page 13: An Introduction to Nature Inspired Algorithmsusers.jyu.fi/~jhaka/opt/An_Introduction_to_Nature_Inspired_Algorithms.pdf · An Introduction to Nature Inspired Algorithms Karthik Sindhya,

Evolutionary Algorithms

Charles Darwin

Offsprings created by reproduction, mutation, etc.

Natural selection - A guided search procedure

Individuals suited to the environment survive, reproduce and pass their genetic traits to offspring

Populations adapt to their environment. Variations accumulate over time to generate new species

Page 14: An Introduction to Nature Inspired Algorithmsusers.jyu.fi/~jhaka/opt/An_Introduction_to_Nature_Inspired_Algorithms.pdf · An Introduction to Nature Inspired Algorithms Karthik Sindhya,

• Terminologies 1. Individual - carrier of the genetic information (chromosome). It

is characterized by its state in the search space, its fitness (objective function value).

2. Population - pool of individuals which allows the application of genetic operators.

3. Fitness function - The term “fitness function” is often used as a synonym for objective function.

4. Generation - (natural) time unit of the EA, an iteration step of an evolutionary algorithm.

Evolutionary Algorithms

Page 15: An Introduction to Nature Inspired Algorithmsusers.jyu.fi/~jhaka/opt/An_Introduction_to_Nature_Inspired_Algorithms.pdf · An Introduction to Nature Inspired Algorithms Karthik Sindhya,

Population

Individual

Crossover

Mutation

Parents Offspring

Evolutionary Algorithms

Page 16: An Introduction to Nature Inspired Algorithmsusers.jyu.fi/~jhaka/opt/An_Introduction_to_Nature_Inspired_Algorithms.pdf · An Introduction to Nature Inspired Algorithms Karthik Sindhya,

Evolutionary Algorithms

Step 1 t:= 0

Step 2 Initialize P(t)

Step 3 Evaluate P(t)

Step 4 While not terminate do P’(t) := variation [P(t)]; evaluate [P’(t)]; P(t+1) := select [P’(t) U P(t)]; t := t + 1; od

Reproduced from “Evolutionary Computation: Comments on the History and Current State” – Bäack et. al

Evolutionary algorithms = Selection + Crossover + Mutation

Page 17: An Introduction to Nature Inspired Algorithmsusers.jyu.fi/~jhaka/opt/An_Introduction_to_Nature_Inspired_Algorithms.pdf · An Introduction to Nature Inspired Algorithms Karthik Sindhya,

Evolutionary Algorithms

• Mean approaches optimum

• Variance reduces

Page 18: An Introduction to Nature Inspired Algorithmsusers.jyu.fi/~jhaka/opt/An_Introduction_to_Nature_Inspired_Algorithms.pdf · An Introduction to Nature Inspired Algorithms Karthik Sindhya,

Evolutionary Algorithms

Effi

cie

ncy

Problem type

Random scheme

Robust scheme

Robustness = Breadth + Efficiency

(Goldberg, 1989)

Page 19: An Introduction to Nature Inspired Algorithmsusers.jyu.fi/~jhaka/opt/An_Introduction_to_Nature_Inspired_Algorithms.pdf · An Introduction to Nature Inspired Algorithms Karthik Sindhya,

• Selection - Roulette wheel, Tournement, steady state, etc.

– Motivation is to preserve the best (make multiple copies) and eliminate the worst

• Crossover – simulated binary crossover, Linear crossover, blend crossover, etc.

– Create new solutions by considering more than one individual

– Global search for new and hopefully better solutions

• Mutation – Polynomial mutation, random mutation, etc. – Keep diversity in the population

– 010110 →010100 (bit wise mutation)

Evolutionary Algorithms

Page 20: An Introduction to Nature Inspired Algorithmsusers.jyu.fi/~jhaka/opt/An_Introduction_to_Nature_Inspired_Algorithms.pdf · An Introduction to Nature Inspired Algorithms Karthik Sindhya,

• Tournment selection

Evolutionary Algorithms

23 30

24 11

37 9

23 24

11 9

9 11 23

37 24

30

11

9

Tournment 1 Tournment 2

37 30 Deleted from population

Page 21: An Introduction to Nature Inspired Algorithmsusers.jyu.fi/~jhaka/opt/An_Introduction_to_Nature_Inspired_Algorithms.pdf · An Introduction to Nature Inspired Algorithms Karthik Sindhya,

• Roulette wheel selection (proportional selection)

– Weaker solutions can survive.

Evolutionary Algorithms

Page 22: An Introduction to Nature Inspired Algorithmsusers.jyu.fi/~jhaka/opt/An_Introduction_to_Nature_Inspired_Algorithms.pdf · An Introduction to Nature Inspired Algorithms Karthik Sindhya,

• Concept of exploration vs exploitation.

• Exploration – Search for promising solutions • Crossover and mutation operators

• Exploitation – preferring the good solutions • Selection operator

• Excessive exploration – Random search.

• Excessive exploitation – Premature convergence.

Evolutionary Algorithms

Page 23: An Introduction to Nature Inspired Algorithmsusers.jyu.fi/~jhaka/opt/An_Introduction_to_Nature_Inspired_Algorithms.pdf · An Introduction to Nature Inspired Algorithms Karthik Sindhya,

Good evolutionary algorithm

Exploitation Exploration

Evolutionary Algorithms

Page 24: An Introduction to Nature Inspired Algorithmsusers.jyu.fi/~jhaka/opt/An_Introduction_to_Nature_Inspired_Algorithms.pdf · An Introduction to Nature Inspired Algorithms Karthik Sindhya,

Classical gradient based algorithms

• Convergence to an optimal solution usually depends on the starting solution.

• Most algorithms tend to get stuck to a locally optimal solution.

• An algorithm efficient in solving one class of optimization problem may not be efficient in solving others.

• Algorithms cannot be easily parallelized.

Evolutionary algorithms

• Convergence to an optimal solution is designed to be independent of initial population.

• A search based algorithm. Population helps not to get stuck to locally optimal solution.

• Can be applied to wide class of problems without major change in the algorithm.

• Can be easily parallelized.

Evolutionary Algorithms

Page 25: An Introduction to Nature Inspired Algorithmsusers.jyu.fi/~jhaka/opt/An_Introduction_to_Nature_Inspired_Algorithms.pdf · An Introduction to Nature Inspired Algorithms Karthik Sindhya,

Fitness Landscapes

x

f(x) Ideal and best case

f(x)

x

Multimodal

Nightmare

f(x)

x

f(x)

x

Teaser

Using traditional gradient based methods

Page 26: An Introduction to Nature Inspired Algorithmsusers.jyu.fi/~jhaka/opt/An_Introduction_to_Nature_Inspired_Algorithms.pdf · An Introduction to Nature Inspired Algorithms Karthik Sindhya,

Fitness Landscapes

x

f(x) Ideal and best case

f(x)

x

Multimodal

Nightmare

f(x)

x

f(x)

x

Teaser

Using population based algorithms

Page 27: An Introduction to Nature Inspired Algorithmsusers.jyu.fi/~jhaka/opt/An_Introduction_to_Nature_Inspired_Algorithms.pdf · An Introduction to Nature Inspired Algorithms Karthik Sindhya,

• GA: John Holland in 1962 (UMich) • Evolutionary Strategy: Rechenberg and Schwefel in 1965

(Berlin) • Evolutionary Programming: Larry Fogel in 1965 (California) • First ICGA: 1985 in Carnegie Mellon University • First GA book: Goldberg (1989) • First FOGA workshop: 1990 in Indiana (Theory) • First Fusion: 1990s (Evolutionary Algorithms) • Journals: ECJ (MIT Press), IEEE TEC, Natural Computation

(Elsevier) • GECCO and CEC since 1999, PPSN since 1990 • About 20 major conferences each year

History of Evolutionary Algorithms

Page 28: An Introduction to Nature Inspired Algorithmsusers.jyu.fi/~jhaka/opt/An_Introduction_to_Nature_Inspired_Algorithms.pdf · An Introduction to Nature Inspired Algorithms Karthik Sindhya,

• Proposed by R. Storn and K. Price (1997) – Storn, R., Price, K. (1997). "Differential evolution - a simple and efficient heuristic for global optimization over continuous

spaces“, Journal of Global Optimization 11: 341–359.

• A population based approach for minimization of functions – A maximization function is converted to a

minimization function (max f(x) = -min(f(x))

• Parameters to be set – NP, Population size (5 – 10) x number of variables – F, Scaling factor [0,2] – CR, Crossover ratio [0,1] – NGEN, Maximum number of generations

Differential Evolution

Page 29: An Introduction to Nature Inspired Algorithmsusers.jyu.fi/~jhaka/opt/An_Introduction_to_Nature_Inspired_Algorithms.pdf · An Introduction to Nature Inspired Algorithms Karthik Sindhya,

Differential Evolution

x4-x5

v1 = x3 + F(x4-x5)

X1 x2 x3 x4 x5

f1 f2 f3 f4 f5

P1 P2 P3 P4 P5

X

Y

Z

fI fII fI < fII

X1

fI Y

X1

fII

N

X1 x2 x3 x4 x5

f1 f2 f3 f4 f5

C5 C1 C2 C3 C4

Target vector

Trial vector

Y

Z

Rand < CR

Mutation

Crossover

Page 30: An Introduction to Nature Inspired Algorithmsusers.jyu.fi/~jhaka/opt/An_Introduction_to_Nature_Inspired_Algorithms.pdf · An Introduction to Nature Inspired Algorithms Karthik Sindhya,

• DE Scheme

– DE/x/y/z

• x: specifies the vector to be mutated which currently is “rand”.

• y: number of difference vectors used.

• z: denotes the crossover scheme. The current variant is “bin”. Also ‘exp’ is available.

• DE/rand/1/bin

Differential Evolution

Page 31: An Introduction to Nature Inspired Algorithmsusers.jyu.fi/~jhaka/opt/An_Introduction_to_Nature_Inspired_Algorithms.pdf · An Introduction to Nature Inspired Algorithms Karthik Sindhya,

Differential Evolution

x4 x5

Minimum

v1 = x3 + F(x4-x5)

x3 v1

x1

x2

Mutation

t1

v1

c2

c1

x1

x2

Crossover

Page 32: An Introduction to Nature Inspired Algorithmsusers.jyu.fi/~jhaka/opt/An_Introduction_to_Nature_Inspired_Algorithms.pdf · An Introduction to Nature Inspired Algorithms Karthik Sindhya,

Constraint Handling

• Penalty parameter-less approach

– A feasible solution is preferred to infeasible solution

– When both solutions feasible, choose the solution with better function value

– When both solutions are infeasible, choose the solution with lower constraint violation

Page 33: An Introduction to Nature Inspired Algorithmsusers.jyu.fi/~jhaka/opt/An_Introduction_to_Nature_Inspired_Algorithms.pdf · An Introduction to Nature Inspired Algorithms Karthik Sindhya,

• Box constraints

– If variable is lower/higher than lower/upper bound,

• set to lower/upper bound

• A random value inside the bounds

Constraint Handling

Page 34: An Introduction to Nature Inspired Algorithmsusers.jyu.fi/~jhaka/opt/An_Introduction_to_Nature_Inspired_Algorithms.pdf · An Introduction to Nature Inspired Algorithms Karthik Sindhya,

• No guarantee of finding an optimal solution in finite time – Asymptotic convergence

• Containing a number of parameters – Sometimes the result is highly dependent on the

parameters set

– Self-adaptive parameters are commonly used

• Computationally very expensive – Metamodels of functions are commonly used

Limitations of Evolutionary Algorithms

Page 35: An Introduction to Nature Inspired Algorithmsusers.jyu.fi/~jhaka/opt/An_Introduction_to_Nature_Inspired_Algorithms.pdf · An Introduction to Nature Inspired Algorithms Karthik Sindhya,

• Application 1

– Tracking suspect

• Caldwell and Johnston, 1991

• Objective function: fitness rating on a nine point scale

Applications

Page 36: An Introduction to Nature Inspired Algorithmsusers.jyu.fi/~jhaka/opt/An_Introduction_to_Nature_Inspired_Algorithms.pdf · An Introduction to Nature Inspired Algorithms Karthik Sindhya,

• Optimization (Min/Max) of functions

• Airfoil optimization

• Evolving optimal structure

• Games

• NOTE: A few parts of the slides are borrowed from slides of Prof. Deb. Special thanks

to him.

Applications