Overview

6 Tabu Search

Building on local search, this chapter introduces tabu search (TS) as a trajectory-based metaheuristic that augments simple neighborhood improvement with adaptive memory and responsive exploration. Unlike greedy local search that risks getting trapped in local optima, TS allows non-improving moves while preventing cycling by marking recently used solution attributes or moves as tabu. At each iteration it evaluates a candidate neighborhood, selects the best admissible move (respecting tabu restrictions unless an aspiration rule permits an override), updates memories, and continues until stopping criteria such as no improvement, exhausted neighborhoods, or external convergence evidence are met. The approach has been applied widely across scheduling, routing, design, allocation, and other combinatorial and continuous optimization tasks.

The core components of TS are its memory structures and admissibility rules. Short-term (recency-based) memory records recently used moves to discourage immediate reversal and promote escape from local optima, while long-term (frequency-based) memory guides diversification by penalizing overused components to steer the search toward unexplored regions. Aspiration criteria mitigate stagnation by allowing tabu moves that yield solutions better than the incumbent. Performance hinges on design and tuning: neighborhood operators, tabu tenure (fixed, dynamic, or reactive to detected cycles), aspiration limits, and stopping rules. Adaptive and self-adaptive schemes can vary tenure within bounds, intensifying in promising regions and diversifying when progress stalls; these mechanisms enable TS to operate effectively on both discrete and continuous landscapes.

Through case studies, the chapter demonstrates TS in action: solving constraint satisfaction via n-queens by minimizing collisions with swap neighborhoods and tabu lists; handling continuous function optimization (e.g., Himmelblau) with a generic TS solver; and addressing routing with both a custom TS and an implementation in OR-Tools on the Berlin52 instance, as well as a real-world delivery tour. It also tackles assembly line balancing (SALBP and space-aware TSALBP), honoring precedence and cycle-time constraints while minimizing imbalance using a Smoothing Index, with neighborhoods defined by feasible swaps and benchmark evaluations. Across these examples, TS consistently balances intensification and diversification, often producing high-quality near-optimal solutions when its memory structures, neighborhoods, and parameters are thoughtfully tuned.

Tabu Search Steps [1]
A 4-City TSP
In knapsack problems, each item has a utility and a weight, and we want to maximize the utility of the contents of the knapsack without exceeding the maximum weight. The problem is constrained by the capacity of the bag. Two tabu lengths are used for adding and removing items.
TS short-term memory and long-term memory and the search dilemma
Tabu structure for the 4-City TSP. The numbers in recency-based memory represent the number of iterations remaining for tabu-active moves and the number in the long-term memory represent the frequency count of using the move.
Effect of Tabu Length
Dynamically controlling the tabu tenure
A 7-Queens Problem - TS Initialization. C represents the column where a queen Q is place. Dotted lines shows the 4 collisions between the queens. * denotes the selected swap that gives best neighboring solution.
A 7-Queens Problem - TS Iteration-1
A 7-Queens Problem - TS Iteration-2
A 7-Queens Problem - TS Iteration-3
A 7-Queens Problem - TS Iteration-4
A 7-Queens Problem - TS Iteration-5
A 7-Queens Problem - TS Iteration-6
A 7-Queens solution generated by hand-iterations
A 7-Queens solution generated by Python code
Himmelblau's function. This function has four identical local minima at (3.0, 2.0), (−2.805118, 3.131312), (−3.779310, −3.283186) and (3.584428, −1.848126). It also has one local maximum at (-0.270845,-0.923039).
TSP solution using Tabu Search in OR-Tools. The axes represent the x, y coordinates of the points of interest included in the dataset.
TS solution for Walmart delivery semi-truck route with total distance= 223.53 km
Assembly Line Balancing Problem.
Precedence diagram.
Equation 6.1
Precedence diagram example for 6 tasks
TS Initialization for ALBP
TS Iteration-1 for ALBP
TS Iteration-2 for ALBP
SALBP initial and final solutions

Summary

  • Local search iteratively explores a subset of search space in the neighborhood of the current solution/state in order to improve this solution by local changes.
  • Tabu search extends local search by combining it with memory structures. It guides a local search procedure to explore the solution space beyond local optimality.
  • Memory-based strategies are the hallmark of tabu search approach.
  • Tabu search accepts non-improving solutions in order to escape from local optima (where all the neighboring solutions are non-improving).
  • Tabu search uses past experiences to improve current decision making by using memory (a “tabu list”) to prohibit certain moves – “makes tabu search attempt to be a global optimizer rather than a local optimizer.”
  • Tabu tenure is a certain amount of time or a certain number of iterations during which previously visited nodes are forbidden.
  • As a way to avoid search stagnation, aspiration criteria allow tabu-active moves to be accepted by relaxing or temporarily lifting the tabu condition.
  • A key element of the adaptive tabu search is to create a balance between search intensification and diversification.

FAQ

