Papers
Topics
Authors
Recent
Search
2000 character limit reached

Colored Token Routing

Updated 17 February 2026
  • Colored token routing is defined as the problem of swapping tokens on graph vertices to achieve a prescribed color configuration.
  • It exhibits sharp complexity dichotomies, being NP-complete for 3-colors on constrained graphs and PSPACE-complete under specific swap constraints.
  • Applications span sorting networks, quantum circuit compilation, and blockchain token attribution, employing both sequential and parallel swap models.

Colored token routing encompasses a family of combinatorial reconfiguration problems in which tokens, each bearing a color label, must be routed or swapped across the vertices of a graph so that the final arrangement matches a prescribed coloring pattern. Tokens of the same color are considered indistinguishable, and only colored configurations, not token identities, matter. Both sequential (one swap per step) and parallel (multiple swaps via edge matchings per step) models are studied. Colored token routing is motivated by problems in sorting networks, quantum circuit compilation, molecule assembly, and onchain token attribution. The underlying computational questions pose rich complexity-theoretic, algorithmic, and parameterized challenges, tied closely to the structure of the graph, color set, and allowable swap constraints.

1. Formal Definition and Problem Variants

The fundamental model comprises:

  • An undirected graph G=(V,E)G = (V, E).
  • A set CC of token-colors.
  • A mapping Ï„0:V→C\tau_0: V \to C (initial token placement).
  • A target coloring τ∗:V→C\tau^*: V \to C, with ∀c∈C\forall c \in C, ∣{v:Ï„0(v)=c}∣=∣{v:τ∗(v)=c}∣|\{v: \tau_0(v) = c\}| = |\{v: \tau^*(v) = c\}|.

A legal move swaps tokens on adjacent vertices {u,v}∈E\{u, v\} \in E. The goal is to find a minimal-length sequence of such swaps that transforms τ0\tau_0 into τ∗\tau^* so that for all vv, the color at CC0 equals CC1. The decision version asks, for a given budget CC2, whether such a sequence exists of length at most CC3: CC4 Extensions include subset token swapping (where a token can have multiple valid destinations) and constrained colored token swapping (where swaps are only allowed between specific pairs of colors, described by a swap-constraint graph CC5) (Bonnet et al., 2016, Bilò et al., 14 Jan 2026, Yamanaka et al., 2018).

Parallel (or matching-based) variants allow, in each round, a set CC6 of pairwise-disjoint edges (a matching) to carry out all swaps simultaneously. Given initial and target colorings CC7, the objective is to minimize the number of parallel swap rounds to reach CC8 (Kawahara et al., 2016, Bansal et al., 2024).

2. Computational Complexity and Parameterized Results

Colored token routing problems exhibit sharp complexity dichotomies depending on the number of colors, the type of allowed swaps, and the structure of the underlying and swap-constraint graphs.

  • NP-completeness: The problem is NP-complete for CC9 even when Ï„0:V→C\tau_0: V \to C0 is planar, bipartite, and of degree at most 3 (Bonnet et al., 2016, Yamanaka et al., 2018, Kawahara et al., 2016). For parallel (matching) swaps, 3-colored routing is NP-complete for Ï„0:V→C\tau_0: V \to C1 steps, and 2-colored routing becomes NP-hard for Ï„0:V→C\tau_0: V \to C2 (Kawahara et al., 2016).
  • PSPACE-completeness: The constrained variant CCTS is PSPACE-hard for Ï„0:V→C\tau_0: V \to C3 colors when the swap-constraint graph Ï„0:V→C\tau_0: V \to C4 is a path Ï„0:V→C\tau_0: V \to C5; membership in PSPACE holds via explicit configuration graph simulation (Bilò et al., 14 Jan 2026).
  • Fixed-Parameter Tractability (FPT) and XP:
    • If parameterized by Ï„0:V→C\tau_0: V \to C6 (the number of swaps), colored token swapping is Ï„0:V→C\tau_0: V \to C7-hard; no Ï„0:V→C\tau_0: V \to C8-time algorithm exists unless ETH fails (Bonnet et al., 2016).
    • In nowhere-dense graph classes (including all planar and bounded treewidth graphs), CTS (and even the more general subset token swapping) is FPT in Ï„0:V→C\tau_0: V \to C9 (Bonnet et al., 2016).
    • With parameter τ∗:V→C\tau^*: V \to C0 (maximum degree), the problem admits an FPT algorithm with a kernel size bounded by τ∗:V→C\tau^*: V \to C1 (Bonnet et al., 2016).
    • For degree-2 graphs (disjoint paths/cycles), τ∗:V→C\tau^*: V \to C2-time XP algorithms exist parameterized by τ∗:V→C\tau^*: V \to C3 (Yamanaka et al., 2018).
    • On the complete graph, CTS is FPT parameterized by color count τ∗:V→C\tau^*: V \to C4, using a cycle cover reduction to integer linear programming (Yamanaka et al., 2018).

