Variable Neighborhood Search (VNS)

Decision Sciences
Year
1997
Type
Metaheuristic — neighborhood-based

What does it do?

Variable Neighborhood Search (VNS) is a metaheuristic introduced by Mladenović and Hansen in 1997.

It escapes local optima by switching among a predefined, ordered set of neighborhood structures: it perturbs the current best solution (shaking), applies a local search from the perturbed point, and, in the basic scheme, accepts the result only if it improves the incumbent. The framework applies to both combinatorial and continuous optimization problems. As a heuristic, it does not guarantee a globally optimal solution.

The intuition behind the method

Imagine searching for the highest peak in a mountain range while blindfolded. A purely local strategy climbs until it reaches the top of whichever hill it started on, then stops, even if a taller mountain lies just beyond the ridge. VNS works around this by deliberately jumping to a different part of the landscape (shaking) when it gets stuck, then climbing again from there. The jumps are not random forever: they come from a structured family of increasing size, and the search returns to its best known position whenever a jump does not help. This alternation between perturbation and local refinement lets the search examine several regions of the solution space, rather than only the one where it started.

History

Variable Neighborhood Search was proposed by Nenad Mladenović and Pierre Hansen in their 1997 paper in Computers & Operations Research. Its central observation is that a local minimum with respect to one neighborhood structure need not be a local minimum with respect to another, so changing neighborhoods offers a systematic way to escape local optima without relying on purely random restarts. Hansen and colleagues later described the basic framework and its variants, including Variable Neighborhood Descent, General VNS and Basic VNS, in an overview of the basics and variants of the method.

When to use it

Choose VNS when a problem admits at least two distinct, meaningful neighborhood structures, for example different swap, insert or relocate moves in a routing problem, or different exchange operators in a scheduling problem, and when a local search can be run within each neighborhood. It applies to combinatorial and continuous variables, makes no normality assumption, and has no minimum dataset size, because it operates on candidate solutions rather than statistical samples. It is a reasonable choice when a single local search repeatedly stalls in poor local optima. Avoid it when only one natural neighborhood exists, since the method then reduces to an iterated local search, or when each evaluation is so costly that the number of shaking-and-search cycles cannot be afforded.

Limitations and considerations

  • Performance depends critically on the quality of the neighborhood structures chosen; poorly designed neighborhoods lead to slow or ineffective search.
  • The number and ordering of neighborhoods (k_max) must be set by the practitioner. There is no universal rule, and a poor choice increases runtime without improving solution quality.
  • Unlike population-based metaheuristics (genetic algorithms, particle swarm), VNS maintains only one incumbent solution, which may limit diversity in highly multi-modal landscapes.
  • Computational cost scales with the cost of the inner local search; expensive evaluation functions can make each VNS iteration slow.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Uses a sequence of neighborhood structures to move between regions of the search space, which can reduce the chance of stalling in one local optimum. It gives no guarantee of finding the global optimum.
  • The VND local search is deterministic for a given starting solution; full VNS with random shaking requires a fixed random seed for reproducible runs.
  • Applicable to both combinatorial (routing, scheduling, graph problems) and continuous optimization without modification to the core framework.
  • No normality assumption and no minimum sample size: the method operates on solutions, not on statistical data.
  • Modular design: the neighborhood structures and the inner local search can be swapped independently, which makes the algorithm straightforward to adapt to new problem types.

Applications

  • Vehicle routing and transportation logistics, such as optimizing delivery routes subject to capacity and time-window constraints.
  • Job-shop and open-shop scheduling, such as minimizing makespan or tardiness when jobs compete for shared machines.
  • Facility location, such as selecting depot or service center locations to minimize total cost or travel distance.
  • Graph problems, such as graph coloring, maximum clique, and minimum dominating set.
  • Telecommunications network design, such as optimizing topology, routing, or frequency assignment under capacity constraints.
  • Machine learning and classification: VNS has been used to learn parameters of multiple-criteria classification models (e.g., PROAFTN) from training data.

How it works

How it works

1

