NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Token Swapping on Trees

Ahmad Biniaz, Kshitij Jain, Anna Lubiw, Zuzana Masárová, Tillmann Miltzow, Debajyoti Mondal, Anurag Murty Naredla, Josef Tkadlec, Alexi Turcotte · DOI

Abstract

This paper explores the Token Swapping problem on tree graphs, a classic reconfiguration challenge. The authors disprove the 30-year-old "Happy Leaf Conjecture," establish new lower bounds for approximation algorithms, and prove that the weighted, coloured version of the problem is NP-complete on trees.

Introduction

The Token Swapping problem is a fundamental puzzle in algebraic combinatorics and graph reconfiguration. Given a graph where each vertex $v_i$ initially holds a unique token, the goal is to reach a target configuration (where token $i$ resides at vertex $v_i$) using the minimum number of swaps between tokens on adjacent vertices.

An instance of token swapping on a tree. The dashed arrows represent the permutation mapping tokens to their target vertices.

While NP-hard on general graphs, the problem was long thought to be more tractable on trees. A central intuition was the "Happy Leaf Conjecture" (Vaughan, 1991), which posited that an optimal swap sequence never needs to move a token that is already at its correct leaf destination.

Methods and Analysis

The researchers combined computer-aided search with combinatorial analysis to probe the limits of tree-based token swapping:

  • Counterexample Discovery: Through exhaustive search, they identified a 10-vertex tree where moving a "happy" leaf token—one already in its correct position—actually reduces the total swap count from 36 to 34.
  • Complexity Reductions: The authors proved NP-completeness for the Weighted Coloured Token Swapping problem via a reduction from Vertex Cover. In this variant, tokens have weights, and the cost of a swap is the sum of the weights of the involved tokens.
  • Algorithm Design: They introduced a simplified $O(n^2)$ algorithm for "broom" graphs (a star graph with an attached path), streamlining previous proofs of tractability for this class.

Key Insights

The Happy Leaf Paradox

The disproof of the Happy Leaf Conjecture reveals that local optimality can be globally detrimental. Temporarily moving a token out of its correct leaf position can "clear a path" for other tokens, leading to a more efficient overall sequence. This finding has significant implications for algorithm design, as many existing heuristics rely on "fixing" happy leaves.

Approximation Limits

The authors demonstrated that two prominent 2-approximation algorithms—the "Happy Swap" and "Cycle" algorithms—have a worst-case approximation factor of exactly 2. Furthermore, because these algorithms never move happy leaves, they are fundamentally limited to an approximation factor no better than $4/3$.

Results and Complexity Boundaries

The study identifies a sharp "complexity cliff" for weighted token swapping. While the problem remains easy on simple structures like paths and stars, it becomes NP-complete on "spiders" (stars with subdivided edges). This highlights how even minor increases in topological complexity can render the problem computationally intractable.

Conclusion

By debunking long-held intuitions and mapping the complexity landscape of weighted variants, this work refines our understanding of reconfiguration on trees. While the standard unweighted problem on trees was recently shown to be NP-complete in subsequent work, identifying specific tree classes that remain solvable and improving approximation factors beyond 2 remain open challenges for the field.

Summary updated

BibTeX
@article{biniaz2019token,
  author = {Ahmad Biniaz and Kshitij Jain and Anna Lubiw and Zuzana Masárová and Tillmann Miltzow and Debajyoti Mondal and Anurag Murty Naredla and Josef Tkadlec and Alexi Turcotte},
  title = {{Token Swapping on Trees}},
  journal = {Discret. Math. Theor. Comput. Sci.},
  year = {2019},
  doi = {10.46298/dmtcs.8383},
}
Figure