Algorithm · Optimization · Springer 2020

Mutation Triggering Method for
Genetic Algorithm on TSP

A published Springer research paper introducing a Mutation Triggering Method (MTM) that combines three mutation operators — Swap, Insertion, and 2-opt — and selects between them based on generation progression. Random mutations provide speed and diversity in early generations; knowledge-based 2-opt is triggered in the final phase for high-quality convergence. Tested on nine TSPLIB benchmark instances.

Genetic Algorithm Traveling Salesman Problem 2-opt Mutation Swap & Insertion Mutation TSPLIB Python Springer · Industry 4.0
Language
Python
Dataset
TSPLIB — 9 instances
Mutation Operators
Swap · Insertion · 2-opt
Published
Springer · Embracing Industry 4.0 · pp. 159–170
Institution
Daffodil International University, Bangladesh
01About

The Traveling Salesman Problem (TSP) is one of the most studied NP-hard combinatorial optimization problems: given a set of cities, find the shortest possible tour that visits each city exactly once and returns to the origin. With n cities the search space has (n−1)! possibilities — brute force is infeasible even for modest sizes.

Genetic Algorithms (GA) are a natural metaheuristic fit for TSP, but mutation operators present a critical design challenge. A high mutation probability causes divergence and large computation time; a low mutation probability causes premature convergence to local optima. Prior work applied each operator in isolation or at fixed probabilities, leaving untapped the complementary strengths of different mutation types.

This paper proposes the Mutation Triggering Method (MTM): a strategy that combines Swap, Insertion, and 2-opt mutations and selects between them based on the progression of the generation. The core idea is that different phases of the search benefit from different mutation types. Early generations need the speed and diversity of random mutations; late generations need the optimality of knowledge-based heuristic mutation.

MTM is benchmarked against Traditional GA (T-GA) with each operator in isolation and against RCDM-GA (random crossover, dynamic mutation) across nine TSPLIB instances. MTM found the best travel cost on 6 out of 9 instances, while completing in a fraction of T-GA (2-opt)'s computation time.

02Algorithm
Algorithm Flowchart
The proposed algorithm follows the standard GA structure except for the mutation phase, which is replaced by the MTM block (dotted region). MTM computes an adaptive probability Pm, evaluates the selector equation, then routes to 2-opt, Swap, or Insertion accordingly.
MTM-GA algorithm flowchart — dotted region shows MTM contribution
Fig. 1 — MTM-GA Flowchart · Dotted region = area of contribution Crossover: Order Crossover (OX) · Selection: Tournament Selection
03Mutation Operators

The key insight driving MTM is that mutation operators have a speed-quality tradeoff. Random-based mutations (Swap and Insertion) are fast but produce low-quality solutions. Knowledge-based mutation (2-opt) is computationally expensive but reliably removes crossing paths and drives toward optimality. MTM captures the benefit of all three by scheduling them across the generation timeline.

Phase 1 — First 80%
Swap Mutation
coin toss → 50% prob

Two randomly selected genes (cities) in the chromosome are swapped. Applied during the first 80% of maximum generations via a 50/50 coin toss against Insertion mutation. Fast and lightweight — provides rapid exploration of the search space and diverse initial feasible solutions.

Random-based · Fast · Early Phase
Phase 1 — First 80%
Insertion Mutation
coin toss → 50% prob

A randomly selected gene is removed from its position and re-inserted at a different random position in the chromosome. Applied alongside Swap mutation in the first 80% of generations. Also random and fast — together with Swap it ensures the population doesn't converge before 2-opt is applied.

Random-based · Fast · Early Phase
Phase 2 — Last 20%
2-opt Mutation
selector = maxGen − (factor × maxGen)

Two edges in the tour are removed and reconnected to eliminate crossing paths. Triggered when the current generation exceeds the selector threshold (e.g., the last 20% of generations). Computationally expensive but highly effective at removing sub-optimal tour segments — applied only when the population has already reached near-feasible solutions worth refining.

★ Knowledge-based · Heuristic · Late Phase
04MTM Algorithm

Algorithm 1 shows the complete MTM logic. The mutation probability Pm decreases with generation progression via a square-root decay function, ensuring the algorithm converges rather than diverges. The selector equation determines the generation threshold at which 2-opt takes over from Swap/Insertion. A fair coin toss between Swap and Insertion ensures equal diversity pressure from both random operators during Phase 1.

