Abstract 1 Introduction 2 Preliminaries 3 Hardness for standard token swapping 4 Hardness for 0/1-Weighted Token Swapping 5 Additional barriers to improved algorithms References

Improved Hardness-Of-Approximation for Token-Swapping

Sam Hiken ORCID Department of Computer Science and Engineering, University of Michigan, Ann Arbor, MI, USA Nicole Wein ORCID Department of Computer Science and Engineering, University of Michigan, Ann Arbor, MI, USA
Abstract

We study the token swapping problem, in which we are given a graph with an initial assignment of one distinct token to each vertex, and a final desired assignment (again with one token per vertex). The goal is to find the minimum length sequence of swaps of adjacent tokens required to get from the initial to the final assignment.

The token swapping problem is known to be NP-complete. It is also known to have a polynomial-time 4-approximation algorithm. From the hardness-of-approximation side, it is known to be NP-hard to approximate with a ratio better than 1001/1000.

Our main result is an improvement of the approximation ratio of the lower bound: We show that it is NP-hard to approximate with ratio better than 14/13.

We then turn our attention to the 0/1-weighted version, in which every token has a weight of either 0 or 1, and the cost of a swap is the sum of the weights of the two participating tokens. Unlike standard token swapping, no constant-factor approximation is known for this version, and we provide an explanation. We prove that 0/1-weighted token swapping is NP-hard to approximate with ratio better than (1ε)ln(n) for any constant ϵ>0.

Lastly, we prove two barrier results for the standard (unweighted) token swapping problem. We show that one cannot beat the current best known approximation ratio of 4 using a large class of algorithms which includes all known algorithms, nor can one beat it using a common analysis framework.

Keywords and phrases:
algorithms, token-swapping, hardness-of-approximation, lower-bounds
Funding:
Sam Hiken: NSF grant CNS-2150186, Paglia Post-Baccalaureate Fellowship.
Copyright and License:
[Uncaptioned image] © Sam Hiken and Nicole Wein; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Approximation algorithms analysis
; Theory of computation Graph algorithms analysis
Related Version:
Full Version: https://arxiv.org/abs/2410.19638
Acknowledgements:
We would like to thank anonymous reviewers for their helpful suggestions.
Editors:
Anne Benoit, Haim Kaplan, Sebastian Wild, and Grzegorz Herman

1 Introduction

In the token swapping problem [1, 8, 2, 25, 30, 31, 32, 35, 18, 9, 10, 16, 20, 17, 36, 21, 29], we are given an undirected n-vertex graph G=(V,E), n distinct tokens, and two one-to-one assignments of tokens to vertices: a starting assignment, and a target assignment. A swap along an edge (u,v)E switches the locations of the tokens on u and v. The token swapping problem asks how many swaps are needed to arrive at the target configuration from the starting configuration.

The token swapping problem is a fundamental and well-studied problem, and one of the central problems in the area of reconfiguration algorithms. It has also found relevance in a number of disparate areas including network engineering [2], robot motion planning [12, 28], and game theory [14]. Token swapping (mainly its parallel variant [3, 6, 12, 17, 37]) also has an extensively studied application to qubit routing (e.g. [5, 26, 19, 7, 11, 15, 24, 33]). Algorithms and heuristics for the token swapping problem have also undergone experimental evaluation [23, 27].

The token swapping problem is NP-complete [18], even when the underlying graph is a tree [1]. As a result, the research literature has focused on approximation algorithms. Miltzow, Narins, Okamoto, Rote, Thomas, and Uno gave a 4-approximation [18], which remains the best known. For the special case of trees, there is a 2-approximation, which was independently discovered 3 times using different algorithms [2, 32, 35].

From the hardness side, the above work [18] proved that token swapping is APX-hard (on general graphs). Thus, unless P=NP, token swapping does not admit a PTAS, and instead there exists some positive constant c for which there is no c-approximation. Regarding this constant c, they state “We want to point out that a crude estimate for the constant c in [the NP-hardness result] is c1+1/1000. We do not believe that it is worth to compute c exactly. Instead, we hope that future research might find reductions with better constants.” This question is the main focus of our work.

We also consider the 0/1-weighted version of token swapping, in which each token has a weight of either 0 or 1, and the cost of a swap is the sum of the weights of the two tokens. Despite being studied in prior work [8, 1], there is no known approximation algorithm for 0/1-weighted token swapping with a non-trivial approximation ratio. Furthermore, there is no known separation between 0/1-weighted token swapping and standard token swapping.

See the introductions of [8] and [1] for a more detailed survey of related work, including a sizable body of work on token swapping for a number of special classes of graphs.

1.1 Our Results

Our main result is the first hardness of approximation result for token swapping with an explicit approximation ratio of “reasonable” magnitude. Specifically, we show that it is NP-hard to obtain better than a 14/13-approximation:

Theorem 1.

For any constant ϵ>0, it is NP-hard to approximate token swapping on graphs within a factor of 14/13ϵ.

Our result is via a reduction from the label cover problem. We note that our result does not rely on the Unique Games Conjecture, and is instead a gap-preserving reduction from a regime of the label cover problem known to be NP-complete.

For 0/1-weighted token swapping, our next result explains the aforementioned gap in the literature by showing a large separation between the 0/1-weighted and unweighted versions. Specifically, we show that it is NP-hard to obtain better than an (lnn)-approximation for 0/1-weighted token swapping:

Theorem 2.

For any constant ϵ>0, it is NP-hard to approximate weighted token swapping with {0,1} weights on n vertices within a factor of (1ϵ)lnn.

Our reduction uses a completely different technique from our main result, and is a much simpler reduction, from the set cover problem. This is notable in comparison to the known reductions in the token swapping literature, which tend to be quite complicated [1, 8, 18, 9].

