0% found this document useful (0 votes)
4 views53 pages

1b, Meta-Heuristics

The document discusses operational research and meta-heuristics, emphasizing the importance of optimization methods for effective decision-making in complex scenarios. It covers various optimization models, algorithms, and the distinction between exact and approximate methods, including metaheuristics inspired by nature and social behavior. Additionally, it explains local search optimization techniques and their application in problems like the Traveling Salesman Problem (TSP).

Uploaded by

hoanggkhoiii
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views53 pages

1b, Meta-Heuristics

The document discusses operational research and meta-heuristics, emphasizing the importance of optimization methods for effective decision-making in complex scenarios. It covers various optimization models, algorithms, and the distinction between exact and approximate methods, including metaheuristics inspired by nature and social behavior. Additionally, it explains local search optimization techniques and their application in problems like the Traveling Salesman Problem (TSP).

Uploaded by

hoanggkhoiii
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 53

OPERATIONAL RESEARCH

META-HEURISTICS
MEHRDAD MOHAMMADI & PATRICK MEYER
CONTENT
1. INTRODUCTION

2. OPTIMIZATION METHODS

3. SOLUTION ALGORITHMS

4. LOCAL SEARCH OPTIMIZATION

5. METAHEURISTIC ALGORITHMS
INTRODUCTION 3
Optimization? Why?

DECISION MAKING

Decision making is everywhere

Due to complexity and to stay in competitive


edge, decision making must be in a rational
and optimal way

► Problem formulation,
► Problem modeling,
► Problem optimization and
► Solution implementation

Formulate Model Optimize Implement


Solution

OR - METAHEURISTICS 14/01/2019
INTRODUCTION 4
Optimization Models

Optimization Models

Mathematical Combinatorial Constraint Satisfaction


Nonanalytic Models
Programming Models Optimization Models

Continuous Integer Mixed

Linear (LP/ILP) Nonlinear (NLP)

► Mathematical Programming: Objective(s) and Constraints; Optimal Solution(s)

► Constraint Programming: Constraints; Feasible Solution(s)

OR - METAHEURISTICS 14/01/2019
INTRODUCTION 5
Optimization vs. Complexity

► Complexity of Algorithms

► An algorithm needs two important resources to solve a problem: time and space

► The time complexity of an algorithm is the number of steps required to solve a


problem of size n

► Logarithmic-time algorithm  log(n)


► Polynomial-time algorithm  nk
► Exponential-time algorithm  2n
► …

OR - METAHEURISTICS 14/01/2019
INTRODUCTION 6
Optimization vs. Complexity

► Complexity of Algorithms

► An algorithm needs two important resources to solve a problem: time and space

► The time complexity of an algorithm is the number of steps required to solve a


problem of size n

► Logarithmic-time algorithm  log(n)


► Polynomial-time algorithm  nk
► Exponential-time algorithm  2n
► …

Complexity Size n
10 20 30 40 50
O(n) 10 μs 20 μs 30 μs 40 μs 50 μs
O(n2) 100 µs 400 µs 900 µs 1600 µs 2500 µs
O(2n) 1000 µs 106 µs 6.4E10 µs 12.7 days 35.7 years
O(n!) 1.8E5 µs 19 cen. 1.6E15 cen. 4.2E30 cen. …
OR - METAHEURISTICS 14/01/2019
INTRODUCTION 7
Traveling Salesman Problem (TSP)

► Data: n cities; Distance matrix D=(dij)

► Problem: “What is the shortest possible route


that visits each city exactly once and returns to
the origin city?”

► Ω: Set of permutations of n elements

𝑛−1 !
► Ω = for a symmetric problem
2

► Enumeration algorithm: O(n!)


n Ω CPU Time - Generate all possible tours
5 12 12 µs - Calculate the length of tours
- Find the tour with the minimum distance
10 181400 0.18 s
20 6E16 19 cen. ► 1 µs for evaluating each tour
30 4E30 1.4E15 cen.

OR - METAHEURISTICS 14/01/2019
OPTIMIZATION METHODS 8
Terminology

► Complete methods: find always a particular solution


► Exact methods: obtain optimal solutions and guarantee their optimality
► Approximate (or heuristic) methods: generate high quality solutions in a reasonable
time for practical use, but there is no guarantee of finding a global optimal solution

Optimization Methods

Exact Methods Approximate Methods

Constraint Dynamic Heuristic Approximation


Branch & X
Programming Programming Algorithms Algorithms

Problem-specific
Metaheuristics
Heuristics

Single-solution based Population based