Algorithm 1 — MTM
1: k ← range [0, 1] 2: factor ← range [0, 1] 3: find current_gen, max_gen 4: Pm ← k / √(current_gen) 5: r1 ← random(0,1) 6: r2 ← random(0,1) 7: if r1 < Pm then 8: selector ← max_gen − (factor × max_gen) 9: if current_gen > selector then 10: Apply 2-opt mutation ← last 20% 11: else if r2 < 0.5 then 12: Apply Swap mutation ← first 80% 13: else 14: Apply Insertion mutation ← first 80% 15: end if 16: end if
Parameter Definitions
k — Constant Factor
Chosen from range [0, 1]. Scales the mutation probability to keep Pm within a probabilistic range across all generations.
Pm — Adaptive Mutation Probability
Decreases as generation number increases. Ensures convergence: high early diversity, lower later mutation pressure.
Pm = k / √(current generation)
factor — Phase Boundary
Controls when 2-opt takes over. A factor of 0.2 means 2-opt fires in the last 20% of generations; Swap and Insertion fill the first 80%.
selector = max_gen − (factor × max_gen)
r1, r2 — Random Numbers
r1 controls whether any mutation fires (vs. Pm threshold). r2 is the fair coin toss that splits Phase 1 evenly between Swap and Insertion.
05Key Results
Overall Performance Verdict
Travel Cost (Solution Quality)
MTM-GA wins 6 of 9 instances

MTM-GA found the best travel cost on eil51, bier127, kroa100, kroa200, pr226, and st70. T-GA (2-opt) edged it on a280, lin318, and rat195 — but at dramatically higher computation cost. T-GA (Swap), T-GA (Insertion), RCDM-GA (Swap), and RCDM-GA (Insertion) all converged to local optima on most instances.

Computation Time
MTM-GA: fast vs. 2-opt, optimal vs. random

T-GA (2-opt) is the most accurate baseline but is prohibitively slow — e.g., 2,453s for lin318 vs MTM-GA's 663s. MTM-GA is slower than pure Swap/Insertion approaches but achieves far superior solution quality, making it the best overall tradeoff between time and travel cost.

Table 1 — Optimal Travel Cost by Algorithm · All 9 TSPLIB Instances
Instance Known Optimal T-GA Swap T-GA Insert T-GA 2-opt RCDM Swap RCDM Insert MTM-GA
eil51 426 754871433551621 432 ★
a280 2,579 20,75321,4762,727 ★151,51827,779 2,756
bier127 118,282 365,293374,119123,294469,925411,091 119,416 ★
kroa100 21,282 82,63179,08521,846149,17069,010 21,666 ★
kroa200 29,368 199,256190,54930,971234,087242,155 30,697 ★
lin318 42,029 384,807388,31143,702 ★1,479,572698,061 44,563
pr226 80,369 1,025,700976,00481,1321,228,1031,089,287 80,728 ★
st70 675 1,8861,6806811,13331,093 678 ★
rat195 2,323 13,06113,3212,419 ★19,66587,280 2,450
Table 2 — Computation Time (seconds) · All 9 TSPLIB Instances
Instance T-GA Swap T-GA Insert T-GA 2-opt RCDM Swap RCDM Insert MTM-GA
eil512.302.4813.234.095.945.30
a28040.1142.061,313.9549.0964.69354.79
bier12710.6710.63157.7713.6819.6550.54
kroa1006.386.8593.929.5813.2927.16
kroa20021.3522.92657.7827.2829.63185.74
lin31851.0752.462,453.9753.1381.28663.22
pr22626.2227.02992.7233.7743.85229.39
st704.063.8831.676.399.5611.55
rat19521.4421.46570.5725.4336.15155.37
06Contributions
LanguagePython
ProblemTraveling Salesman Problem (TSP) — symmetric, Euclidean
MethodMutation Triggering Method (MTM) — Swap + Insertion + 2-opt
CrossoverOrder Crossover (OX)
SelectionTournament Selection
Pm Formulak / √(current generation number)
Selector Eq.max_gen − (factor × max_gen)
BaselinesT-GA (Swap / Insertion / 2-opt) · RCDM-GA (Swap / Insertion)
BenchmarkTSPLIB — eil51, a280, bier127, kroa100, kroa200, lin318, pr226, st70, rat195
PublishedSpringer · Embracing Industry 4.0 · pp. 159–170 · Singapore · 2020

Read the full paper & source code

Published in Springer Embracing Industry 4.0, 2020, pp. 159–170.