What is Tabu Search and how does it extend basic local search?Tabu Search (TS) is a trajectory-based metaheuristic that augments local search with memory. It avoids getting stuck in local optima by (1) allowing select non-improving moves to escape traps, and (2) using memory structures to prevent immediate revisits to recent solutions or moves (cycling). This balance of intensification (focus near good regions) and diversification (push to unexplored areas) makes TS effective across many combinatorial and continuous problems.
How does a Tabu Search iteration choose the next solution?At each step TS: - Builds a candidate list from the neighborhood N(s) using problem-specific move operators (e.g., swap, insert, 2-opt). - Filters out tabu-active moves, unless aspiration permits them. - Evaluates candidates and selects the best admissible neighbor as the new current solution. - Updates best-so-far, tabu restrictions, and (optionally) long-term memory. This is often summarized as selecting s' from N(s) minus tabu constraints plus aspiration allowances.
What is the tabu list (recency-based memory) and how do I set its tenure?The tabu list records recently used moves or attributes and temporarily forbids reusing them to prevent cycling. Tabu tenure (how many iterations a move stays tabu) can be: - Static: a fixed value (a simple heuristic is near sqrt of neighborhood size). Too short risks cycles; too long can block progress. - Dynamic: vary within [Lmin, Lmax] based on progress (shorten when improving to intensify, lengthen when stagnating to diversify). Good tenure control is crucial to performance.
What is frequency-based (long-term) memory and when should I use it?Frequency-based memory tracks how often moves/components appear. Heuristics penalize overused elements in the evaluation (e.g., add a frequency-proportional penalty), pushing the search toward less-visited regions (diversification). Use it when the search oscillates around a few regions or revisits similar structures frequently.
What is an aspiration criterion and why is it needed?Sometimes tabu rules block promising moves (stagnation). Aspiration allows overriding tabu if certain conditions hold, typically: - The move yields a solution better than the incumbent best. - The tabu status is near expiration or other problem-specific triggers. This keeps TS from missing breakthroughs while still preventing short cycles.
How does adaptive or reactive Tabu Search tune itself during the run?Adaptive TS adjusts parameters on the fly: - Dynamically scales tabu tenure: decrease after improvements (intensify), increase after deteriorations or repeated patterns (diversify). Reactive TS adds automatic responses to cycling/repetition: - Immediate reactions: geometrically increase tenure when a repetition is detected. - Diversifying jumps: if repeated moves exceed a threshold, force an escape move. Other components (e.g., aspiration, frequency penalties) can be adapted similarly.
How can I apply Tabu Search to constraint satisfaction problems like n-queens?Key design choices: - Representation: a permutation or array indicating each queen’s column (or row). - Objective: minimize the number of conflicts (attacks). - Neighborhood: move a queen to a different column, or swap two queens. - Tabu attributes: recently moved queens or specific position assignments. - Aspiration: accept a tabu move if it reduces the global best conflict count. Stop when conflicts reach zero or a limit is hit. This turns a CSP into an iterative improvement process guided by TS memory.
How do I use Tabu Search for continuous optimization?For continuous spaces: - Representation: real-valued vector. - Neighborhood: random perturbations (Gaussian, uniform in a radius) or coordinate-wise tweaks. - Tabu memory: record recent solution vectors (via hashes/quantization) or attributes (e.g., recent directions/indices). - Candidate size: generate multiple perturbations per iteration and pick the best admissible. - Tuning: step sizes, neighbor count, and tenure strongly affect performance. TS can locate good minima on multimodal functions (e.g., Himmelblau) with careful parameterization.
How is Tabu Search used for TSP and routing problems?Core elements: - Representation: permutation of cities (or routes). - Moves: 2-opt, 3-opt, swap, relocate (insert), or exchange. - Tabu attributes: recently removed/added edges or swapped city pairs. - Aspiration: allow tabu if it improves the global best tour length. Tooling: In OR-Tools, you can pick TABU_SEARCH or GENERIC_TABU_SEARCH; the former manages tabu per variable/assignment, the latter tracks moves globally. TS often gets near-optimal tours quickly, with quality hinging on move set, tenure, and candidate evaluation speed.
How can Tabu Search solve Assembly Line Balancing Problems (ALBP)?Design highlights: - Representation: a feasible task sequence (permutation) respecting precedence. - Objective: minimize stations or balance workload (e.g., Smoothing Index) under cycle time and space constraints. - Feasibility: only generate neighbors (e.g., swaps/inserts) that maintain precedence; otherwise repair. - Tabu attributes: recent task swaps or station assignments. - Evaluation: compute station loads under the cycle time; penalize violations; use SI to measure balance. TS effectively searches over task orders, balancing intensification around good layouts with diversification to escape unproductive sequences.

pro $24.99 per month

  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose one free eBook per month to keep
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime

lite $19.99 per month

  • access to all Manning books, including MEAPs!

team

5, 10 or 20 seats+ for your team - learn more


choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Optimization Algorithms ebook for free
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Optimization Algorithms ebook for free
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Optimization Algorithms ebook for free