Metaheuristics Metaheuristics
OR - METAHEURISTICS 14/01/2019
OPTIMIZATION METHODS 9
Metaheuristics

► Heuristic (from an old Greek word heuriskein):

“the art of discovering new strategies (rules) to solve problems”

► Meta (a Greek word):

“upper level methodology”

► Metaheuristic:

“Upper level general methodologies that can be used as guiding strategies in designing
underlying heuristics to solve specific optimization problems”

OR - METAHEURISTICS 14/01/2019
OPTIMIZATION METHODS 10
Metaheuristics

► Nature inspired vs. Non-nature inspired


- Biology: Genetic Algorithm or Artificial Immune Systems
- Swarm Intelligence: Ants or Bees Colony Optimization, Particle Swarm Optimization, Frog
Leaping algorithm, …
- Physics: Simulated Annealing Algorithm
- Social Behavior: Imperialist Competitive Algorithm, Teacher Learning Algorithm, …

► Memory usage vs. Memoryless


- Local Search, GRASP, Simulated Annealing
- Tabu Search: short-term and long-term memories

► Deterministic vs. Stochastic


- Deterministic: Optimization problem is solved by making deterministic decisions (e.g., LS &
TS). Same initial solution will lead to the same final solution
- Stochastic: Optimization problem is solved by some random rules (e.g., SA & GA). Different
final solutions may be obtained from the same initial solution.

► Population-based vs. Single-solution based


► Iterative vs. Greedy (Constructive)
- Starting from a complete solution vs. starting from an empty solution

OR - METAHEURISTICS 14/01/2019
OPTIMIZATION METHODS 11
Metaheuristics

► Exploration vs. Exploitation


- Exploration of the search space (Diversification) and Exploitation of the best solutions found
(Intensification)
- Good solutions are clue for promising regions

In intensification, the In diversification, non-


promising regions are explored regions must be
explored more thoroughly visited to be sure that all
in the hope to find better regions of the search
solutions space are evenly explored
and to avoid from local
optima traps

Local Search Single-solution based Population-based Random Search


Algorithms Algorithms

Intensification Diversification

Best algorithms
are good in both

OR - METAHEURISTICS 14/01/2019
SOLUTION ALGORITHMS 12
How to Search?

Heuristic Algorithms
Mechanism

Construction Local Search Evolution Hybrid

· Greedy Search · SA, VNS, TS, ... · GA, ICA, PSO, ... · LS + EA

► Construction: A solution is constructed (become completed) through specific steps


► Local Search: An initial solutions is manipulated and improved iteratively
► Evolution: A population of solutions are evolved stochastically
► Hybrid: A combination of local search and evolutionary algorithms

OR - METAHEURISTICS 14/01/2019
SOLUTION ALGORITHMS 13
Construction Mechanism: Greedy Search

OR - METAHEURISTICS 14/01/2019
SOLUTION ALGORITHMS 14
Greedy Search for TSP

► Nearest Neighbor Algorithm

- Step 1: Select a node randomly (if not given) and name it current node

- Step 2: Go to the next node which is the closest one to the current node

- Step 3: Update current node

- Step 4: If no unvisited node, go to Step 5; o.w. go to Step 2.

- Step 5: Connect current node to the starting node and return the tour.

- Complexity: O(n2)

OR - METAHEURISTICS 14/01/2019
SOLUTION ALGORITHMS 15
Greedy Search for TSP

7 5

10 9
3

1
2
OR - METAHEURISTICS 14/01/2019
SOLUTION ALGORITHMS 16
Greedy Search for TSP

7 5

10 9
3

1
2
OR - METAHEURISTICS 14/01/2019
SOLUTION ALGORITHMS 17
Greedy Search for TSP

7 5

10 9
3

1
2
OR - METAHEURISTICS 14/01/2019
SOLUTION ALGORITHMS 18
Greedy Search for TSP

7 5

10 9
3

1
2
OR - METAHEURISTICS 14/01/2019
SOLUTION ALGORITHMS 19
Greedy Search for TSP

7 5

10 9
3

1
2
OR - METAHEURISTICS 14/01/2019
SOLUTION ALGORITHMS 20
Greedy Search for TSP

7 5

10 9
3

1
2
OR - METAHEURISTICS 14/01/2019
SOLUTION ALGORITHMS 21
Greedy Search for TSP

7 5

10 9
3

1
2
OR - METAHEURISTICS 14/01/2019
SOLUTION ALGORITHMS 22
Greedy Search for TSP

7 5

10 9
3