Our final two results are barrier results regarding the algorithm and analysis techniques that could possibly achieve better than the current best-known approximation ratio of 4 (for standard unweighted token swapping). All known token swapping algorithms have the natural property of local optimality: they never perform a swap that brings both tokens farther from their destinations.111We compare the notion of a locally optimal algorithm to that of an -straying algorithm, introduced in prior work on token swapping for trees [1]. These two notions are incomparable: a swap sequence can have either property without having the other. However, any algorithm that solves token swapping on general graphs must generate an Ω(n)-straying swap sequence: consider the example of a cycle where each token wants to shift over by 1. For this reason, we do not consider -straying algorithms for general graphs, and focus instead on locally optimal algorithms. We show that, strangely, this property must be violated to achieve any approximation ratio better than 4.

Theorem 3.

For any δ>0, there exists a token swapping instance K so that for any locally optimal swap sequence of length k, (4δ)OPT(K)k.

In our second barrier result, we show that a proof technique used by all known analyses of approximation algorithms for token swapping, cannot yield better than a 4-approximation. In particular, all known approximation algorithms for token swapping on general graphs and trees [18, 35, 2] use the following approach to bound the approximation factor. Given a Token Swapping instance K, consider the quantity total(K)=tTdist(f1(t),f2(t)). We observe that 12total(K)OPT(K), as each swap moves at most two tokens closer to their destinations. Proofs of correctness for approximation algorithms then show that they yield swap sequences of length at most ctotal(K), which implies that the given algorithm is a 2c-approximation. A natural approach to obtaining a (4ϵ)-approximation for token swapping on graphs, then, is to show that on any input an algorithm yields a swap sequence of length at most ctotal(K), for some c<2. Below, we show that this approach will not work.

Theorem 4.

For any δ>0, there exists a token swapping instance K so that OPT(K)(2δ)total(K).

The proof is given in the full version.

Lastly, in the full version we provide an alternative algorithm that gives a 4-approximation for token swapping (in addition to the known algorithm [18]). While the algorithm of [18] is an extension of the 2-approximation “happy swap algorithm” for trees [2], our algorithm is an extension of the 2-approximation “cycle algorithm” for trees [35].

1.2 Additional Related Work

Token swapping and its variants have been studied from many angles. Exponential-time algorithms and hardness under the Exponential Time Hypothesis (ETH) were studied in [18]. Parameterized complexity was studied in [9], where the authors show that token swapping is W[1]-hard when the parameter is the number of swaps, and show further hardness under ETH. Token swapping has also been studied on a variety of special classes of graphs including cycles [16], stars [21, 20], brooms [17, 8, 31], complete bipartite graphs [35], complete split graphs [36], and cliques [10] (dating back to Cayley in 1849). Colored token swapping has also been studied, where each token has a color and same-colored tokens are indistinguishable [18, 8, 9, 34, 34]. There are also several other models of token movement on graphs such as token sliding, token rotation, and token permutation (see e.g. [28]). See also the introductions of [8] and [1] for more details on the wealth of related work.

2 Preliminaries

Definition 5.

A Token Swapping instance K=(G,T,f1,f2) consists of a graph G=(V,E), a set of tokens T where |T|=|V|, and two one-to-one assignments f1,f2:TV. We call f1 and f2 the starting and target configurations respectively. A swap along an edge (u,v)E switches the locations of the tokens on u and v. The token swapping problem asks how many swaps are needed to arrive at the target configuration from the starting configuration.

For a token swapping instance K, we denote by OPT(K) the length of the shortest swap sequence. For a vertex v, we denote by f11(v) and f21(v) the tokens that begin and end on v. When a token t lies on the vertex v1 of the path p=v1,v2,,vk, we use the phrase bubbling t across p to denote the sequence of swaps (v1,v2),(v2,v3),,(vk1,vk).

We also consider the following weighted variant of Token Swapping:

Definition 6 (Weighted Token Swapping).

An instance of Weighted Token Swapping W=(G,T,w,f1,f2) consists of a graph G=(V,E), together with a set of tokens T of size |V|. The weight function w:T0 assigns to each token a non-negative real weight. As in standard Token Swapping, the one-to-one functions f1,f2:TV map each token to a unique vertex, giving the starting and target configurations of W. The weight of an edge swap is the sum of the weights of the tokens being swapped. The weight of a swap sequence is the sum of the weights of the constitutive edge swaps. The output to W is the weight of the lowest-weight swap sequence from the starting to the target configuration.

3 Hardness for standard token swapping

In this section, we prove Theorem 1. See 1 This improves on the lower bound presented in [18], which is roughly 1001/1000. We obtain our lower bound via a gap-preserving reduction from Label-Cover, defined below.

Definition 7 (Label Cover).

An instance of Label-Cover Φ=(X,Y,E,Σ,Π) consists of a bipartite graph with vertex set XY and edge set E, together with a finite alphabet Σ, and a set of constraints Π={Πe:eE}. Each constraint is a function Πe:ΣΣ.

A labelling of XY is a function λ:XYΣ which assigns a label to each vertex. For xX, yY, a constraint Π(x,y) is satisfied if Π(x,y)(λ(x))=λ(y).

We denote by OPT(Φ) the maximum fraction of constraints in Φ which can be satisfied by any labelling. An instance of the promise problem GapLabel-Cover1,γ(Σ) consists of a label-cover instance Φ with alphabet Σ, together with the guarantee that either OPT(Φ)=1 or OPT(Φ)<γ. Here, γ is a positive constant close to 0. The following is a seminal result in the theory of hardness of approximation.

Theorem 8.

For any constant γ>0, there exists a sufficiently large constant |Σ| (dependent only on γ) such that GapLabel-Cover1,γ(Σ) is NP-hard.

