0% found this document useful (0 votes)
78 views40 pages

Heuristic Optimization Methods: Tabu Search: Slides Prepared by Nina Skorin-Kapov

This document provides an overview of tabu search, a metaheuristic optimization method. Tabu search iteratively searches neighborhoods in the solution space to explore beyond local optimality. It uses short-term memory, in the form of a tabu list, to avoid getting stuck in local optima and cycling between neighboring solutions. The tabu list records recently visited solutions or attributes and forbids them for a certain number of iterations. This allows non-improving moves and helps the search escape local optima. The structure and length of the tabu list are problem-specific design issues that impact the efficiency and restrictiveness of the search.

Uploaded by

Ragnarok
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)
78 views40 pages

Heuristic Optimization Methods: Tabu Search: Slides Prepared by Nina Skorin-Kapov

This document provides an overview of tabu search, a metaheuristic optimization method. Tabu search iteratively searches neighborhoods in the solution space to explore beyond local optimality. It uses short-term memory, in the form of a tabu list, to avoid getting stuck in local optima and cycling between neighboring solutions. The tabu list records recently visited solutions or attributes and forbids them for a certain number of iterations. This allows non-improving moves and helps the search escape local optima. The structure and length of the tabu list are problem-specific design issues that impact the efficiency and restrictiveness of the search.

Uploaded by

Ragnarok
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/ 40

University of Zagreb, Croatia

Lecture 7
Heuristic Optimization Methods:
Tabu Search

Slides prepared by Nina Skorin-Kapov

Academic year 2020/2021


Graduate Studies Programme
Outline

 Tabu Search concept


 TSdimensions
 Memory types

 Main design issues


 Tabu list
 Long-term memory
 Aspiration Criterion

 Pseudocode
 TS design elements

Zavod za telekomunikacije 2
Optimization methods
Exact Approximate
A*
methods methods
Simplex- Constraint
based for LP programming Approximation
algorithms
Heuristic
Branch and Bound, Dynamic
Cut , Price (B&B, programming algorithms
B&C, B&P)

Improvement (meta)heuristics
Constructive heuristics
• Local search
• Greedy algorithms
•Nature inspired
• Tabu search, Genetic
Hybrid methods
algorithms, Simmulated
• GRASP Annealing, Ant colony
•Problem specific
heuristics

Zavod za telekomunikacije 3
Tabu search

 Iterative, single-solution based metaheuristic


 Developed in the 1970’s by Fred Glover
 Became very popular in the 1990’s
 Introduces the idea of memory to the search
 MAIN IDEA: use knowledge of previous experiences to
make better decisions; guides a local search to explore
beyond local optimality
 Iteratively searches neighborhoods in the solution
space as in local search, but an adaptive memory
guides the search

Zavod za telekomunikacije 4
Tabu Search: Escaping local optima

initial solution

Tabu search:
Local Search Allows non
solution: the first improving
local optimum solutions

Zavod za telekomunikacije 5
Tabu List: Avoid cycling

initial solution Tabu list:


previously
visited solutions The search
are tabu moves forward!

After leaving the


local optimum,
the new best
local optimum
? neighboring
Tabu search: solution is the
Allow non local optimum
improving again?
solutions
Zavod za telekomunikacije 6
Tabu search run
 The search moves forward for a desired number of
iterations; best seen (incumbent) solution is always kept

initial solution

Optimal
solution, but the Final solution: Not
search did not best seen necessarily
find it (incumbant) optimal!
Heuristic!
Zavod za telekomunikacije 7
Memory types

Explicit • Records the complete solution


• Mostly used for recording elite
memory solutions

• Records part of the solution, an


attribute, which changes in moving
Attributive from one solution to another
memory • Records the transformation (move)
• Mostly used for guiding the search

Zavod za telekomunikacije 8
Example: explicit memory

max f ( x) = x3 − 60 x 2 + 900 x + 50
x = [0,31], integer
 Representation: x is shown in Explicit
Explicit
binary form with 5 bits memory
memory
s 1 0 0 1 1
ITERATION 1: f(s)
0 0 0 1 1 2237
Memorize full
1 1 0 1 1 293
N(s) previous solution
1 0 1 1 1 1177
1 0 0 0 1 2923 1 0 0 1 1
1 0 0 1 0 2642
Zavod za telekomunikacije 9
Example: attributive memory

max f ( x) = x3 − 60 x 2 + 900 x + 50
x = [0,31], integer
 Representation: x is shown in Attributive
binary form with 5 bits memory
s 1 0 0 1 1
ITERATION 1: f(s)
0 0 0 1 1 2237 Memorize move
1 1 0 1 1 293 from previous to
N(s)
1 0 1 1 1 1177 new solution
1 0 0 0 1 2923
1 0 0 1 0 2642 Flip 4th bit