1
2
OR - METAHEURISTICS 14/01/2019
SOLUTION ALGORITHMS 23
Greedy Search for TSP

7 5

10 9
3

1
2
OR - METAHEURISTICS 14/01/2019
SOLUTION ALGORITHMS 24
Greedy Search for TSP

7 5

10 9
3

1
2
OR - METAHEURISTICS 14/01/2019
SOLUTION ALGORITHMS 25
Greedy Search for TSP

7 5

10 9
3

1
2
OR - METAHEURISTICS 14/01/2019
SOLUTION ALGORITHMS 26
Greedy Search for TSP

7 5

10 9
3

1
2
OR - METAHEURISTICS 14/01/2019
SOLUTION ALGORITHMS 27
Greedy Search for TSP

7 5

10 9
3

1
2
OR - METAHEURISTICS 14/01/2019
LOCAL SEARCH OPTIMIZATION 46
History of Hikers

► 4 hikers are lost in a foggy mountain


at night
► No map and only a headlamp to see
immediate surroundings
► An altimeter and a compass

► Objective: to reach the valley of


lower altitude, where the reliefs
pass regularly
► At trail crossing, each time they can
try only one trail

OR - METAHEURISTICS 14/01/2019
LOCAL SEARCH OPTIMIZATION 47
History of Hikers

► Hiker 1
► Strategy: “I am sportive and I explore all the possible
trails”
► Result: He is hiking infinitely in the mountain.

► Note: Enumeration search is not logical, it is stupidity.

Local Optimum
Local Optimum
OR - METAHEURISTICS Global Optimum
14/01/2019
LOCAL SEARCH OPTIMIZATION 48
History of Hikers

► Hiker 2
► Strategy: “As long as I can go down, I do it”
► Result: He will be trapped in a local valley

► Note: Greedy approach leads to local optimum

Local Optimum
Local Optimum

OR - METAHEURISTICS
Global Optimum 14/01/2019
LOCAL SEARCH OPTIMIZATION 49
History of Hikers

► Hiker 3
► Strategy: “I go down, but sometimes I may take paths
that do not go up too much”
► Result: He arrives to lower alleys comparing to Hiker 2
and he may be trapped in a local valley

► Note: Accepting worse solutions may help us to scape


from local optima

Local Optimum
Local Optimum
OR - METAHEURISTICS Global Optimum
14/01/2019
LOCAL SEARCH OPTIMIZATION 50
History of Hikers

► Hiker 4
► Strategy: “As long as possible, I take paths with high
slope, but sometimes I may take paths that do not go
up too much. I also memorize and avoid from the trails
already taken”
► Result: Same as the 3rd hiker but may spend less
time to arrive
Forbidden path
► Note: short memories avoids
infinite loops and may save time

Local Optimum
Local Optimum
OR - METAHEURISTICS Global Optimum
14/01/2019
LOCAL SEARCH OPTIMIZATION 51
Principales

► local search is a heuristic method for solving computationally hard


optimization problems.

► Local search algorithms move from solution to solution in the search space by
applying local changes, until a solution deemed optimal is found or a time bound is
elapsed.

► Requirements:
A. Initial solution
B. Local search operators (searching neighbors))

► Local improvements MAY LEAD us toward the optimal solution

OR - METAHEURISTICS 14/01/2019
LOCAL SEARCH OPTIMIZATION 52
LS for TSP

► Solution Representation of TSP:


- A permutation of integer numbers representing the number of cities
- The order of integer numbers are the order of visiting the cities

1 4 8 7 5 2 10 9 3 6

► Step 1: Initial solution is generated randomly.

► Step 2: Initial solution is altered in the chance of finding better solutions


(tour of cities with less cost or time)  Neighborhood Search

► Step 3: If the new solution is better than the previous one, replace them
and go to Step 2; if not go to Step 4.

► Step 4: If no improvement can be found, Stop.


OR - METAHEURISTICS 14/01/2019
LOCAL SEARCH OPTIMIZATION 53
LS for TSP

► Neighborhood Search: Making small changes in the solution

► Operator Insertion
- Select two nodes i and j, and insert j next to i

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

► Operator Swap
- Select two nodes i and j, and swap their position

1 4 8 7 5 2 10 9 3 6

1 4 10 7
OR - METAHEURISTICS
5 2 8 9 3
14/01/2019
6
LOCAL SEARCH OPTIMIZATION 54
LS for TSP

► Neighborhood Search

► Operator Reversion
- Select two nodes i and j, and reverse in-between permutation

1 4 8 7 5 2 10 9 3 6