Arora and Lund [4] describe a reduction from 3-SAT which, together with Raz’s Parallel Repetition Theorem [22], implies that Theorem 8 remains true even on instances where the underlying graph is regular. Moreover, we may take the degree to be at least any arbitrarily large constant by creating many copies of our graph XY and adding a copy of the constraint Π(x,y) between every copy of x and every copy of y. Note that in such an instance |X|=|Y|. We use a gap-preserving reduction from label-cover to prove Theorem 1.

3.1 Construction

Our reduction maps a label cover instance Φ=(X,Y,E,Σ,Π), where the base graph has degree d, to a token swapping instance K(Φ)=(G,T,f1,f2).

We construct G by building a gadget Gad(v) for each vXY as follows. Our construction for Gad(v) starts with a base vertex bas(v). We add d additional vertices adjacent to bas(v), which we call assignment vertices (recall that d is the degree in the label-cover instance). To each assignment vertex in Gad(v) we identify a unique edge (v,w)E (where E is the label cover edge set) incident to v; we call this assignment vertex asg(v,w). We then create |Σ| paths, each with bas(v) as an endpoint. We call these paths label paths. If vX, then each label path in Gad(v) contains d1 edges; if vY, then each label path in Gad(v) contains 2d1 edges. To each label path in Gad(v) we associate a unique σΣ, and denote this label path by lab(v,σ).

If vX, then we call Gad(v) a left gadget; otherwise, we call Gad(v) a right gadget. We call an assignment vertex a left (resp. right) assignment vertex if it is in a left (resp. right) gadget. We denote the set of left gadgets by L and the set of right gadgets by R.

Whenever it is the case that the label pair (σx,σy) satisfies the constraint Π(x,y), we add a path of d edges connecting the endpoint of lab(x,σx) opposite bas(x) with the endpoint of lab(y,σy) opposite bas(y). We call such a path a satisfaction path, and denote it by sat(x,σx,y,σy).

Refer to caption

Figure 1: A left and right gadget, joined by a satisfaction path; d=5, |Σ|=3.

This gives our construction for G. An illustration of a left and right gadget connected by a satisfaction path given in Figure 1. We construct f1 and f2 as follows. For each (x,y)E, the tokens on asg(x,y) and asg(y,x) wish to swap positions with each other. That is, f2(f11(asg(x,y)))=asg(y,x), and f2(f11(asg(y,x)))=asg(x,y).

We will refer to such a token as an assignment token. We will call an assignment token t where f1(t) is a left (resp. right) assignment vertex a left (resp. right) assignment token. For tT that are not assignment tokens, f1(t)=f2(t). That is, t does not wish to move from its starting position.

The intuition behind the reduction is as follows: if there is a labelling λ satisfying every constraint in Π, then all the assignment tokens that start in Gad(v) can move to their destination along the single label path associated with λ(v). Then, any assignment token seeking to enter Gad(v) can travel along this path, and will in the process swap with many of the assignment tokens leaving Gad(v), bringing them closer to their destination. If, on the other hand, no good labelling exists, then having so many efficient swaps becomes impossible.

We prove the following lemma.

Lemma 9.

Let Φ=(X,Y,Σ,Π) be a label-cover instance whose graph is d-regular. The following two claims hold:

  • If OPT(Φ)=1, then OPT(K(Φ))(134d2+d)|XY|.

  • If OPT(Φ)<γ, then OPT(K(Φ))>(7γ2d25d)|XY|.

Given a label-cover instance Φ, the token swapping instance K(Φ) can be computed in polynomial time. We set d to be a large constant and γ a small constant, and the hardness result of Theorem 1 follows from Lemma 9. In Section 3.2, we briefly discuss the proof of the first half of Lemma 9 (completeness), with a proof given in the full version. In Section 3.3, we prove the second half (soundness).

3.2 Completeness

Let Φ be a label-cover instance as defined in Lemma 9 such that OPT(Φ)=1. We prove the first half of Lemma 9 by providing a swap sequence for K(Φ) using (134d2+d)|XY| swaps. We describe the procedure in detail, and prove the first half of Lemma 9 in the full version.

3.3 Soundness

In this section, we will prove the second half of Lemma 9: if OPT(Φ)<γ, then OPT(K(Φ))>(7γ2d25d)|XY|.

Let Φ be a label-cover instance such that OPT(Φ)<γ, and let SOPT denote the optimal sequence of swaps on K(Φ). For a token tT, consider the subsequence of SOPT in which t is one of the tokens being swapped. This subsequence traces out a walk in G. Consider the path from f1(t) to f2(t) obtained by removing all the closed sub-walks from this walk. We denote this path Swap(t).

We now partition the assignment tokens into two types: detour tokens and non-detour (assignment) tokens.

Definition 10 (Detour token).

A token t is a detour token if:

  • f1(t) is an assignment vertex.

  • Swap(t) has more than 4d edges.

We will refer to all other assignment tokens as non-detour tokens. This allows us to introduce the following notation: detL (resp. detR) is the number of detour tokens t such that f1(t) is a left (resp. right) assignment vertex. We will denote by Det the set of detour tokens, and Ndet the set of non-detour tokens.

We obtain lower bounds on two quantities: Bsat, the number of swaps occurring within satisfaction paths, and BGad, the number of swaps occurring within gadgets.

Bsat (d23d)|XY|+d2(detL+detR) (1)
BGad >(5γ2d22d)|XY|d2(detL+detR) (2)

Combining these inequalities proves the second half of Lemma 9.

3.3.1 Swaps on satisfaction paths

First, we prove inequality 1.

Observation 11.

If t is a detour token, then Swap(t) contains at least three satisfaction paths as subpaths.

