overview of heuristic optimization › ... › overview_heuristic.pdfdepartment of civil and...

38
Florida International University Department of Civil and Environmental Engineering Optimization in Water Resources Engineering, Spring 2020 Arturo S. Leon, Ph.D., P.E., D.WRE OVERVIEW OF HEURISTIC OPTIMIZATION

Upload: others

Post on 27-Jun-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: OVERVIEW OF HEURISTIC OPTIMIZATION › ... › Overview_heuristic.pdfDepartment of Civil and Environmental Engineering Optimization in Water Resources Engineering, Spring 2020 Arturo

Florida International University Department of Civil and Environmental Engineering

Optimization in Water Resources Engineering, Spring 2020

Arturo S. Leon, Ph.D., P.E., D.WRE

OVERVIEW OF HEURISTIC OPTIMIZATION

Page 2: OVERVIEW OF HEURISTIC OPTIMIZATION › ... › Overview_heuristic.pdfDepartment of Civil and Environmental Engineering Optimization in Water Resources Engineering, Spring 2020 Arturo

OPTIMIZATION CLASSIFICATION (Recap)

Local

Multi-Objective

Un-Constrained

Non-GradientGradient Based

Constrained

Single-Objective

Global

Page 3: OVERVIEW OF HEURISTIC OPTIMIZATION › ... › Overview_heuristic.pdfDepartment of Civil and Environmental Engineering Optimization in Water Resources Engineering, Spring 2020 Arturo

LIMITATIONS OF DESCENT METHODS

Descent method procedure is efficient when the objective function F is uni-modular(one local optimum only).

In case F is multi-modular, not easy to get out of the neighborhood of localoptimum

F(X)

X

F(X)

X

REASONS FOR Heuristic search

Page 4: OVERVIEW OF HEURISTIC OPTIMIZATION › ... › Overview_heuristic.pdfDepartment of Civil and Environmental Engineering Optimization in Water Resources Engineering, Spring 2020 Arturo

HEURISTIC METHODS – INTRODUCTION Heuristic methods, as non-gradient methods, do not require any

derivatives of the objective function in order to calculate theoptimum, they are also known as black box methods.

Heuristics are typically used to solve complex (large, nonlinear, non-convex (i.e. contain local minima)) multivariate combinatorialoptimization problems that are difficult to solve.

Page 5: OVERVIEW OF HEURISTIC OPTIMIZATION › ... › Overview_heuristic.pdfDepartment of Civil and Environmental Engineering Optimization in Water Resources Engineering, Spring 2020 Arturo

Plumbing the depth

ExperimenterSearch area

THE SEARCH FOR THE OPTIMUM IN HEURISTIC METHODS (smooth functions)

Page 6: OVERVIEW OF HEURISTIC OPTIMIZATION › ... › Overview_heuristic.pdfDepartment of Civil and Environmental Engineering Optimization in Water Resources Engineering, Spring 2020 Arturo

ExperimenterPlumbing the depth

Search area

THE SEARCH FOR THE OPTIMUM IN HEURISTIC METHODS (Non-smooth functions)

Page 7: OVERVIEW OF HEURISTIC OPTIMIZATION › ... › Overview_heuristic.pdfDepartment of Civil and Environmental Engineering Optimization in Water Resources Engineering, Spring 2020 Arturo

2-D PACKAGING – AN EXAMPLE

Page 8: OVERVIEW OF HEURISTIC OPTIMIZATION › ... › Overview_heuristic.pdfDepartment of Civil and Environmental Engineering Optimization in Water Resources Engineering, Spring 2020 Arturo

23

1

5

4

Sequence = 1,2,3,4,5

X

2-D PACKAGING – AN EXAMPLE

Page 9: OVERVIEW OF HEURISTIC OPTIMIZATION › ... › Overview_heuristic.pdfDepartment of Civil and Environmental Engineering Optimization in Water Resources Engineering, Spring 2020 Arturo

231 54

Sequence = 1, 4, 3, 2, 5

2-D PACKAGING – AN EXAMPLE

Page 10: OVERVIEW OF HEURISTIC OPTIMIZATION › ... › Overview_heuristic.pdfDepartment of Civil and Environmental Engineering Optimization in Water Resources Engineering, Spring 2020 Arturo

23

1

5

4

Sequence = 1, 4, 3, 2, 5

2-D PACKAGING – AN EXAMPLE