1 4 10 2 5 7 8 9 3 6

► Operator 2-opt
- Select two edges, change their place

1 4 8 7 5 2 10 9 3 6
1 4 2 10 5 8 7 9 3 6
OR - METAHEURISTICS 14/01/2019
LOCAL SEARCH OPTIMIZATION 57
Discussion

► Advantage
- Good Intensification (They exploit around carefully)
- Use very little memory
- Providing better solution comparing to greedy and approximation
searches

► Disadvantage
- Getting trap in local optima
- Require problem-specific operators (sometimes)
- Their performance highly depends on the initial solution (They need good
enough initial solutions to work well)

OR - METAHEURISTICS 14/01/2019
METAHEURISTIC ALGORITHMS 58
Genetic Algorithm (GA)

► What codes for physical traits?


- The Genotype (DNA)
► Where did organism come from?
- Reproduction
► Survive or Extinct?
- Fitness
► How change over time?

OR - METAHEURISTICS 14/01/2019
METAHEURISTIC ALGORITHMS 59
Genetic Algorithm (GA): Principles

► GA was proposed by John Henry Holland in the 1970s

► In GA, a population of candidate solutions (called individuals, creatures, or


phenotypes) to an optimization problem is evolved toward better solutions

► Each individual has a set of properties (its chromosomes or genotype)

► Each individual is evaluated based on its properties (Fitness value); this evaluation
helps to survive

► Properties are shared between individuals of population or altered (crossover or


mutation)

OR - METAHEURISTICS 14/01/2019
METAHEURISTIC ALGORITHMS 60
Genetic Algorithm (GA): General Framework

Evolution Evolution
Generation 1

Generation 2

Generation 3
(Collectively/Individually) (Collectively/Individually)


Improvement Improvement
(Changes) (Changes)

Evolution Generation I-1 Evolution

Generation I
(Collectively/Individually) (Collectively/Individually)

… Stop
Improvement Improvement
(Changes) (Changes)

OR - METAHEURISTICS 14/01/2019
METAHEURISTIC ALGORITHMS 61
Genetic Algorithm (GA): Solution Representation

Solution Representation
► Solution Representation (SR)
- A vector, A matrix or A structure of Data that corresponds to a solution
- Permutation of N cities is a SR in TSP

5 1 8 4 3 2 7 6

- A binary matrix for allocating N customers to M facilities

Facilities 1 1
1 2 3

Customers
1 1 0 1

Facilities
Customers

2 0 1 0 2
3 0 1 1 3
4 1 0 1

OR - METAHEURISTICS
4 14/01/2019
3
METAHEURISTIC ALGORITHMS 62
Genetic Algorithm (GA): Individuals Population

Solution Representation

► A population of solutions with fixed size P


Individuals Population

► A (P x N) matrix of permutations for TSP Individuals Evaluation

Permutations of N Cities
Individual Selection
1 2 5 4 1 3 7 8 6
2 5 7 6 8 2 1 3 4
Crossover & Mutation
Individuals

3 1 6 8 2 4 3 7 5

Next Generation








No
Termination?
P 3 4 8 1 2 7 6 5
Yes
OR - METAHEURISTICS 14/01/2019
Results
METAHEURISTIC ALGORITHMS 63
Genetic Algorithm (GA): Individuals Evaluation

Solution Representation

► Fitness value of each solution required to survive


Individuals Population

► Tour length TSP (Objective Function Value LP/MIP models)


Individuals Evaluation

Permutations of N Cities Fitness


Individual Selection
1 2 5 4 1 3 7 8 6 120
2 5 7 6 8 2 1 3 4 98
Crossover & Mutation
Individuals

3 1 6 8 2 4 3 7 5 113

Next Generation











No
P 3 4 8 1 2 7 6 5 134 Termination?

Yes
OR - METAHEURISTICS 14/01/2019
Results
METAHEURISTIC ALGORITHMS 64
Genetic Algorithm (GA): Individual Selection

Solution Representation

► A pair of solutions (parents) are selected to be crossed


Individuals Population
► A single solution is selected to be mated
- Random Selection
Individuals Evaluation
- Tournament Selection in form of 1-λ or 2-λ
E.g., (1-2), (1,3), (2,4), (2,6), …
Individual Selection

- Roulette Wheel Selection