Observation 11 follows from the construction of G; any path of length greater than 4d with a left assignment vertex and a right assignment vertex as endpoints traverses at least three satisfaction paths. Therefore, we can associate to each detour token t a sequence of at least three satisfaction paths. We refer to the path(s) in this sequence which are not the first or last path as the intermediate path(s) of t. Each detour token has at least one intermediate path.

Claim 12.

SOPT contains at least d2(detL+detR) swaps where at least one token is a detour token visiting one of its intermediate paths.

Proof.

There are detL+detR detour tokens, each of which participates in at least d swaps on intermediate paths. Each swap involves at most 2 tokens, hence the bound of d2(detL+detR).

Furthermore, let ext(t) denote the number of swaps that t participates in on satisfaction paths that are not intermediate paths. For tDet, ext(t)2d. For tNdet, ext(t)d. Unfortunately, we cannot simply add these quantities together to obtain a lower bound on the number of swaps on satisfaction paths. This is because a swap may be between two different assignment tokens, so adding these quantities would risk double-counting. However, we can obtain an upper-bound on the amount of double-counting that can take place, using the following definition.

Definition 13 (Efficient satisfaction swap).

A swap between assignment tokens t1 and t2 is an efficient satisfaction swap if one of the following is the case:

  1. 1.

    neither t1 nor t2 is a detour token,

  2. 2.

    one of t1 or t2 is not a detour token, the other is a detour token not on an intermediate path, and the swap is contained in Swap(t), where t is the detour token, or

  3. 3.

    t1 and t2 are detour tokens, neither is on an intermediate path, and the swap is contained in Swap(t), where t is t1 or t2.

Let ksat denote the number of efficient satisfaction swaps in SOPT. Combining Definition 13 with Claim 12, we obtain the following inequality:

Bsatd2(detL+detR)+tDetext(t)+tNdetext(t)ksat

which implies that

Bsatd2(detL+detR)+2d(detL+detR)+d(d|XY|(detL+detR))ksat. (3)

We give an upper bound on ksat. We do so by proving individual upper bounds on each of the three types of efficient satisfaction swaps outlined in Definition 13.

Swaps of type 1: neither t1 not t2 is a detour token. Because the label-cover graph is simple, each edge (x,y)E is mapped by our reduction to a unique pair of assignment vertices, those being asg(x,y) and asg(y,x). Therefore, any satisfaction path sat(x,σx,y,σy) is traversed by at most two non-detour assignment tokens, those being f11(asg(x,y)) and f11(asg(y,x)). It follows that any non-detour token can swap on a satisfaction path with at most one other non-detour token Because there are d|XY|(detL+detR) non-detour assignment tokens, we obtain the following upper bound on swaps of type 1:

12(d|XY|(detL+detR)).

Swaps of type 2: one of t1 or t2 is not a detour token, and the other is a detour token not on an intermediate path. Again, any satisfaction path sat(x,σx,y,σy) is traversed by at most two non-detour assignment tokens, those being f11(asg(x,y)) and f11(asg(y,x)). A detour token moving across sat(x,σx,y,σy) can swap with only one, depending on the direction in which it is moving. Because each detour token traverses exactly two non-intermediate satisfaction paths, the number of swaps of type 2 is at most:

2(detL+detR)

Swaps of type 3: t1 and t2 are detour tokens, but neither is on an intermediate path. Each detour token participates in at most a combined 2d swaps on the first and last satisfaction paths that it visits. Each of these swaps involves at most 2 such tokens, implying that the number of swaps of type 3 is at most:

d(detL+detR).

Combining these bounds with inequality 3, we are left with the following lower bound on Bsat:

Bsat d2(detL+detR)+d(d|XY|(detL+detR))+2d(detL+detR)
12(d|XY|(detL+detR))2(detL+detR)d(detL+detR)
=d2|XY|+3d2(detL+detR)d2|XY|(d+52)(detL+detR)
=(d2d2)|XY|+(d52)(detL+detR)
(d23d)|XY|+d2(detL+detR)

as desired.

3.3.2 Swaps on gadgets

Next, we prove inequality 2:

BGad>(5γ2d22d)|XY|d2(detL+detR).

Any assignment token t participates in at least 3d2 swaps within label paths: d1 swaps on a left label path and 2d1 swaps on a right label path. Moreover, we can identify the two label paths, one in a left gadget and one in a right gadget, which come at either end of Swap(t). We refer to these paths as the first and last legs of t. Note that the first leg of t comes in the gadget containing t’s start vertex, and the last leg comes in the gadget containing t’s target vertex.

A swap which corresponds to an edge in the first leg of one token t1 and the last leg of another token t2 we will call an efficient gadget swap. Note that such a swap appears in both Swap(t1) and Swap(t2). We denote the number of efficient gadget swaps in SOPT by kGad, and we denote the number of efficient gadget swaps occurring within the gadget Gad(v) by kGad(v). We observe that

BGad(3d22d)|XY|kGad (4)

and we seek an upper bound on kGad accordingly.

To this end, we define the outflow of a label path p to be the number of tokens whose first leg is p, and the inflow of p to be the number of tokens whose last leg is p. For Gad(v)LR, we call the label path in Gad(v) with the maximum outflow (resp. inflow) the out-dominant (resp. in-dominant) label path of Gad(v). We denote by out(Gad(v)) (resp. in(Gad(v))) the outflow (resp. inflow) of the out-dominant (resp. in-dominant) label path in Gad(v). We obtain two inequalities.

Claim 14.

For any gadget Gad(v),

  • kGad(v)d(out(Gad(v)))

  • kGad(v)d(in(Gad(v))).

Proof.

