An Analysis of Several Heuristics for the Traveling Salesman Problem II: Every Insertion Method Is Within ⌈lg n⌉ + 1 of the Optimal TourResearch Paper
Motivation
The traveling salesman problem asks for a shortest closed route visiting every node of a weighted complete graph exactly once. It is NP-hard, so practitioners use fast heuristics, and the basic question about a heuristic is how far from optimal its tour can be. Rosenkrantz, Stearns and Lewis (SIAM J. Comput. 6(3), 1977) gave the first systematic worst-case analysis of the simple constructive heuristics under the triangle inequality: nearest neighbor, the family of insertion methods, and several variants.
Insertion methods build a tour by growing it one node at a time. They are among the most widely used construction heuristics in practice and in textbooks, and they differ only in the rule that chooses which node to insert next: the nearest one, the cheapest one, the farthest one, a random one, or any other. This mission formalizes the paper's result that holds for the whole family at once, regardless of that rule: every insertion method produces a tour at most times longer than an optimal one (Theorem 3, p. 571).
Timeline. 1977: Rosenkrantz, Stearns and Lewis prove for every insertion method (Theorem 3), for nearest neighbor (Theorem 1), both from a shared counting lemma (Lemma 1), and the constant for nearest and cheapest insertion (Theorem 4). 1994: Bafna, Kalyanasundaram and Pruhs (Theoretical Computer Science 125, 1994) give instances on which some insertion methods reach ratio , so the logarithmic growth cannot be replaced by a constant for the family as a whole.
Setting
A traveling salesman graph with nodes consists of a finite node set with and a distance with , and for all nodes (the triangle inequality). A tour visits every node once and returns to its start; its length is the sum of its edge lengths, and OPTIMAL is the least length of a tour.
A subtour is a tour on a subset of the nodes; a single node is a tour without edges. Given a subtour and a node , TOUR is obtained by choosing an edge of minimizing
and replacing it by the edges and ; if is a single node , TOUR is the two-node tour . COST is the length of TOUR minus the length of .
An insertion method constructs subtours with a single node and for some node , . The final tour is the approximation, and INSERT denotes its length. No rule for choosing the is fixed, and ties between minimizing edges are broken arbitrarily.
Write for the logarithm to base 2 and for the least integer .
Formalization targets
Goal: Theorem 3
For every traveling salesman graph with nodes and every run of every insertion method,
Milestones
- (2.2), shortcutting: visiting a subset of the nodes in the order of a tour gives a tour of the subset that is no longer.
- (2.1): if the numbers satisfy for distinct , then for .
- Lemma 1: if for distinct nodes and for all , then
- Lemma 2: for every node of .
- (3.7): .
- (3.10): whenever .
- (3.12): for .
Significance
The result. Theorem 3 is a guarantee for an entire class of algorithms rather than for one. Any rule for choosing the next node, including rules designed for speed or for empirical quality, inherits a worst-case ratio of from the insertion step alone. The rule matters only for improving on that: nearest and cheapest insertion achieve the constant (Theorem 4 and its corollary, the subject of the third mission of this series), while the logarithmic bound remains the best general statement for other rules, such as farthest or arbitrary insertion. Lemma 1 is reusable on its own: it converts "every node carries a charge bounded by half the optimum and by its distance to other nodes" into a logarithmic bound, and the same lemma yields the nearest neighbor bound of Theorem 1.
Formalizing it. The theorem has been proved since 1977; the work here is a machine-checked proof of the known argument together with a reusable library for subtours, insertion and insertion costs. The companion nearest neighbor bound (Theorem 1) is already on the platform as SupplyChainTheory.nearest_neighbor_bound (proved), and nearest insertion with constant 2 as SupplyChainTheory.nearest_insertion_bound; neither covers arbitrary insertion methods or states Lemma 1 separately.
Difficulty
The per-step facts are local: each insertion is cheap relative to a node already present (Lemma 2) and relative to OPTIMAL (3.12). The obvious way to combine them, adding up costs each at most OPTIMAL, gives only the ratio . The logarithm comes from a global counting argument over all nodes simultaneously (Lemma 1), in which OPTIMAL is compared with tours on nested subsets of nodes of doubling size, and the per-node charges must be matched against the edges of those tours. Formally, the delicate parts are the bookkeeping of subtours as they grow (that every earlier node lies on the current subtour, and that the insertion cost equals the length increase), the shortcutting of a tour to an arbitrary subset, and the ceiling-of-logarithm arithmetic.
Formalization scope
Nodes are Fin n; a tour of all nodes is a permutation τ : Equiv.Perm (Fin n), and OPTIMAL is the minimum of the tour length over the finite, nonempty set of permutations. Subtours are duplicate-free lists of nodes, with closed length . TOUR is encoded as inserting at a list position whose resulting length is minimal among all positions; inserting at a position removes exactly one edge of and raises the length by exactly , so this is the paper's rule, with every tie-breaking allowed. COST is the minimum length increase over positions. The paper's 1-based subtour index is kept (, final). is Nat.clog 2 n. All quantities are real.
Conventions and deviations, each disclosed in the item statements:
- The distance satisfies , a normalization not in the paper; a loop never enters any length.
- Ratios are multiplied out (), so the paper's exclusion of the identically zero distance (1.1) is not needed.
- Condition a) of Lemma 1 is required for distinct nodes only. The page says "for all nodes and ", which for would force every and make the lemma inapplicable in the proof of Theorem 3; the proof uses the condition only on edges of a tour.
- (2.2) is stated for every subset of the nodes and every tour, which is what the shortcut argument shows; the paper applies it to one specific subset and an optimal tour.
- (2.1) uses 0-based node labels, so its range becomes .
The goal quantifies over every run: any choice of the inserted nodes and any minimizing insertion position. Adding a selection rule (nearest, cheapest) or fixing a tie-breaking would state a weaker, different theorem; restricting to instances with OPTIMAL or to a fixed small would trivialize it.
Reusable beyond this mission: the subtour and insertion library (closed length of a list, TOUR, COST, insertion runs) and Lemma 1, which also yields Theorem 1. Contributions welcome: proofs of the milestones, general lemmas about the closed length of List.insertIdx and of filtered lists, and a proof of Theorem 1 from this mission's Lemma 1.
Selected references
- D. J. Rosenkrantz, R. E. Stearns, P. M. Lewis II, An Analysis of Several Heuristics for the Traveling Salesman Problem, SIAM Journal on Computing 6(3):563–581, 1977. https://doi.org/10.1137/0206041
- V. Bafna, B. Kalyanasundaram, K. Pruhs, Not all insertion methods yield constant approximate tours in the Euclidean plane, Theoretical Computer Science 125(2):345–353, 1994.