Page 11: OVERVIEW OF HEURISTIC OPTIMIZATION › ... › Overview_heuristic.pdfDepartment of Civil and Environmental Engineering Optimization in Water Resources Engineering, Spring 2020 Arturo

THAT WAS EASY!

For 5 pieces there are 5 x 4 x 3 x 2 x 1 different orderings for the placement

= 120 combinations

Piece of cake for a computer to try each combination in (nearly) no time at all

Page 12: OVERVIEW OF HEURISTIC OPTIMIZATION › ... › Overview_heuristic.pdfDepartment of Civil and Environmental Engineering Optimization in Water Resources Engineering, Spring 2020 Arturo

How do we pack all of these?

?(50 pieces)

Page 13: OVERVIEW OF HEURISTIC OPTIMIZATION › ... › Overview_heuristic.pdfDepartment of Civil and Environmental Engineering Optimization in Water Resources Engineering, Spring 2020 Arturo

THAT’S NOT SO EASY! 50 pieces means 50 x 49 x…..2 x 1 different orderings

=30414093201713378043612608166064768844377641568960512000000000000

That’s quite a lot really. If a computer could evaluate 1000 orderings persecond it’d still take approximately:

964424568801159882154128873860501295166718720476931506years! (and that’s without being allowed to rotate the pieces)

Page 14: OVERVIEW OF HEURISTIC OPTIMIZATION › ... › Overview_heuristic.pdfDepartment of Civil and Environmental Engineering Optimization in Water Resources Engineering, Spring 2020 Arturo

Basic idea behind the development of heuristics is “NATURE”

OVERVIEW OF MOST COMMON HEURISTIC METHODS

Page 15: OVERVIEW OF HEURISTIC OPTIMIZATION › ... › Overview_heuristic.pdfDepartment of Civil and Environmental Engineering Optimization in Water Resources Engineering, Spring 2020 Arturo

GENETIC ALGORITHM (Holland –1975)

Organisms produce a number of offspring similar to themselves but can have variations due to: Mutations (random changes)

Sexual reproduction (offspring have combinations of features inherited from each parent)

Inspired by genetics and natural selection – survival of the fittest

Page 16: OVERVIEW OF HEURISTIC OPTIMIZATION › ... › Overview_heuristic.pdfDepartment of Civil and Environmental Engineering Optimization in Water Resources Engineering, Spring 2020 Arturo

GENETIC ALGORITHM (Cont.)

Optimal Solution

Initialize population

Evaluation of Fitness

Selection (two parent chromosomes)

Mutation

crossover

yes

no

Insert offspring into the population

GAs were invented to mimic some of theprocesses observed in natural and biologicalevolution

Provide efficient, effective techniques foroptimization and machine learningapplications

Page 17: OVERVIEW OF HEURISTIC OPTIMIZATION › ... › Overview_heuristic.pdfDepartment of Civil and Environmental Engineering Optimization in Water Resources Engineering, Spring 2020 Arturo

SIMULATED ANNEALING (Kirkpatrick –1983)

Simulated annealing is based on ananalog of cooling the material in a heatbath – a process known as annealing. Asolid material is heated in a heat bathuntil it melts, then cooling it down slowlyuntil it crystallizes into a solid state (low-energy state).

Definition: A heuristic technique thatmathematically mirrors the cooling of aset of atoms to a state of minimumenergy.

Page 18: OVERVIEW OF HEURISTIC OPTIMIZATION › ... › Overview_heuristic.pdfDepartment of Civil and Environmental Engineering Optimization in Water Resources Engineering, Spring 2020 Arturo

SIMULATED ANNEALING SA is a general solution method that is easily

applicable to a large number of problems.

"Tuning" of the parameters (initial temp, decrementof temp, stop criterion) is relatively easy.

Generally the quality of the results of SA is good.

SA can leave an optimal solution and not find itagain (so try to remember the best solution foundso far).

Design Variables (X)

Evaluate Solution

Update the Current Solution

Decrease Temperature

AcceptedNo

Yes

No

No

Generate 

New Solution

Change Temperature

Yes

Yes

Stopping Criteria

SA Optimal Design (X*SA)

Page 19: OVERVIEW OF HEURISTIC OPTIMIZATION › ... › Overview_heuristic.pdfDepartment of Civil and Environmental Engineering Optimization in Water Resources Engineering, Spring 2020 Arturo

PARTICLE SWARM OPTIMIZATION (Eberhart Kennedy -1995)

A robust stochastic optimization techniqueinspired by the social behavior of swarms ofinsects or flocks of birds –maximize “food”.