Zavod za telekomunikacije 10
Tabu List (1/2)

 A memory structure simulating


short term memory
 Records a certain number of
recently (last) visited solutions or
Tabu List
attributes/moves
 These solutions or
atributes/moves are forbidden
(tabu) for as long as they remain
in the list
 E.g. the tabu list is of size 3 updated
cyclically after each iteration →
forbidden for 3 iterations
Zavod za telekomunikacije 11
Tabu List (2/2)

 Used to avoid getting stuck in


local optima and cycling between
neighboring solutions
 Proceeds as local search but Tabu List
accepts non-improving solutions
 When the search gets to a local
optimum, the search proceeds with a
non-improving solution not in the tabu list
 No backtracking
 A certain number of previously visited
solutions (in the tabu list) are tabu
which avoids cycling between
neighboring solutions

Zavod za telekomunikacije 12
Tabu list: structure and length
 The tabu list is a problem-specific design issue
 The structure depends on whether it uses
explicit/attribute memory
 Usually updated cyclically after each iteration
 Tabu tenure: for how many iterations do the
solutions/attributes in the list remain forbidden
(tabu)
 Ifthe structure is such that explicit solutions are stored,
the tenure is the length of tabu list
 Problem-specific; often determined experimentally
(parameter tuning)
 If too big→the search can become too restrictive and inefficient
 If too small→the search may get stuck in a local area
Zavod za telekomunikacije 13
Example
 Objective and fitness function:
3 2
max f ( x) = x − 60 x + 900 x + 50
x = [0,31], integer
 Representation: x in binary form with 5 bits
 Initial solution:

1 0 0 1 1 f(s)=2349

 Neighborhood: “1-flip”
 Termination criterion: 6 iterations
Zavod za telekomunikacije 14
Example

 Use only short -term attributive memory


 Tabu list: records position of last changed bit
 Tabu tenure: 3, i.e. tabu moves are tabu for 3
iterations
 Structure of tabu list: a vector of 5 integers with
values in {0,1,2,3} each corresponding to one bit in
the solution representation and each indicating for
how many more iterations is changing that bit tabu

1st bit 5th bit

Tabu list 0 0 0 0 0 Initially tabu list empty– zero vector

Zavod za telekomunikacije 15
Example

Current
1 0 0 1 1 f(s)=2349
solution s Tabu list

Incumbent 0 0 0 0 0
1 0 0 1 1 f(sbest)=2349
solution sbest

ITERATION 1: Neighborhood “1 flip”


f(s)
0 0 0 1 1 2237 Best neighbor:
1 1 0 1 1 293 f(s’)=2923
N(s) New current
1 0 1 1 1 1177
1 0 0 0 1 2923 solution
1 0 0 1 0 2642
Zavod za telekomunikacije 16
Example
ITERATION 1: f(s)
0 0 0 1 1 2237 Best neighbor: f(s’)=2923
1 1 0 1 1 293
N(s) 1 0 1 1 1 1177
1 0 0 0 1 2923 s 1 0 0 0 1 f(s)=2923
1 0 0 1 0 2642 New current solution
Obtained from old
current solution by Update Tabu list 0 0 0 3 0
changing the 4th bit tabu list
Is s better than sbest, i.e. is
f(s)>f(sbest)? Update
incumbent sbest 1 0 0 0 1
f(s)=2923>f(sbest)=2349
YES! solution f(sbest)=2923

Zavod za telekomunikacije 17
Example
After ITERATION 1:
s 1 0 0 0 1 f(s)=2923

Tabu list 0 0 0 3 0
Generate
neighborhood sbest 1 0 0 0 1 f(sbest)=2923

ITERATION 2: f(s)
0 0 0 0 1 891
1 1 0 0 1 675 Best neighbor not
N(s) tabu: f(s’)=3186
1 0 1 0 1 1751
tabu - New current
1 0 0 0 0 3186 solution

Zavod za telekomunikacije 18
Example
ITERATION 2: f(s)
Best neighbor: f(s’)=2923
0 0 0 0 1 891
1 1 0 0 1 675
N(s)
1 0 1 0 1 1751
s 1 0 0 0 0 f(s)=3186
tabu -
1 0 0 0 0 3186 New current solution
Obtained from old
current solution by Update Tabu list 0 0 0 2 3
changing the 5th bit tabu list

Is s better than sbest, i.e. is


Update
f(s)>f(sbest)? sbest 1 0 0 0 0
f(s)=3186>f(sbest)=2923 incumbent
YES! solution f(sbest)=3186

Zavod za telekomunikacije 19
Example
After ITERATION 2:
s 1 0 0 0 0 f(s)=3186

Tabu list 0 0 0 2 3
Generate
neighborhood sbest 1 0 0 0 0 f(sbest)= 3186