3. Algorithmic Frontiers and Special Graph Classes

The tractability border for colored token routing is highly sensitive to the structure of τ∗:V→C\tau^*: V \to C5 and the allowed color-interaction graph τ∗:V→C\tau^*: V \to C6. The landscape, for both sequential and parallel routing, is summarized as follows (Bonnet et al., 2016, Yamanaka et al., 2018, Kawahara et al., 2016, Bilò et al., 14 Jan 2026):

Graph Class Unconstrained CTS With Swap Constraints H
Path Poly-time (greedy) Star H: poly-time; Path H: hard
Star Poly-time Star H: poly-time
Clique NP-complete
Tree (c=2) Linear-time Star H: poly-time
Tree (c≥3) Open
Planar/cubic NP-complete (c≥3) PSPACE-complete for τ∗:V→C\tau^*: V \to C7, τ∗:V→C\tau^*: V \to C8 (Bilò et al., 14 Jan 2026)
Complete graph FPT in c

For τ∗:V→C\tau^*: V \to C9, the problem is poly-time solvable on general graphs via a minimum-weight perfect matching approach. Paths and stars admit efficient sorting strategies. For parallel routing, the decision problem is tractable for ∀c∈C\forall c \in C0, ∀c∈C\forall c \in C1, but hard for ∀c∈C\forall c \in C2, ∀c∈C\forall c \in C3 or ∀c∈C\forall c \in C4, ∀c∈C\forall c \in C5 (Kawahara et al., 2016).

Constrained CTS becomes tractable if and only if the swap-constraint graph ∀c∈C\forall c \in C6 is ∀c∈C\forall c \in C7-free (i.e., a clique or a star), and is PSPACE-complete otherwise (Bilò et al., 14 Jan 2026). In the star case, the problem reduces to canonical pebble motion, leveraging classical results on the 15-puzzle parity criterion.

4. Approximation Algorithms and Quantum Circuit Applications

In parallel colored token routing, constant-factor approximation algorithms have been established for structured graphs prevalent in qubit-mapping for quantum hardware, such as grids, cycles, and subdivided stars (Bansal et al., 2024):

  • On cycles, coloring reduces to selecting cyclic shifts; a greedy odd–even strategy achieves makespan at most twice the lower bound for even cycles (∀c∈C\forall c \in C8).
  • On subdivided stars, a multi-phase methodology yields complexity at most ∀c∈C\forall c \in C9, where ∣{v:Ï„0(v)=c}∣=∣{v:τ∗(v)=c}∣|\{v: \tau_0(v) = c\}| = |\{v: \tau^*(v) = c\}|0 is the branch count.
  • For ∣{v:Ï„0(v)=c}∣=∣{v:τ∗(v)=c}∣|\{v: \tau_0(v) = c\}| = |\{v: \tau^*(v) = c\}|1 grid graphs, a three-phase row/column/row approach ensures ∣{v:Ï„0(v)=c}∣=∣{v:τ∗(v)=c}∣|\{v: \tau_0(v) = c\}| = |\{v: \tau^*(v) = c\}|2.