Apply the concept of social interaction toproblem solving.

Developed in 1995 by James Kennedy (social-psychologist) and Russell Eberhart (electricalengineer).

Page 20: OVERVIEW OF HEURISTIC OPTIMIZATION › ... › Overview_heuristic.pdfDepartment of Civil and Environmental Engineering Optimization in Water Resources Engineering, Spring 2020 Arturo

PARTICLE SWARM OPTIMIZATION In PSO individuals strive to improve themselves and often achieve this by

observing and imitating their neighbors.

Each PSO individual has the ability to remember.

PSO has simple algorithms and low overhead. Making it more popular in some circumstances than Genetic/ Evolutionary Algorithms Has only one operation calculation:

Velocity: a vector of numbers that are added to the position coordinates to move an individual

Inspiration from Flock of birds, Schools of fish.

Page 21: OVERVIEW OF HEURISTIC OPTIMIZATION › ... › Overview_heuristic.pdfDepartment of Civil and Environmental Engineering Optimization in Water Resources Engineering, Spring 2020 Arturo

ANT COLONY OPTIMIZATION Ant Algorithms

Inspired by observation of real ants

Ant Colony Optimization (ACO) Inspiration from ant colonies’ foraging

behavior (actions of the colony findingfood)

Pheromone trail for stigmergiccommunication

Sequence of moves to find shortestpaths

Page 22: OVERVIEW OF HEURISTIC OPTIMIZATION › ... › Overview_heuristic.pdfDepartment of Civil and Environmental Engineering Optimization in Water Resources Engineering, Spring 2020 Arturo

NATURAL BEHAVIOUR OF ANTS

Page 23: OVERVIEW OF HEURISTIC OPTIMIZATION › ... › Overview_heuristic.pdfDepartment of Civil and Environmental Engineering Optimization in Water Resources Engineering, Spring 2020 Arturo

ANT COLONY OPTIMIZATION (Cont.)

Inspired by foraging behavior of ants.

Ants find shortest path to food source from nest.

Ants deposit pheromone along traveled path which is used by other ants to followthe trail. This kind of indirect communication via the local environment is called stigmergy.

Has adaptability, robustness and redundancy.

Page 24: OVERVIEW OF HEURISTIC OPTIMIZATION › ... › Overview_heuristic.pdfDepartment of Civil and Environmental Engineering Optimization in Water Resources Engineering, Spring 2020 Arturo

FORAGING BEHAVIOR OF ANTS

Two ants start with equal probability of going on either path.

Page 25: OVERVIEW OF HEURISTIC OPTIMIZATION › ... › Overview_heuristic.pdfDepartment of Civil and Environmental Engineering Optimization in Water Resources Engineering, Spring 2020 Arturo

FORAGING BEHAVIOR OF ANTS

The ant on shorter path will arrive earlier to the food.

Page 26: OVERVIEW OF HEURISTIC OPTIMIZATION › ... › Overview_heuristic.pdfDepartment of Civil and Environmental Engineering Optimization in Water Resources Engineering, Spring 2020 Arturo

FORAGING BEHAVIOR OF ANTS (Cont.)

The density of pheromone on the shorter path is higher because of 2 passes bythe ant (as compared to 1 by the other).

Page 27: OVERVIEW OF HEURISTIC OPTIMIZATION › ... › Overview_heuristic.pdfDepartment of Civil and Environmental Engineering Optimization in Water Resources Engineering, Spring 2020 Arturo

FORAGING BEHAVIOR OF ANTS (Cont.)

The next ant takes the shorter route.

Page 28: OVERVIEW OF HEURISTIC OPTIMIZATION › ... › Overview_heuristic.pdfDepartment of Civil and Environmental Engineering Optimization in Water Resources Engineering, Spring 2020 Arturo

FORAGING BEHAVIOR OF ANTS (Cont.)

Over many iterations, more ants begin using the path with higher pheromone,thereby further reinforcing it.

Page 29: OVERVIEW OF HEURISTIC OPTIMIZATION › ... › Overview_heuristic.pdfDepartment of Civil and Environmental Engineering Optimization in Water Resources Engineering, Spring 2020 Arturo

FORAGING BEHAVIOR OF ANTS (Cont.)

After some time, the shorter path is almost exclusively used.

Page 30: OVERVIEW OF HEURISTIC OPTIMIZATION › ... › Overview_heuristic.pdfDepartment of Civil and Environmental Engineering Optimization in Water Resources Engineering, Spring 2020 Arturo