We prove the first inequality. Let tT be an assignment token. Suppose f2(t) is in Gad(v). Then t participates in at most out(Gad(v)) efficient gadget swaps on Gad(v), as at most out(Gad(v)) such swaps can occur on the label path taken by t. There are d tokens t where f2(t) is an assignment vertex in Gad(v), hence the bound of d(out(Gad(v))). The proof of the second inequality is symmetric.

Claim 15.

If OPT(Φ)<γ, then

xXout(Gad(x))+yYin(Gad(y)) <(1+γ2)d|XY|+detL
xXin(Gad(x))+yYout(Gad(y)) <(1+γ2)d|XY|+detR
Proof.

We prove the first half of the claim; the proof of the second half is symmetric. Suppose for contradiction the first inequality does not hold. The left side of the inequality counts two quantities: (a) the total outflow from the out-dominant label path of each left gadget, plus (b) the total inflow to the in-dominant label path of each right gadget. Each left assignment token can contribute at most 1 to (a) and at most 1 to (b). Because d|XY| is the total number of assignment tokens and the graph is regular (so |X|=|Y|), there are exactly (d/2)|XY| left assignment tokens. As a result, even if the maximum number of left assignment tokens are contributing to only one of (a) or (b), at least γ2(d|XY|)+detL contribute to both. Therefore, there are at least γ2(d|XY|) non-detour tokens starting in left gadgets which have an out-dominant label path as a first leg and an in-dominant label path as a last leg. Let t be such a token. Because t is a non-detour token, there is a satisfaction path between t’s first and last legs. By our construction, the constraint in the label cover instance associated with t is satisfied by the labelling corresponding to t’s first and last legs. Consider a labelling of Φ which assigns to xX the label corresponding to the out-dominant label path of Gad(x), and to yY the label corresponding to the in-dominant label path of Gad(y). There are at least γ|E| constraints satisfied by this labelling, which is a contradiction. We average the inequalities in Claim 14 and rearrange some terms to obtain the new bound for any Gad(v):

kGad(v)dout(Gad(v))+in(Gad(v))2

and we average the two inequalities in Claim 15 to obtain

vXYout(Gad(v))+in(Gad(v))2<(1+γ2)d|XY|+detL+detR2.

Combining these bounds, we arrive at the following inequality:

vXYkGad(v)d<1+γ2d|XY|+detL+detR2

which implies

kGad<1+γ2d2|XY|+d2(detL+detR)

which, combined with inequality 4:

BGad(3d22d)|XY|kGad

implies inequality 2:

BGad>(5γ2d22d)|XY|d2(detL+detR).

4 Hardness for 0/1-Weighted Token Swapping

We prove the following theorem: See 2 We proceed via a reduction from the Set Cover problem, defined below.

Definition 16 (Set Cover).

An instance of Set-Cover Φ=(U,{Si}1ik) consists of a finite universe set U, together with subsets S1,,SkU. We seek to find the size of the smallest collection of subsets in {S1,,Sk} so that each element of U is in at least one subset.

Dinur and Steurer [13] prove the following theorem:

Theorem 17.

For any constant δ>0, it is NP-hard to approximate Set Cover within a factor of (1δ)ln(|U|+k).

We give a gap-preserving reduction from Set Cover to Weighted Token Swapping. We describe the reduction in the full version, proving the desired lower-bound.

5 Additional barriers to improved algorithms