These results guarantee that, for quantum circuit routing, swap depth can be kept within a constant factor of an instance-specific lower bound (maximum token–target distance), providing near-optimality in scheduling SWAP gates for indistinguishable qubits (Bansal et al., 2024).

The stretch factor, defined as the maximal ratio over all instances of the algorithmic makespan to the distance lower bound, is constant for lines (2), linear in ∣{v:τ0(v)=c}∣=∣{v:τ∗(v)=c}∣|\{v: \tau_0(v) = c\}| = |\{v: \tau^*(v) = c\}|3 for cycles, and ∣{v:τ0(v)=c}∣=∣{v:τ∗(v)=c}∣|\{v: \tau_0(v) = c\}| = |\{v: \tau^*(v) = c\}|4 for grids.

5. Color Constraints, Swap Models, and Token Fungibility

The structure and constraints of the color-interaction graph ∣{v:τ0(v)=c}∣=∣{v:τ∗(v)=c}∣|\{v: \tau_0(v) = c\}| = |\{v: \tau^*(v) = c\}|5 (which pairs of colors are allowed to swap when their tokens are on endpoints of an edge) create the most significant impact on both decision and optimization complexity.

  • If ∣{v:Ï„0(v)=c}∣=∣{v:τ∗(v)=c}∣|\{v: \tau_0(v) = c\}| = |\{v: \tau^*(v) = c\}|6 is a star—one color swappable with all others, no others allowed—CTS reduces to pebble motion, with a complete polynomial-time characterization using generalized transitivity and permutation parity (Bilò et al., 14 Jan 2026).
  • If ∣{v:Ï„0(v)=c}∣=∣{v:τ∗(v)=c}∣|\{v: \tau_0(v) = c\}| = |\{v: \tau^*(v) = c\}|7 induces a path ∣{v:Ï„0(v)=c}∣=∣{v:τ∗(v)=c}∣|\{v: \tau_0(v) = c\}| = |\{v: \tau^*(v) = c\}|8, the problem simulates nondeterministic constraint logic—showing universality and PSPACE-completeness (Bilò et al., 14 Jan 2026).
  • When tokens of the same color are entirely fungible and the only constraint is eventual matching of multiset colorings at each vertex, the system underpins practical algorithms for fungible token attribution in distributed ledgers (Zarick et al., 2023). In such models, colored balances are maintained per wallet, and "color routing" involves constrained burns, mints, and cross-domain invariants for consistency and traceability, distinct from graph-reconfiguration models.

6. Open Problems and Future Directions

Key open questions concern the complexity of colored token swapping on various families for small ∣{v:τ0(v)=c}∣=∣{v:τ∗(v)=c}∣|\{v: \tau_0(v) = c\}| = |\{v: \tau^*(v) = c\}|9 (e.g., trees), the existence of constant-approximation algorithms for arbitrary graphs in colored routing via parallel swaps, and the parameterized complexity for novel parameter sets (e.g., total tokens moved, number of color classes occupied). Another direction is the systematic study of stretch-factor tightness on graph classes beyond those with known constant-factor strategies (Bansal et al., 2024), and the exploration of real-world, large-scale colored routing protocols in high-throughput blockchain and distributed ledger contexts (Zarick et al., 2023).

The theoretical landscape is now sharply characterized: for unconstrained or star-constrained swaps, colored token routing is in P or FPT (with explicit parametrizations). As soon as swap limitations encode a path of length four in the interaction graph, PSPACE-hardness emerges, even on highly restricted base graphs (Bilò et al., 14 Jan 2026). This threshold dictates the tractability frontier for both theoretical study and practical algorithm implementation.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Colored Token Routing.