Crossover & Mutation
𝑂𝐹𝑉𝑖 𝑃
Minimization: 𝑃𝑖 = 1 −  𝑃ത𝑖 = σ 𝑖
max 𝑂𝐹𝑉𝑗 𝑗 𝑃𝑗
𝑗
Next Generation
𝑂𝐹𝑉𝑖 𝑃𝑖
Maximization: 𝑃𝑖 =  𝑃ത𝑖 = σ
max 𝑂𝐹𝑉𝑗 𝑗 𝑃𝑗
𝑗

No
Termination?

Yes
OR - METAHEURISTICS 14/01/2019
Results
METAHEURISTIC ALGORITHMS 65
Genetic Algorithm (GA): Crossover

Solution Representation

► Crossover (Collective Evolution): Two parents are


Individuals Population
crossed and two children (offspring) are reproduced
- One-point XO (1XO)
Individuals Evaluation
- Two-Point XO (2XO) Exploitation
(Intensification)
- …
Individual Selection
0 1 0 0 1 1 0 1 1XO 0 1 0 0 0 0 1 0

1 1 0 1 0 0 1 0 1 1 0 1 1 1 0 1
Crossover & Mutation
0 1 0 0 1 1 0 1 2XO 0 1 0 1 0 0 0 1

1 1 0 1 0 0 1 0 1 1 0 0 1 1 1 0
Next Generation

► Infeasible solutions No
Termination?
- Remove, Repair, Penalty
Yes
OR - METAHEURISTICS 14/01/2019
Results
METAHEURISTIC ALGORITHMS 66
Genetic Algorithm (GA): Mutation

Solution Representation

► Mutation (Individual Evolution): A part of a single solution


Individuals Population
is mutated (altered)
- Insertion Exploration
Individuals Evaluation
- Reversion
(Diversification)

- Swap
Individual Selection
-1 … Insertion
5 4 2 6 3 7 8 1 5 4 3 2 6 7 8

Swap Crossover & Mutation


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

Reversion Next Generation


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

No
Termination?

Yes
OR - METAHEURISTICS 14/01/2019
Results
METAHEURISTIC ALGORITHMS 67
Genetic Algorithm (GA): Next Generation

Solution Representation

► Size of population must remains constant


Individuals Population

► Strategy 1: Elitism
Individuals Evaluation
- Next Generation = Elites (20%) + XO Inds. (70%) +
Mutated Inds (10%).
Individual Selection
Gent. i Gent. i+1
Elites
Crossover & Mutation

XO Next Generation
P P

M No
Termination?

Yes
OR - METAHEURISTICS 14/01/2019
Results
METAHEURISTIC ALGORITHMS 68
Genetic Algorithm (GA): Next Generation

Solution Representation

► Strategy 2: Merging
Individuals Population
- Merging Pop = Elites U XO Inds. U Mutated Inds.
- Next Generation = First P individuals are transferred
Individuals Evaluation
Gent. i Gent. i+1
Individual Selection
Sort
P & Select P Crossover & Mutation
first P
XO Next Generation

No
Termination?
M
Yes
OR - METAHEURISTICS 14/01/2019
Results
METAHEURISTIC ALGORITHMS 69
Genetic Algorithm (GA): Termination Criteria

Solution Representation

► Strategy 1: Max Iteration


- GA is terminated after a given number of iterations. Individuals Population
Each iteration corresponds to a Generation

Individuals Evaluation
► Strategy 2: Max CPU Time
- GA is terminated after a given amount of time
Individual Selection
► Strategy 3: Max NFC
- GA is terminated after evaluating a max number of
solutions Crossover & Mutation
- Each time we call Fitness Function, a new solution is
evaluated
Next Generation

► Strategy 4: No Improvement
- GA is terminated if no improvement achieved for a No Termination?
specific number of iterations
Yes
OR - METAHEURISTICS 14/01/2019
Results
METAHEURISTIC ALGORITHMS 70
Hybrid Algorithms

► Why Hybrid?
- Better Intensification and Diversification LS
- Lower CPU Time

► Strategy 1: Population of EA is generated by LS algorithm


EA

► Strategy 2: LS serves EA as a searching operator


EA LS

► Strategy 3: LS is employed on the results of EA


EA
OR - METAHEURISTICS
LS
14/01/2019
METAHEURISTIC ALGORITHMS 71
Other EAs

► Ant Colony Optimization (ACO)

OR - METAHEURISTICS 14/01/2019
METAHEURISTIC ALGORITHMS 72
Other EAs

► Particle swarm Optimization (PSO)

OR - METAHEURISTICS 14/01/2019
METAHEURISTIC ALGORITHMS 73
Other EAs

► Imperialist Competitive Algorithm (ICA)

OR - METAHEURISTICS 14/01/2019

You might also like