Table of Contents
Fetching ...

Algorithmic strategies for finding the best TSP 2-OPT move in average sub-quadratic time

Giuseppe Lancia, Paolo Vidoni

TL;DR

This paper tackles the problem of efficiently finding the best $2$-$OPT$ move in the traveling salesman problem. It introduces two practical enumeration strategies—the greedy and the blind algorithms—that leverage a champion-based approach and, in the greedy case, a max-heap to focus on promising pivots, achieving sub-quadratic average-case time. A complementary family of fixed-threshold heuristics ALG$(\delta_n)$ is analyzed and shown to yield $\bar{T}(n)=\Theta(n^{3/2})$ on uniform random costs and $\Theta(n)$ on Euclidean random instances, with high probability of finding the optimal move on good instances. Experimental results confirm substantial speedups over the naive $O(n^2)$ enumeration, especially in early local-search iterations, and motivate a hybrid strategy that starts with the fast heuristics and switches to complete enumeration near convergence. The work offers practical guidance for integrating sub-quadratic move-finding into local-search TSP solvers and highlights the trade-off between speed and robustness as the tour becomes less random."

Abstract

We describe an exact algorithm for finding the best 2-OPT move which, experimentally, was observed to be much faster than the standard quadratic approach. To analyze its average-case complexity, we introduce a family of heuristic procedures and discuss their complexity when applied to a random tour in graphs whose edge costs are either uniform random numbers in [0, 1] or Euclidean distances between random points in the plane. We prove that, for any probability p: (i) there is a heuristic in the family which can find the best move with probability at least p in average-time O(n^3/2) for uniform instances and O(n) for Euclidean instances; (ii) the exact algorithm take lesser time then the above heuristic on all instances on which the heuristic finds the best move. During local search, while the tour becomes less and less random, the speed of our algorithm worsens until it becomes quadratic. We then discuss how to fine tune a successful hybrid approach, made of our algorithm in the beginning followed by the usual quadratic enumeration.

Algorithmic strategies for finding the best TSP 2-OPT move in average sub-quadratic time

TL;DR

This paper tackles the problem of efficiently finding the best - move in the traveling salesman problem. It introduces two practical enumeration strategies—the greedy and the blind algorithms—that leverage a champion-based approach and, in the greedy case, a max-heap to focus on promising pivots, achieving sub-quadratic average-case time. A complementary family of fixed-threshold heuristics ALG is analyzed and shown to yield on uniform random costs and on Euclidean random instances, with high probability of finding the optimal move on good instances. Experimental results confirm substantial speedups over the naive enumeration, especially in early local-search iterations, and motivate a hybrid strategy that starts with the fast heuristics and switches to complete enumeration near convergence. The work offers practical guidance for integrating sub-quadratic move-finding into local-search TSP solvers and highlights the trade-off between speed and robustness as the tour becomes less random."

Abstract

We describe an exact algorithm for finding the best 2-OPT move which, experimentally, was observed to be much faster than the standard quadratic approach. To analyze its average-case complexity, we introduce a family of heuristic procedures and discuss their complexity when applied to a random tour in graphs whose edge costs are either uniform random numbers in [0, 1] or Euclidean distances between random points in the plane. We prove that, for any probability p: (i) there is a heuristic in the family which can find the best move with probability at least p in average-time O(n^3/2) for uniform instances and O(n) for Euclidean instances; (ii) the exact algorithm take lesser time then the above heuristic on all instances on which the heuristic finds the best move. During local search, while the tour becomes less and less random, the speed of our algorithm worsens until it becomes quadratic. We then discuss how to fine tune a successful hybrid approach, made of our algorithm in the beginning followed by the usual quadratic enumeration.
Paper Structure (22 sections, 17 theorems, 45 equations, 6 figures, 7 tables, 2 algorithms)

This paper contains 22 sections, 17 theorems, 45 equations, 6 figures, 7 tables, 2 algorithms.

Key Result

Lemma 1

For every instance $I$ for which $\delta_n < \Delta^*(I)/2$, ALG($\delta_n$) finds an optimal solution.

Figures (6)

  • Figure 1: Explaining D-edges and D-crosses
  • Figure 2: Plots of possible fittings of the average time complexity for finding the best move on a random tour (uniform instances). ALG($\delta_n$), fit $\alpha n^{\frac{3}{2}}= 1.89\, n^{\frac{3}{2}}$. ${\cal A}_b$, fit is $1.46\, n^{\frac{3}{2}}$. ${\cal A}_g$,fit is $1.20\, n^{\frac{3}{2}}$. Each dot corresponds to the average over 1000 trials of size $n$.
  • Figure 3: Plots of possible fittings of the average time complexity for finding the best move on a random tour (Euclidean instances). ALG($\delta_n$): fit is $28.2\, n$. ${\cal A}_b$: fit is $19.3\, n$. ${\cal A}_g$: fit is $7.7\, n$. Each dot corresponds to the average over 1000 trials of size $n$.
  • Figure 4: Number of moves evaluated by CE and the greedy algorithm in the convergence to a local optimum on a random graph of $n=1000$ nodes. $x$-axis is iteration number, $y$-axis is number of moves evaluated to find the best. (Left:) Uniform instance. (Right:) Euclidean instance.
  • Figure 5: Time (ms) taken by CE and the greedy algorithm on a convergence to a local optimum on a random graph of $n=1000$ nodes. Switch made when greedy evaluates as many moves as CE. Left: Uniform instance. Right: Euclidean instance.
  • ...and 1 more figures

Theorems & Definitions (17)

  • Lemma 1
  • Corollary 1
  • Lemma 2
  • Lemma 3
  • Corollary 2
  • Theorem 1
  • Corollary 3
  • Theorem 2
  • Lemma 4
  • Corollary 4
  • ...and 7 more