ITERATION 3: f(s)
0 0 0 0 0 50
1 1 0 0 0 914 Best neighbor not
N(s) tabu: f(s’)=2050
1 0 1 0 0 2050
tabu - New current
tabu - solution

Zavod za telekomunikacije 20
Example

ITERATION 3: f(s)
Best neighbor: f(s’)=2050
0 0 0 0 0 50
N(s) 1 1 0 0 0 914
1 0 1 0 0 2050 s 1 0 1 0 0 f(s)=2050
tabu -
tabu - New current solution
Obtained from old
Update Tabu list
current solution by 0 0 3 1 2
tabu list
changing the 3rd bit
Is s better than sbest, i.e. is
f(s)>f(sbest)? Don’t update sbest 1 0 0 0 0
f(s)=2050>f(sbest)=3186 incumbent
NO! solution f(sbest)=3186

Zavod za telekomunikacije 21
Example

After ITERATION 3:
s 1 0 1 0 0 f(s)=2050

Tabu list 0 0 3 1 2
Generate
neighborhood sbest 1 0 0 0 0 f(sbest)=3186

ITERATION 4: f(s)
0 0 1 0 0 2754 Best neighbor not
N(s) 1 1 1 0 0 162 tabu: f(s’)=2754
tabu - New current
tabu - solution
tabu -
Zavod za telekomunikacije 22
Example
ITERATION 4: f(s)
0 0 1 0 0 2754 Best neighbor: f(s’)=2754
N(s) 1 1 1 0 0 162
tabu -
tabu - s 0 0 1 0 0 f(s)=2754
tabu - New current solution
Obtained from old
Update Tabu list
current solution by 3 0 2 0 1
tabu list
changing the 1st bit
Is s better than sbest, i.e. is
f(s)>f(sbest)? Don’t update sbest 1 0 0 0 0
f(s)=2754>f(sbest)=3186 incumbent
NO! solution f(sbest)=3186

Zavod za telekomunikacije 23
Example

After ITERATION 4:
s 0 0 1 0 0 f(s)=2754

Tabu list 3 0 2 0 1
Generate
neighborhood sbest 1 0 0 0 0 f(sbest)=3186

ITERATION 5: f(s)
tabu -
0 1 1 0 0 3938 Best neighbor not
N(s) tabu: f(s’)=3938
tabu -
0 0 1 1 0 3506 New current
tabu - solution

Zavod za telekomunikacije 24
Example
ITERATION 5: f(s)
Best neighbor: f(s’)=3938
tabu -
0 1 1 0 0 3938
N(s)
tabu -
s 0 1 1 0 0 f(s)=3938
0 0 1 1 0 3506
tabu - New current solution
Obtained from old
Update Tabu list
current solution by 2 3 1 0 0
tabu list
changing the 2nd bit
Is s better than sbest, i.e. is
f(s)>f(sbest)? Update sbest 0 1 1 0 0
f(s)=3938>f(sbest)=3186 incumbent
YES! solution f(sbest)=3938

Zavod za telekomunikacije 25
Example

After ITERATION 5:
s 0 1 1 0 0 f(s)=3938

Tabu list 2 3 1 0 0
Generate
neighborhood sbest 0 1 1 0 0 f(sbest)=3938

ITERATION 6: f(s)
tabu -
tabu - Best neighbor not
N(s) tabu: f(s’)=3807
tabu -
0 1 1 1 0 3634 New current
0 1 1 0 1 3807 solution

Zavod za telekomunikacije 26
Example
ITERATION 6: f(s)
Best neighbor: f(s’)=3807
tabu -
tabu -
N(s)
tabu -
s 0 1 1 0 1 f(s)=3807
0 1 1 1 0 3634
0 1 1 0 1 3807 New current solution
Obtained from old
Update Tabu list
current solution by 1 2 0 0 3
tabu list
changing the 5th bit
Is s better than sbest, i.e. is
f(s)>f(sbest)? Don’t update sbest 0 1 1 0 0
f(s)=3807>f(sbest)=3938 incumbent
NO! solution f(sbest)=3938

Zavod za telekomunikacije 27
Example
After ITERATION 6:
s 0 1 1 0 1 f(s)=3807

Tabu list 1 2 0 0 3

sbest 0 1 1 0 0 f(sbest)=3938

Stopping criterion: 6 iterations → STOP! Note: the TS


solution is not
sbest is the best found solution globally optimal
x=01010
sbest 0 1 1 0 0 f(sbest)=3938 f(x)=4050

Zavod za telekomunikacije 28
Alternative Tabu list structure

 Alternative structure of the same Tabu list


A FIFO buffer of size 3
 Elements in buffer are tabu moves