TABU SEARCH Attributed to Glover (1990)

Search by avoiding points in the design space that were previously visited (TABU)– KEEP MEMORY

Accept a new “poorer” solution if it avoids a solution that was alreadyinvestigated – MAXIMIZE NEW INFORMATION

Intent is to avoid local minima

Record all previous moves in a “running list” = MEMORY

Page 31: OVERVIEW OF HEURISTIC OPTIMIZATION › ... › Overview_heuristic.pdfDepartment of Civil and Environmental Engineering Optimization in Water Resources Engineering, Spring 2020 Arturo

TABU SEARCH (Cont.) Record recent, now forbidden, moves in “tabu” list.

First “diversification” then “intensification”.

Applied to combinatorial optimization problems.

Neighbor Search

Sequential

Adaptive

Page 32: OVERVIEW OF HEURISTIC OPTIMIZATION › ... › Overview_heuristic.pdfDepartment of Civil and Environmental Engineering Optimization in Water Resources Engineering, Spring 2020 Arturo

THE TWO-DIMENSIONAL SURFPACK EXAMPLE (MATLAB “PEAKS” FUNCTION )

x1 x2

f

Matlab Folder: Global Search Demo

Page 33: OVERVIEW OF HEURISTIC OPTIMIZATION › ... › Overview_heuristic.pdfDepartment of Civil and Environmental Engineering Optimization in Water Resources Engineering, Spring 2020 Arturo

Objective function: Minimize f(x1,x2).

Constraints: + 9

Multistart Method with fmincon GlobalSearch Method with fmincon

THE TWO-DIMENSIONAL SURFPACK EXAMPLE (CONT.)

Name of MATLAB File: GlobalOptimization_MAIN_FILE.m

Page 34: OVERVIEW OF HEURISTIC OPTIMIZATION › ... › Overview_heuristic.pdfDepartment of Civil and Environmental Engineering Optimization in Water Resources Engineering, Spring 2020 Arturo

Pattern Search Solver Genetic Algorithm Solver

THE TWO-DIMENSIONAL SURFPACK EXAMPLE (CONT.)

Page 35: OVERVIEW OF HEURISTIC OPTIMIZATION › ... › Overview_heuristic.pdfDepartment of Civil and Environmental Engineering Optimization in Water Resources Engineering, Spring 2020 Arturo

COMPARISON OF FUNCTION EVALUATIONS AND CPU TIME

Name of MATLAB File: FUNCTION_EVALU_CPU_comparison.m

Page 36: OVERVIEW OF HEURISTIC OPTIMIZATION › ... › Overview_heuristic.pdfDepartment of Civil and Environmental Engineering Optimization in Water Resources Engineering, Spring 2020 Arturo

HANDS-ON DEMONSTRATION1. Change initial point 2. Change constraint function

(peaksCon.m) (from circle with radius 3 to circle with radius 2)

3. Other changes?

Page 37: OVERVIEW OF HEURISTIC OPTIMIZATION › ... › Overview_heuristic.pdfDepartment of Civil and Environmental Engineering Optimization in Water Resources Engineering, Spring 2020 Arturo

DEMO: TOPOGRAPHY MAP OF WHITE MOUNTAINSIn this demo, we will find the highest point in the topography of the White Mountains in Washington using the pattern search method. The topography data is provided by the United States Geological Survey (USGS) 7.5-minute Digital Elevation Model (DEM) in Spatial Data Transfer Standard (SDTS) format for the Mt. Washington quadrangle (http://edc.usgs.gov/products/elevation/dem.html). (x,y) are co-ordinates of a point in easting and northing units, respectively and Z is the elevation in feet.

Page 38: OVERVIEW OF HEURISTIC OPTIMIZATION › ... › Overview_heuristic.pdfDepartment of Civil and Environmental Engineering Optimization in Water Resources Engineering, Spring 2020 Arturo

DEMO: TOPOGRAPHY MAP OF WHITE MOUNTAINS (CONT.)

Name of MATLAB Folder: Pattern_search_Washington_DemoName of MATLAB main File: MAINFile.m

Demo tasks: 1. Change initial starting point 2. Change optimization and plot options3. Evaluate sensitivity of solutions4. Write a while loop for evaluating 10 random initial starting points5. Write a while loop for evaluating 10 ‘InitialMeshSize’ and

'MeshTolerance‘ (Use MATLAB Random function randi([Xmin Xmax]))