In this section, we discuss two barriers to obtaining a (4ϵ)-approximation for unweighted token swapping on graphs. The first barrier (Theorem 3 is against a broad class of algorithms that encompasses all known approximation algorithms for token swapping. The second barrier (Theorem 4) shows that the technique used to prove approximation factors for existing algorithms cannot be used to prove an approximation factor of 4ϵ for any ϵ>0. The proof of Theorem 4 is given in the full version of the paper.

5.1 A barrier against a general class of algorithms

We define the following property for swap sequences on a Token Swapping instance.

Definition 18 (Local Optimality).

A swap sequence is locally optimal if every swap between tokens t1 and t2 does not move both t1 and t2 further from their destinations.

All known algorithms for token swapping on trees or on general graphs work by returning the length of a swap sequence that is locally optimal.

See 3 We construct a token swapping instance K as follows. See Figure 2. Let p and q be parameters to be decided later. We can assume p is even. We begin with a cycle Cout of length pq. Starting with an arbitrary vertex, we label the vertices v0,,vpq1 in one direction (say, clockwise) around the cycle. We partition the vertices of Cout into p consecutive “segments”. For any 0ip1, the vertices {viq,,viq+(q1)} form the i-th segment. If i is even, we call such a segment an even segment; else it is an odd segment. For any j so that vj is in an even segment, the token starting on vj has target vertex vj+2q(modpq). If vj is in an odd segment, the token starting on vj has target vertex vj2q(modpq). That is, each token in an even segment wants to move to the corresponding vertex in the next even segment in the clockwise direction, while each token in an odd segment wants to move to the next odd segment over in the counter-clockwise direction. For each 0jpq, we add a path Pj of 2q2 edges between vj and vj+2q. All the vertices on this path (except the endpoints in Cout) wish to stay on their start vertices. We call these paths inner paths. We call the vertices in Cout outer vertices, and all other vertices inner vertices. Tokens that begin on outer vertices (which also have destinations on outer vertices) we call outer tokens; other tokens are inner tokens. Outer tokens with start and target vertices in even segments we will call even tokens; other outer tokens we will call odd tokens. Note that each outer token begins on a vertex connected to its target vertex by an inner cycle. The outer cycle, together with a single inner cycle, is depicted in Figure 2.

Refer to caption

Figure 2: An (incomplete) graph for a token swapping instance where p=8, q=4. The diagram depicts the outer cycle and one inner cycle, but leaves out the remaining inner cycles for legibility. In the outer cycle, vertices in even segments are colored blue, while those in odd segments are colored black. The token starting on v0 has target v8, the token starting on v8 has target v16, the token starting on v16 has target v24, and the token starting on v24 has target v0.
Claim 19.

OPT(K)pq2.

Proof.

Here is a swap sequence bringing every token to its destination vertex:

  1. 1.

    For j=0,,pq1:

    1. (a)

      If f11(vj) is an odd token, bubble it counter-clockwise around Cout across q edges.

  2. 2.

    Again, for j=0,,pq1:

    1. (a)

      If f11(vj) is an odd token, bubble it counter-clockwise around Cout across q edges.

We check that the above swap sequence brings every token to its target vertex. No swap occurs on an edge in an inner cycle, so none of the inner tokens are displaced. Suppose f1(vj) (the token starting on vj) is an odd outer token. It is not difficult to see that when f1(vj) is bubbled q edges counter-clockwise, it only swaps with even tokens (this is because any odd token from the same segment was already bubbled q edges counter-clockwise during a previous iteration). Thus, each odd token is bubbled counter-clockwise 2q times, and each even token is bubbled clockwise 2q times. This brings every token to its target node.

Claim 20.

Let S be the shortest locally optimal swap sequence bringing every token to its destination, and let k be the length of S. Then 4pq25pq8q2k.

We observe that for 0j2q1, the inner paths Pj,Pj+2q,Pj+4q,,Pj+q(p1) form a cycle, which we will call the j-th inner cycle, denoted Cjin. Moreover, every token begins on a vertex in the same inner cycle as its target vertex. Claim 20 will follow from the next two claims.

Claim 21.

Let a,bV be in the same inner cycle Cjin, and let Pa,b be a path from a to b containing at least one edge not in Cjin. Then dist(a,b)+2|Pa,b|, where |Pa,b| is the number of edges in Pa,b.

Proof.

We will prove the claim in two steps. First, we will modify Pa,b to obtain a path Pa,b which is the same length as Pa,b and which does not contain any edges from inner cycles other than Cjin, but which contains at least one edge from Cout. Then, we will show that any path from a to b which contains edges from (and only from) both Cjin and Cout has length at least dist(a,b)+2.

Suppose Pa,b contains edges outside of Cjin. If Pa,b does not contain edges from a different inner cycle, then we set Pa,b to Pa,b and move on to the argument in the next paragraph. Otherwise, Pa,b contains an edge e from a different inner cycle. Let be such that Cin is the inner cycle containing e. Suppose e is, in particular, the first edge to appear in Pa,b which is in an inner cycle other than Cjin. Therefore, e is incident to a vertex v so that (mod2q), and e is contained in either P or P2q. We can assume by symmetry that e is contained in P. Because Pa,b is a shortest path, it is simple. By the construction of the graph then, Pa,b contains the entirety of P. Let vj be the last vertex in Cjin preceding v in Pa,b. Because e is incident to an outer vertex, the path between vj and v only has edges in Cout. The length of the sub-path of Pa,b from the appearance of vj to v+2q is then |j|+2q2. We replace this sub-path with the following path: the shortest path in Cjin from vj to vj+2q, then the shortest path in Cout from vj+2q to v+2q. The length of this path is at most |j|+2q2, so we have not increased the length of Pa,b, but we have decreased the number of edges from an inner cycle other than Cjin. We repeat this procedure until we obtain a path Pa,b which does not contain any edges from inner cycles other than Cjin.

We have a simple path Pa,b which contains edges only from Cjin and Cout, and at least one edge from Cout. Then there exists a consecutive sub-path in Pa,b of edges from Cout of length 2q, as this is the number of edges needed to go from one vertex in Cjin to another while traversing Cout. However, this sub-path can be replaced by the sub-path of length 2q2 between its endpoints using only edges from Cjin. Therefore, dist(a,b)+2|Pa,b|=|Pa,b|. For a,b in Cjin, and for c not in Cjin which is a neighbor of a, it is the case that dist(a,b)<dist(c,b). Otherwise, there would be a path from a to b containing the edge (a,c) of length at most dist(a,b)+1, even though (a,c) is not in Cjin, which contradicts Claim 21. Because each token starts in the same inner cycle as its target vertex, this implies that any swap across an edge in Cout is not locally optimal. We proceed by proving a lower bound on the number of swaps needed to bring all the tokens in Cjin to their target vertex without leaving Cjin.

Claim 22.

For any j, the number of swaps needed to bring all of the tokens on Cjin to their target vertices while swapping only along edges in Cjin is greater than 2pq5p/24q.

Proof.

Suppose without loss of generality that vj is in an even segment; by our construction, all the other outer vertices in Cjin are also in even segments. Moreover, each outer vertex in Cjin begins with a token which wants to move to the closest outer vertex in Cjin in the clockwise direction, of distance 2q2 away. All inner tokens want to stay on their start vertices. Note that Cjin has length p(q1), and contains p/2 outer vertices.

In a given swap, one token in Cjin is moved clockwise, and the other counter-clockwise. For a token t, let clock(t) be the number of swaps in the optimal swap sequence on Cjin in which t is moved clockwise, and counter(t) the number of times its moved counter-clockwise.

Let tin be an inner token in Cjin. Because tin has the same start and target, clock(tin)counter(tin)0(modp(q1)). If tout is an outer vertex in Cjin, then clock(tout)counter(tout)2q2(modp(q1)). Because each swap moves one token clockwise and one token counter-clockwise, tinCjinclock(tin)counter(tin)=0. It follows there is a token tcounterCinj where counter(tcounter)>clock(tcounter) (else, each token in Cinj would end on its start vertex). By our construction, the distance from tcounter’s start vertex to its target in the counter-clockwise direction is at least p(q1)2q+2, so counter(tcounter)clock(tcounter)p(q1)2q+2.

If there is an additional token tcounter so that p(q1)2q+2counter(t), then there are at least 2(p(q1)2q)>2pq5p/24q swaps in the optimal swap sequence, as desired. Otherwise, there are at least p/21 outer tokens in Cjin which are not moved counter-clockwise at least p(q1)2q times. Each is involved in at least 2q2 swaps where it is the token being moved clockwise. Moreover, at most 1 of these swaps is with tcounter, because if a pair of tokens swap at least twice, then both swaps can be removed to yield an equivalent swap sequence. This results in a total of at least

(p/21)(2q3)+counter(tcounter) (p/21)(2q3)+p(q1)2q
>2pq5p/24q

swaps, as desired. Because there are 2q inner cycles, the total number of swaps taken by a sequence with only locally optimal swaps is at least 2q(2pq5p/24q)=4pq25pq8q2, proving Claim 20. We set p,q to be large enough so that 4pq2 overtakes the smaller-order terms, so that for the parameter δ,

4δ<(4pq25pq8q2)/pq2<4.

This proves Theorem 3.

References

  • [1] Oswin Aichholzer, Erik D. Demaine, Matias Korman, Anna Lubiw, Jayson Lynch, Zuzana Masárová, Mikhail Rudoy, Virginia Vassilevska Williams, and Nicole Wein. Hardness of token swapping on trees. In 30th annual European Symposium on Algorithms, volume 244 of LIPIcs. Leibniz Int. Proc. Inform., pages Art. No. 3, 15. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2022. doi:10.4230/LIPIcs.ESA.2022.3.
  • [2] S.B. Akers and B. Krishnamurthy. A group-theoretic model for symmetric interconnection networks. IEEE Transactions on Computers, 38(4):555–566, 1989. doi:10.1109/12.21148.
  • [3] Noga Alon, F. R. K. Chung, and R. L. Graham. Routing permutations on graphs via matchings. SIAM J. Discrete Math., 7(3):513–530, 1994. doi:10.1137/S0895480192236628.
  • [4] Sanjeev Arora and Carsten Lund. Hardness of approximation. In Dorit S. Hochbaum, editor, Approximation Algorithms for NP-Hard Problems, chapter 10, pages 399–446. PWS Publishing, Boston, 2004.
  • [5] Avah Banerjee, Xin Liang, and Rod Tohid. Locality-aware qubit routing for the grid architecture. In 2022 IEEE International Parallel and Distributed Processing Symposium Workshops (IPDPSW), pages 607–613. IEEE, 2022.
  • [6] Indranil Banerjee and Dana Richards. New results on routing via matchings on graphs. In Fundamentals of computation theory, volume 10472 of Lecture Notes in Comput. Sci., pages 69–81. Springer, Berlin, 2017. doi:10.1007/978-3-662-55751-8_7.
  • [7] Aniruddha Bapat, Andrew M Childs, Alexey V Gorshkov, and Eddie Schoute. Advantages and limitations of quantum routing. PRX Quantum, 4(1):010313, 2023.
  • [8] Ahmad Biniaz, Kshitij Jain, Anna Lubiw, Zuzana Masárová, Tillmann Miltzow, Debajyoti Mondal, Anurag Murty Naredla, Josef Tkadlec, and Alexi Turcotte. Token swapping on trees. Discrete Math. Theor. Comput. Sci., 24(2):Paper No. 9, 37, 2022. doi:10.46298/DMTCS.8383.
  • [9] Édouard Bonnet, Tillmann Miltzow, and Paweł Rzążewski. Complexity of token swapping and its variants. Algorithmica, 80(9):2656–2682, 2018. doi:10.1007/s00453-017-0387-0.
  • [10] Arthur Cayley. Lxxvii. note on the theory of permutations. The London, Edinburgh, and Dublin Philosophical Magazine and Journal of Science, 34(232):527–529, 1849.
  • [11] Andrew M. Childs, Eddie Schoute, and Cem M. Unsal. Circuit transformations for quantum architectures. In 14th Conference on the Theory of Quantum Computation, Communication and Cryptography, volume 135 of LIPIcs. Leibniz Int. Proc. Inform., pages Art. No. 3, 24. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2019.
  • [12] Erik D. Demaine, Sándor P. Fekete, Phillip Keldenich, Henk Meijer, and Christian Scheffer. Coordinated motion planning: reconfiguring a swarm of labeled robots with bounded stretch. SIAM J. Comput., 48(6):1727–1762, 2019. doi:10.1137/18M1194341.
  • [13] Irit Dinur and David Steurer. Analytical approach to parallel repetition. In Proceedings of the Forty-Sixth Annual ACM Symposium on Theory of Computing, STOC ’14, pages 624–633, New York, NY, USA, 2014. Association for Computing Machinery. doi:10.1145/2591796.2591884.
  • [14] Laurent Gourvès, Julien Lesca, and Anaëlle Wilczynski. Object allocation via swaps along a social network. In 26th International Joint Conference on Artificial Intelligence (IJCAI’17), pages 213–219, 2017. doi:10.24963/IJCAI.2017/31.
  • [15] Takehiro Ito, Naonori Kakimura, Naoyuki Kamiyama, Yusuke Kobayashi, and Yoshio Okamoto. Algorithmic theory of qubit routing. In Algorithms and data structures, volume 14079 of Lecture Notes in Comput. Sci., pages 533–546. Springer, Cham, 2023. doi:10.1007/978-3-031-38906-1_35.
  • [16] Mark R. Jerrum. The complexity of finding minimum-length generator sequences. Theoret. Comput. Sci., 36(2-3):265–289, 1985. doi:10.1016/0304-3975(85)90047-7.
  • [17] Jun Kawahara, Toshiki Saitoh, and Ryo Yoshinaka. The time complexity of permutation routing via matching, token swapping and a variant. J. Graph Algorithms Appl., 23(1):29–70, 2019. doi:10.7155/jgaa.00483.
  • [18] Tillmann Miltzow, Lothar Narins, Yoshio Okamoto, Günter Rote, Antonis Thomas, and Takeaki Uno. Approximation and hardness of token swapping. In 24th Annual European Symposium on Algorithms (ESA), volume 57 of LIPIcs. Leibniz Int. Proc. Inform., pages Art. No. 66, 15. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2016.
  • [19] Abtin Molavi, Amanda Xu, Martin Diges, Lauren Pick, Swamit Tannu, and Aws Albarghouthi. Qubit mapping and routing via maxsat. In 2022 55th IEEE/ACM international symposium on Microarchitecture (MICRO), pages 1078–1091. IEEE, 2022. doi:10.1109/MICRO56248.2022.00077.
  • [20] Igor Pak. Reduced decompositions of permutations in terms of star transpositions, generalized Catalan numbers and k-ary trees. Discrete Math., 204(1-3):329–335, 1999. doi:10.1016/S0012-365X(98)00377-X.
  • [21] Frederick J Portier and Theresa P Vaughan. Whitney numbers of the second kind for the star poset. European Journal of Combinatorics, 11(3):277–288, 1990. doi:10.1016/S0195-6698(13)80127-8.
  • [22] Ran Raz. A parallel repetition theorem. SIAM Journal on Computing, 27(3):763–803, 1998. doi:10.1137/S0097539795280895.
  • [23] Bruno Schmitt, Mathias Soeken, and Giovanni De Micheli. Symbolic algorithms for token swapping. In 2020 IEEE 50th International Symposium on Multiple-Valued Logic—ISMVL 2020, pages 28–33. IEEE Computer Soc., Los Alamitos, CA, 2020. doi:10.1109/ISMVL49045.2020.00-34.
  • [24] Asim Sharma and Avah Banerjee. Noise-aware token swapping for qubit routing. In 2023 IEEE International Conference on Quantum Computing and Engineering (QCE), volume 1, pages 82–88. IEEE, 2023. doi:10.1109/QCE57702.2023.00018.
  • [25] Zhizhang Shen and Ke Qiu. On the Whitney numbers of the second kind for the star poset: comment on [European J. Combin. 11 (1990), no. 3, 277–288; mr1059558] by F. J. Portier and T. P. Vaughan. European J. Combin., 29(7):1585–1586, 2008. doi:10.1016/j.ejc.2007.11.026.
  • [26] Marcos Yukio Siraichi, Vinícius Fernandes dos Santos, Caroline Collange, and Fernando Magno Quintão Pereira. Qubit allocation as a combination of subgraph isomorphism and token swapping. Proceedings of the ACM on Programming Languages, 3(OOPSLA):1–29, 2019. doi:10.1145/3360546.
  • [27] Pavel Surynek. Finding optimal solutions to token swapping by conflict-based search and reduction to sat. In 2018 IEEE 30th International Conference on Tools with Artificial Intelligence (ICTAI), pages 592–599. IEEE, 2018. doi:10.1109/ICTAI.2018.00096.
  • [28] Pavel Surynek. Multi-agent path finding with generalized conflicts: An experimental study. In International Conference on Agents and Artificial Intelligence, pages 118–142. Springer, 2019. doi:10.1007/978-3-030-37494-5_7.
  • [29] Caio Henrique Segawa Tonetti, Vinicius Fernandes dos Santos, and Sebastián Urrutia. Polynomial time algorithms for the token swapping problem on cographs. RAIRO Oper. Res., 58(1):441–455, 2024. doi:10.1051/ro/2023134.
  • [30] Theresa P. Vaughan. Bounds for the rank of a permutation on a tree. J. Combin. Math. Combin. Comput., 10:65–81, 1991.
  • [31] Theresa P. Vaughan. Factoring a permutation on a broom. J. Combin. Math. Combin. Comput., 30:129–148, 1999.
  • [32] Theresa P. Vaughan and Frederick J. Portier. An algorithm for the factorization of permutations on a tree. J. Combin. Math. Combin. Comput., 18:11–31, 1995.
  • [33] Friedrich Wagner, Andreas Bärmann, Frauke Liers, and Markus Weissenbäck. Improving quantum computation by optimized qubit routing. J. Optim. Theory Appl., 197(3):1161–1194, 2023. doi:10.1007/s10957-023-02229-w.
  • [34] Katsuhisa Yamanaka, Erik D. Demaine, Takashi Horiyama, Akitoshi Kawamura, Shin-ichi Nakano, Yoshio Okamoto, Toshiki Saitoh, Akira Suzuki, Ryuhei Uehara, and Takeaki Uno. Sequentially swapping colored tokens on graphs. J. Graph Algorithms Appl., 23(1):3–27, 2019. doi:10.7155/jgaa.00482.
  • [35] Katsuhisa Yamanaka, Erik D. Demaine, Takehiro Ito, Jun Kawahara, Masashi Kiyomi, Yoshio Okamoto, Toshiki Saitoh, Akira Suzuki, Kei Uchizawa, and Takeaki Uno. Swapping labeled tokens on graphs. Theoret. Comput. Sci., 586:81–94, 2015. doi:10.1016/J.TCS.2015.01.052.
  • [36] Gaku Yasui, Kouta Abe, Katsuhisa Yamanaka, and Takashi Hirayama. Swapping labeled tokens on complete split graphs. Inf. Process. Soc. Japan. SIG Tech. Rep, 14:1–4, 2015.
  • [37] Louxin Zhang. Optimal bounds for matching routing on trees. SIAM J. Discrete Math., 12(1):64–77, 1999. doi:10.1137/S0895480197323159.