An initial feasible solution is constructed, typically by a greedy heuristic or random assignment, and designated as the incumbent best solution. The ordered set of neighborhood structures N₁, N₂, …, N_kmax is defined before the search begins. The counter k is set to 1, pointing at the smallest (least disruptive) neighborhood. A stopping criterion (for example an iteration limit, a time limit, or a maximum number of iterations without improvement) is also fixed in advance.

2

A candidate solution x′ is drawn at random from the k-th neighborhood N_k of the current best solution x. The perturbation is intended to be large enough to move the search away from the current local optimum, but structured enough to stay within a related region of the search space. The neighborhood index k controls how far the algorithm moves: a small k gives a mild perturbation, and a large k a more radical one.

3

Starting from x′, a local search procedure is applied until a local optimum x″ is reached. This procedure can itself be a Variable Neighborhood Descent (VND) that uses its own inner set of neighborhoods. The local search exploits the structure of the problem to refine the perturbed solution into the best nearby solution it can find.

4

If x″ is better than the current incumbent x, the algorithm moves to x″ and resets k to 1, restarting the search from the smallest neighborhood. If x″ is not better, k is incremented by 1 so that a larger perturbation is tried next. When k exceeds k_max, the search restarts from k = 1 or terminates, depending on the stopping criterion. In Basic VNS this acceptance rule is strictly improvement-based, unlike simulated annealing; variants such as Skewed VNS relax it to accept some worse solutions under a distance-based criterion.

Common pitfalls

  • Defining only one neighborhood structure reduces VNS to a simple iterated local search and loses the method's key advantage. Always define at least two distinct neighborhoods.
  • Setting k_max too small means the algorithm never escapes difficult local optima; setting it too large wastes computation on very disruptive moves that rarely help.
  • Skipping the local search step (applying shaking alone) removes the exploitation phase and turns the algorithm into a random restart, which is far less effective.
  • Applying VNS where each neighborhood evaluation is very expensive, without first considering cheaper approximations of the objective or decomposing the problem, can lead to long runtimes.

Frequently asked questions

How is VNS different from simulated annealing or tabu search?

All three are single-solution metaheuristics that escape local optima, but they use different mechanisms. Simulated annealing accepts worse solutions with a probability that decreases over time; tabu search forbids recently visited moves using a memory list. Basic VNS accepts only improving solutions and relies on a structured family of neighborhoods of increasing size to explore different regions of the search space. Some variants, such as Skewed VNS, relax this rule and may accept worse solutions under a distance-based criterion.

What is Variable Neighborhood Descent (VND) and how does it relate to VNS?

VND is the deterministic inner-search component of VNS. It cycles through a set of neighborhood structures sequentially: if a move in neighborhood N_k improves the solution, it restarts from N_1; otherwise it moves to N_{k+1}. VND on its own is a local search procedure. When VND is used as the local search inside the shaking–local-search–accept loop, the combined algorithm is called General VNS (GVNS). VND can also be run standalone when a purely deterministic descent is acceptable.

How many neighborhood structures do I need?

At least two distinct neighborhood structures are needed for VNS to differ from a simple iterated local search. Well-chosen neighborhoods matter more than their number. Order them from smallest (least disruptive) to largest, and make sure each can be explored efficiently by the inner local search.

Can VNS handle continuous (real-valued) optimization problems?

Yes. For continuous problems, neighborhoods are typically defined by a perturbation radius or step size rather than by discrete move operators. The core loop of shaking, local search, and accepting improvements operates in the same way.

How should I interpret and report VNS results?

VNS is a heuristic, so the solution found is a best-known solution, not a proven optimum. Because shaking is random, results depend on the random seed and on the run budget. Set an explicit stopping rule (iteration limit, time limit, or number of iterations without improvement), run the method several times with different seeds, and report the best value together with the spread across runs.

Related methods

Sources

  1. Mladenović, N. & Hansen, P. (1997). Variable Neighborhood Search. Computers & Operations Research, 24(11), 1097–1100.

    Open DOI reference
  2. Hansen, P., Mladenović, N., Brimberg, J. & Pérez, J.A.M. (2019). Variable Neighborhood Search: Basics and Variants. EURO Journal on Computational Optimization, 7(1), 3–56.

    Open DOI reference