Tabu list
ITERATION 0 (initally): - - -
After ITERATION 1: 4 - -
After ITERATION 2: 5 4 -
After ITERATION 3: 3 5 4
After ITERATION 4: 1 3 5
After ITERATION 5: 2 1 3
After ITERATION 6: 5 2 1
Zavod za telekomunikacije 29
Tabu Search dimensions
Memory structures used in TS are designed to aid 4 different
dimensions of the search

Recency Frequency

Quality Influence

Zavod za telekomunikacije 30
TS dimensions
 Recency
 Short-term memory
 Keeps track of solutions or
attributes/moves which have recently Recency
been visited and prohibits revisiting
them
 Most commonly used memory type
 Tabu list
 If attributes or moves are memorized:
 Selected attributes/changes occurring in
recently visited solutions become tabu,
i.e., all solutions (both already-visited and
not-yet-visited) which have those
attributes are prohibited while in the tabu
list
Zavod za telekomunikacije 31
TS dimensions

 Frequency
 Long-term memory
 Records how many times we
have returned to the same Frequency
solution or attribute
 Residence measures: the number of
times an attribute/solution is
observed
 Transition measures: the number of
times an attribute/solution changes
from one value to another
 Complements recency-based
memory

Zavod za telekomunikacije 32
TS dimensions

 Quality
 During the search, it records the
quality of solutions with certain
attributes Quality
 Can be used to identify
attributes/elements that are
common to all (most) ‘good’
solutions → intensification
 Can enable incentive-based
learning: reinforce moves which
lead to good solutions and penalize
those which lead to bad ones
 (often used in aspiration criterion)

Zavod za telekomunikacije 33
TS dimensions

 Influence
 Records the impact (influence)
choices made during the search
Influence
have on the quality and structure
of the solutions
 Some moves can drastically change
the solutions
 Record how far we have moved
from the previous solution
(distance between solutions)
 (often used in aspiration criterion)

Zavod za telekomunikacije 34
Main TS-specific design issues

• A short-term memory structure (recency dimension) used to


prevent the search from revisiting recently visited
Tabu list solutions/attributes
• Of finite size, updated after each iteration; memorizing all
previous solutions may confine search and affect efficiency

Basic TS
technique
Long-term • Relates mostly to the frequency dimension
• Used for 2 main different purposes: DIVERSIFICATION
memory and INTENSIFICATION

Advanced TS
techniques
Aspiration • Utilizes the quality and influence dimensions to guide the
search to good solutions
• Can override the tabu list in case of exceptional solutions
criterion (better than incumbent)

Zavod za telekomunikacije 35
Long-term memory

 Relates mostly to the second TS


dimension: Frequency
 Records the number of times an
Long-term
attribute/solution is observed or memory
changes from one value to another
 Used for 2 main different
purposes:
 DIVERSIFICATION
 Long-term memory
 INTENSIFICATION
 Medium/long-term memory

Zavod za telekomunikacije 36
Long-term memory purposes

• Guides the search to explore unvisited areas


• If some solutions or neighborhoods are often
searched, i.e. some solutions/attributes have very
Diversification high frequency, continue the search in new area
(to solutions which drastically differ from those
Long-term

often visited)
memory

• If good solutions/attributes (quality, influence)


are often visited (frequency), then intensify the
Intensification search in that area od the solution space
• Give priority to elite solutions or make the
search biased by attributes of elite solutions

Zavod za telekomunikacije 37
Aspiration criterion

 Relates mostly to TS
dimensions: quality and
influence Aspiration
 Allows overriding the tabu list Criterion
by choosing a tabu move if it
is better than the incumbent
solution
 Can also allow a tabu move
which generated a better
solution in a set of solutions
with a given attribute

Zavod za telekomunikacije 38
Pseudocode - minimization
Start Tabu Search
Generate initial solution s ;
0
s  s ; s best  s ;
0 0
TL = {}; // tabu list initially empty
Initialize aspiration criterion (AC)
Initialize other memory structures (e.g. long - term) if any;
do
Generate N(s, TL , AC); // neighborho od subject to tabu list and aspiration criterion
Find s ' N ( s, TL , AC ) where f ( s ' )  f ( s ' ' ) , s' ' N(s, TS, AC)
Update s  s '
Update tabu list, s best , aspiration criterion, other memory structures;
If intesifica tion or diversific ation criterion then intesify or diversify search;
while stopping criterion not met
return s best ;
End

Zavod za telekomunikacije 39
Design components

 Solution representation (e.g. binary vector)


 Initial solution (e.g. random, greedy)
 Objective function
 Fitness function
 Neighborhood definition (‘move’ operator)
 Tabu list structure
 Termination criterion
 Additional components (optional):
 Long/medium-term memory
 Diversification and intesification criteria
 Aspiration criterion
Zavod za telekomunikacije 40

You might also like