Learn · Lesson 3

The Travelling Salesman on canvas

How combinatorial ordering problems challenge parametric optimizers, why the original SilverEye DataTree tutorial created search plateaus, and how a normalized permutation encoding reveals true solver capability.

Benchmark Routes (20 Cities):
Variant 1 · SilverEye Tutorial

DataTree Integer Encoding

Many-to-One

The Plateau Trap: Integer sliders [0, N−1] assign cities to branches /{x}/. Cities sharing a branch preserve initial index order. This creates huge multi-dimensional plateaus where mutations cause zero displacement (Δf = 0) or sudden disruptive shuffles.

Variant 2 · Ambrosini (2026)

Normalized Random-Keys

Bijective · Continuous

Continuous Bijective Mapping: Continuous float sliders [0.0, 1.0] sort cities via argsort. Zero probability of duplicate collisions, smooth topological neighborhood, and continuous gradients for covariance matrix adaptation and metaheuristics.

The problem in numbers

Problem Class
Symmetric Euclidean Travelling Salesman Problem (TSP) on the Grasshopper canvas, generated as uniform random coordinates in a 10 × 10 square.
Instances
Three standardized benchmark instances: 10 cities, 15 cities, and 20 cities.
Search Space
The number of possible undirected tours is (N − 1)! / 2. For 10 cities: 1.8 × 105 tours; for 15 cities: 4.3 × 1010 tours; for 20 cities: 6.1 × 1016 candidate tours.
Mathematical Ground Truth
Exact global optima computed via the dynamic programming Held–Karp algorithm (Held & Karp 1962): 39.06 (10 cities), 44.78 (15 cities), and 48.46 (20 cities).
Canvas Evaluation Cost
Approximately 1.5 ms per evaluation on a desktop workstation. A complete 1,200-evaluation run executes in under 2 seconds for population solvers, allowing rigorous 10-run replication across 16 solvers (thousands of runs total).
Objective
Minimise total polyline perimeter length across all cities in a closed loop (in cm).

Why combinatorial problems in architectural design?

Optimization in computational architecture is not limited to continuous geometric deformation (such as adjusting wall thickness, panel curvature, or shell heights). A substantial class of design and fabrication challenges is fundamentally discrete and combinatorial:

  • Digital fabrication routing: Minimizing rapid-travel toolpaths for CNC milling, laser cutting, and waterjet nesting.
  • Additive manufacturing & 3D printing: Sequencing continuous extrusion toolpaths to reduce non-printing retract moves and prevent thermal defects.
  • Assembly and logistics: Ordering the crane picking and placement sequence of prefabricated timber elements or structural steel trusses.
  • Spatial layout planning: Circulations, room adjacency graphs, and programmatic pathfinding.

Unlike continuous test functions, the Travelling Salesman Problem on the Grasshopper canvas provides an unarguable mathematical ground truth. While structural finite-element or building energy simulations depend on mesh discretization and numerical solver convergence, the exact minimum tour length of a Euclidean TSP is known definitively down to the decimal point through the Held–Karp algorithm.

The SilverEye DataTree encoding & the "Many-to-One" trap

In 2017, the developers of SilverEye (Cichocka et al. 2017) distributed an official Travelling Salesman Problem exercise as a benchmark for particle swarm optimization in Grasshopper. The Grasshopper definition adopted a visual DataTree parameterization:

  1. Each city index i has an integer number slider in the range [0, N − 1].
  2. The sliders feed the Path input of a DataTree Graft component, assigning each city to a branch /{branch_id}/.
  3. When multiple cities receive the exact same slider integer, they are placed together into the same branch, where they are visited in their original input order.
  4. The branches are flattened in ascending numerical order, producing the closed polyline whose length is evaluated.

While intuitive on the canvas, this formulation introduces a severe mathematical artifact: the mapping from sliders to tours is many-to-one. For a 10-city problem, there are 1010 (10 billion) possible slider combinations, but only 1.8 million distinct tours.

This causes the fitness landscape to degenerate into vast multi-dimensional plateaus separated by steep cliffs. On these plateaus, conventional evolutionary difference vectors (such as Differential Evolution in L-SHADE) either mutate sliders without altering the resulting tour (Δf = 0), or cross an integer boundary that abruptly moves multiple cities at once.

The Ambrosini Random-Key normalization (2026)

To determine whether the many-to-one DataTree encoding biased solver comparisons in the SilverHawk Benchmark Report v1.0, Luciano Ambrosini designed a control experiment using a bijective random-key permutation encoding (Report §7.5, Table S6).

In this normalized formulation, continuous float sliders in the unit interval [0.0, 1.0] act as sorting keys. The tour visits cities strictly in the ascending order of their continuous values (an argsort operation).

Because the probability of two continuous floating-point sliders having the exact same value is zero, this guarantees:

  • No DataTree clumping: Every city has a distinct sorting rank, eliminating arbitrary fallback to canvas input order.
  • Smooth topological neighborhoods: Small continuous slider mutations produce small local transpositions in the tour (e.g. swapping adjacent cities), preserving metric distance.
  • Elimination of artificial plateaus: The fitness landscape becomes piecewise smooth, allowing covariance matrix adaptation (CMA-ES) and hyper-heuristics (MERLIN) to search effectively.

Empirical findings from the 2026 Benchmark Report

Tested across 16 optimization solvers at 1,200 evaluations (10 independent runs each, 3 for Tunny):

  • Head-to-head dominance: In pairwise comparisons against external Grasshopper tools across the canvas benchmarks, SilverHawk CMA-ES won 15 of 20 matchups and MERLIN won 13, with zero losses (Mann-Whitney test, α = 0.05).
  • Ranking stability across encodings: In the control experiment comparing the SilverEye DataTree encoding against the normalized Random-Key encoding, CMA-ES and MERLIN remained the top two solvers, proving that their superiority is an algorithmic capability, not an artifact of the DataTree.
  • Best tour found: On the challenging 20-city instance, MERLIN discovered the best single tour of the entire campaign (49.32, just 1.8 % from the theoretical optimum), beating the best tour of any external tool (50.24, Opossum-RBFOpt) and Galapagos GA (58.33).
  • The surrogate trade-off: Opossum-RBFOpt led during the first 350 evaluations due to rapid surrogate initialization, but its runs took 3 to 25 minutes compared to approximately 1 minute for SilverHawk population solvers.

Evidence and references

Benchmark Technical Report & Preprints

  • Ambrosini, L. (2026). SilverHawk – Benchmark Report v1.0. Zenodo Technical Report LA-SH-TR-2026-01, Section 7: Travelling-salesman instances in Grasshopper, pp. 28–45. doi:10.5281/zenodo.23768134 ↗
  • Ambrosini, L. (2026). Hybrid metaheuristics for architectural design optimization under small evaluation and wall-clock budgets. arXiv:2610.26202 [cs.NE]. arXiv:2610.26202 ↗

Combinatorial Optimization & Grasshopper

  • Cichocka, J. M., Browne, W. N., & Rodriguez, E. (2017). SilverEye – The Implementation of Particle Swarm Optimization Algorithm in a Design Optimization Tool. In CAADRIA 2017: Protocols, Flows and Glitches, pp. 145–154. doi ↗
  • Held, M., & Karp, R. M. (1962). A dynamic programming approach to sequencing problems. Journal of the Society for Industrial and Applied Mathematics, 10(1), 196–210. doi ↗

Continue exploring