Rotor-routing reachability is easy, chip-firing reachability is hard
aa r X i v : . [ m a t h . C O ] F e b Rotor-routing reachability is easy, chip-firingreachability is hard
Lilla T´othm´er´esz a,1 a MTA-ELTE Egerv´ary Research Group, P´azm´any P´eter s´et´any 1/C, Budapest, Hungary
Abstract
Chip-firing and rotor-routing are two well-studied examples of Abelian net-works. We study the complexity of their respective reachability problems.We show that the rotor-routing reachability problem is decidable in polyno-mial time, and we give a simple characterization of when a chip-and-rotorconfiguration is reachable from another one. For chip-firing, it has beenknown that the reachability problem is in P if we have a class of graphswhose period length is polynomial (for example, Eulerian digraphs). Herewe show that in the general case, chip-firing reachability is hard in the sensethat if the chip-firing reachability problem were in P for general digraphs,then the polynomial hierarchy would collapse to NP . Keywords: chip-firing, rotor-routing, reachability, computationalcomplexity
1. Introduction
Chip-firing and rotor-routing are two well-studied examples of Abeliannetworks. Abelian networks are asynchronous networks of processors thatsit in the vertices of a digraph and communicate through the edges. Theyare called “Abelian” because the final state of the network does not dependon the order in which different processors process their input data. For anintroduction to Abelian networks, see [4].
Email address: [email protected] (Lilla T´othm´er´esz) LT was supported by the National Research, Development and Innovation Office ofHungary – NKFIH, grant no. 132488. LT was partially supported by the Counting inSparse Graphs Lend¨ulet Research Group of R´enyi Institute.
1n this paper, we study the complexity of the reachability problem of chip-firing and rotor-routing. Previously, the chip-firing reachability problem wasshown to be in co − NP [8], and in the special case of polynomial periodlength (which includes for example Eulerian digraphs), it was shown to be in P [8, 12]. Here we show that in general the chip-firing reachability problemis hard: if it were solvable in polynomial time, then the polynomial hierarchywould collapse to NP . (See Theorem 2.3.) To show this, we use the NP -hardness of the related chip-firing halting problem, which was proved in [5].For rotor-routing, reachability was known to be in P in the special casewhen the target configuration is recurrent [13]. Here we show that rotor-routing reachability is also decidable in polynomial time in the general case,and we give a combinatorial characterization for the reachability. (See The-orem 3.3.) We note that, similarly to the case of chip-firing on Euleriandigraphs, it remains open whether one can determine the stopping configu-ration of a bounded rotor-routing game in polynomial time. Throughout this paper, G will denote a directed graph with vertex set V ( G ) and edge set E ( G ). We allow multiple edges, but no loops. We denoteby deg + ( v ) the out-degree of vertex v , and by d ( u, v ) the number of edgespointing from u to v . When G is an input to some algorithm, we alwaysencode it by its adjacency matrix. This means that for each u, v ∈ V ( G ), wewrite down the number d ( u, v ). Hence | E ( G ) | might be exponential in theinput size, but log | E ( G ) | is always polynomial.A digraph is said to be strongly connected if for each u, v ∈ V ( G ) thereis a directed path leading from u to v . Each digraph has a unique decom-position into strongly connected components. A component is called a sinkcomponent , if there is no edge leaving the component. Note that a digraphalways has at least one sink-component. A vertex is called a sink if itsout-degree is zero. In this case, it is a one-element sink component.We denote by Z V ( G ) the set of integer vectors whose coordinates are in-dexed by the vertices of G . Z V ( G ) ≥ denotes the set of vectors with nonnegativeinteger coordinates. For a vertex v , v denotes the vector where the coordi-nate of v is 1, and the rest of the coordinates are 0.Both for chip-firing and for rotor-routing, the Laplacian matrix of thegraph will play an important role. We denote the Laplacian matrix of the2igraph G by L G . This is the matrix with coordinates( L G ) uv = (cid:26) − deg + ( v ) if u = v , d ( v, u ) if u = v. p ∈ Z V ( G ) ≥ will be called a period vector for G if L G p = 0. A non-zero periodvector is called primitive if its entries have no non-trivial common divisor.The following is known. Proposition 1.1. [2, 3.1 and 4.1] For a strongly connected digraph G thereexists a unique primitive period vector p G , moreover, its coordinates are pos-itive. For a general digraph G , if G , . . . , G k are the sink components of G and a vector z ∈ Z V ( G ) satisfies Lz = 0 then z = P ki =1 λ i p i , where for i ∈ { , . . . , k } , λ i ∈ Z and p i is the primitive period vector of G i restrictedto V ( G i ) and zero elsewhere. For a strongly connected digraph G , let us denote the sum of the coordi-nates of p G by per( G ). For a general digraph G let per( G ) = P ℓi =1 per( G i )where G , . . . , G ℓ are the strongly connected components of G . Example 1.2.
It is easy to see that for a connected Eulerian digraph,the constant 1 vector is the primitive period vector, hence in this caseper( G ) = | V ( G ) | . However, in general per( G ) may be exponentially large(for an example see the class of digraphs constructed in the proof of Theo-rem 2 in [9]). Proposition 1.3.
The primitive period vectors of the strong components canbe computed in polynomial time.Proof.
By Tarjan’s algorithm [10], the strongly connected components, andhence the sink components can be computed in polynomial time. By [6,Theorem 1.4.21], we can compute in polynomial time an integer solution ˜ p i for L G i p = 0 where G . . . G k are the sink components. One can then computethe greatest common divisor of the coordinates for each ˜ p i and divide to get p i .
2. Chip-firing
In a chip-firing game we consider a digraph G with a pile of chips on eachof its nodes. A position of the game, called a chip configuration is described3y a vector x ∈ Z V ( G ) , where x ( v ) is interpreted as the number of chips onvertex v ∈ V ( G ), which might be negative.The basic move of the game is firing a vertex. It means that this vertexpasses a chip to its neighbors along each outgoing edge, and so its number ofchips decreases by its out-degree. In other words, firing a vertex v transformsthe chip configuration x to x + L G v .The firing of a vertex v ∈ V is legal with respect to a chip configuration x ,if v has a non-negative amount of chips after the firing (i.e. x ( v ) ≥ deg + ( v )).A legal game is a sequence of configurations in which each configuration isobtained from the previous one by a legal firing. For a legal game, let uscall the vector f ∈ Z V ( G ) ≥ , where f ( v ) equals the number of times v has beenfired, the firing vector of the game. A game terminates if no firing is legalwith respect to the last configuration. The most appealing property of thechip-firing game is the following “Abelian” property. Theorem 2.1. [3, Remark 2.4] From a given initial chip configuration, eitherevery legal game can be continued indefinitely, or every legal game terminatesafter finitely many steps. The firing vector of every maximal legal game isthe same.
In this section we will be interested in the complexity of the chip-firingreachability problem. We say that a chip configuration x is reachable froma chip configuration x if there is a legal game starting in x and ending in x . We denote this by x x .The reachability problem asks whether for chip configurations x and x on a digraph G we have x x . In the case if the period length of a graphclass is polynomial, the reachability problem is known to be in P . Theorem 2.2. [12, Theorem 2.3.13]. Let G be a digraph, and x and y chipconfigurations on G . There is an algorithm that decides whether x y , andhas a running time which is a polynomial of the input size and the periodlength of G . Here, we show that unless the polynomial hierarchy collapses to NP , therecannot be a polynomial algorithm for the reachability problem for generaldigraphs. Theorem 2.3.
Unless the polynomial hyerarchy collapses to NP , there isno polynomial algorithm that decides the chip-firing reachability problem onstrongly connected digraphs.
4o show this, we first show that deciding recurrence is easier than decidingreachability, then we show that deciding recurrence already has the abovementioned complexity.Let us call a chip configuration x recurrent if starting from x , there is anonempty legal game leading back to x . Claim 2.4.
If there were a polynomial algorithm for deciding the reachabilityproblem for strongly connected digraphs, then we could decide in polynomialtime whether a given chip configuration x on a strongly connected digraph isrecurrent. For this, we need a couple of definitions and lemmas.
Lemma 2.5. [2, Lemma 4.3] Let p be a period vector of a digraph G , andsuppose that α = ( v , v , . . . , v s ) is a legal sequence of firings on G from someinitial chip configuration. Let α ′ be the sequence obtained from α by deletingthe first p ( v ) occurrence of each vertex v (if v occurs less than p ( v ) times in α , then we delete all of its occurrences). Then α ′ is also a legal sequence offirings from the same initial configuration. For a given vector b ∈ Z V ( G ) ≥ , let us call the following game b -boundedchip-firing game : We are only allowed to make legal firings, and each vertex v can be fired at most b ( v ) times during the whole game. The b -boundedgame also has an “Abelian” property. Lemma 2.6. [2, Lemma 1.4] For a given bound b ∈ Z V ( G ) ≥ and initial chipconfiguration x , each maximal b -bounded chip-firing game with initial chipconfiguration x has the same firing vector.Proof of Claim 2.4. Since our digraph G is strongly connected, the primitiveperiod vector p G is unique. Hence by Lemma 2.5, x is recurrent if and only ifthere is a legal game with firing vector p G . By Lemma 2.6, this is equivalentto the fact that the maximal p G -bounded game started from x has firingvector p G .Check if there is any vertex v with x ( v ) ≥ deg + ( v ). If not, then x isstable, hence not recurrent. If yes, then choose such a vertex v and fire it.We show that x is recurrent if and only if x + L v x .Again by Lemmas 2.5 and 2.6, x + L v x is equivalent to the fact thatthe firing vector of the ( p G − v )-bounded game from initial configuration x + L v has firing vector p G − v . The claim now follows from the Abelianproperty of the p G -bounded game. 5e prove that if deciding whether a chip configuration on a stronglyconnected digraph is recurrent were in P then the polynomial hierarchy wouldcollapse to NP . By Claim 2.4, this implies Theorem 2.3.To prove our statement about the decision of recurrence, we need toexamine the chip-firing halting problem. The chip-firing halting problemasks whether for a given digraph G and chip configuration x , the game withinitial configuration x on the digraph G terminates after finitely many steps.By Theorem 2.1, this indeed depends only on x and G . Let us call a chipconfiguration x on a digraph G halting , if the chip-firing game started from x terminates after finitely many steps, and call it non-halting otherwise. Thehalting problem is known to be hard: Theorem 2.7. [5, Corollary 3.2] The chip-firing halting problem is NP -complete for strongly connected digraphs. We show the following.
Proposition 2.8.
If there were a polynomial algorithm deciding whether achip configuration on a strongly connected digraph is recurrent, then the chip-firing halting problem would be in co − NP for strongly connected digraphs. Before proving this statement, let us point out why it implies Theorem2.3.
Proof of Theorem 2.3.
By Claim 2.4 and Proposition 2.8, the existence of apolynomial algorithm for the reachability problem on strongly connected di-graphs would imply that the chip-firing halting problem would be in co − NP .By Theorem 2.7, this means that an NP -complete problem were in co − NP .This would imply NP = co − NP which in turn inplies that the polynomialhierarchy collapses to NP .For proving Proposition 2.8, we need a definition and a lemma. Definition 2.9 (Linear equivalence [1]) . Let G be a strongly connected di-graph. For x, y ∈ Z V ( G ) , let x ∼ y if there exists z ∈ Z V ( G ) ≥ such that y = x + L G z . In this case we say that x and y are linearly equivalent.One can easily check that for a strongly connected digraph, linear equiv-alence is indeed an equivalence relation on Z V ( G ) . The only nontrivial prop-erty is symmetry, which holds because the primitive period vector has strictlypositive entries for a strongly connected digraph.6 emma 2.10. [5, Lemma 2.1] Let G be a strongly connected digraph and let x and y be chip configurations on G . If x ∼ y , then x is terminating if andonly if y is terminating. Proposition 2.11. [8, Proposition 8] There is a polynomial algorithm thatfor a given digraph G and chip configurations x and y decides whether thereexists an f ∈ Z V ( G ) ≥ such that y = x + Lf , and if such a vector exists, itcomputes a reduced such firing vector. Specifically, for strongly connecteddigraphs, linear equivalence is decidable in polynomial time.Proof. By [6, Theorem 1.4.21], we can decide in polynomial time if the equa-tion Lg = y − x has an integer solution, and if it does, compute one. ByProposition 1.1, a nonnegative solution exists if and only if the g we got fromsolving Lg = y − x has nonnegative coordinates on the non-sink components.If g is nonnegative on the non-sink components, we can make it nonnegativeand reduced by adding an appropriate period vector to it. (By Proposition1.3 we can compute the primitive period vectors of the sink components.) Proof of Proposition 2.8.
Our certificate for the non-halting property of thegame with initial configuration x is a recurrent configuration y linearly equiv-alent to x .We claim that if the game with initial configuration x is non-halting thenthere exist such a y . Indeed, play a legal game starting from x . As a vertexcan only loose chips when it is fired, and in such a case it cannot go intonegative, during the legal game, the number of chips on any vertex v is atleast min { x ( v ) , } at any time. As the number of chips stays constant, thereare only finitely many possible configurations we can see. As we can playindefinitely, we will eventually see a configuration y for the second time. Thismeans we returned to this configuration by a legal game, hence y is recurrent.As we also had x y , in particular we had x ∼ y .Also, the existence of a recurrent y such that x ∼ y implies that x isnon-halting. Indeed, y is non-halting since we can repeat the legal gametransforming y to itself indefinitely. Now Lemma 2.10 implies that x is alsonon-halting.If recurrence were checkable in polynomial time, then this proof was alsocheckable in polynomial time, since x ∼ y can be checked in polynomial timeby Proposition 2.11. 7 . Rotor-routing In this section, we show that the rotor-routing reachability problem canbe decided in polynomial time.The rotor-routing game is played on a ribbon digraph. A ribbon digraph is a digraph together with a fixed cyclic ordering of the outgoing edges from v for each vertex v . For an edge e with tail t , denote by e + the outgoing edgefollowing e in the cyclic order at t . From this point, we always assume thatour digraphs have a ribbon digraph structure.Let G be a ribbon digraph. A rotor configuration on G is a function ̺ that assigns to each non-sink vertex v an edge with tail v . We call ̺ ( v ) the rotor at v . For a rotor configuration ̺ , we call the subgraph with edge set { ̺ ( v ) : v ∈ V ( G ) } the rotor subgraph . See Figure 1, where the rotor-edgesare shown with bold. We emphasize that we need not have any sink in thegraph.A configuration of the rotor-routing game is a pair ( x, ̺ ), where x is achip configuration, and ̺ is a rotor configuration on G . We call such pairs chip-and-rotor configuration .Given a chip-and-rotor configuration ( x, ̺ ), a routing at a non-sink vertex v results in the configuration ( x ′ , ̺ ′ ), where ̺ ′ is the rotor configuration with ̺ ′ ( u ) = (cid:26) ̺ ( u ) if u = v , ̺ ( u ) + if u = v, and x ′ = x − v + v ′ where v ′ is the head of ̺ + ( v ). See Figure 1 for anexample. Routing at a sink vertex has no effect.We call the routing at v legal (with respect to the configuration ( x, ̺ )),if x ( v ) >
0, i.e. the routing at v does not create a negative entry at v . Notethat other vertices might have a negative number of chips. A legal game isa sequence of configurations such that each configuration is obtained fromthe previous one by a legal routing. For a legal game, we call the vector o ∈ Z V ( G ) ≥ where for each v ∈ V ( G ), o ( v ) is the number of times v has beenrouted in the game, the odometer of the game.We say that a chip-and-rotor configuration ( x , ̺ ) is reachable from achip-and-rotor configuration ( x , ̺ ) if there is a legal game starting in ( x , ̺ )and ending in ( x , ̺ ). We denote this by ( x , ̺ ) ( x , ̺ ). The rotor-routing reachability problem asks whether for two given chip-and-rotor con-figurations ( x , ̺ ) and ( x , ̺ ) on a digraph G , we have ( x , ̺ ) ( x , ̺ ).We prove the following statement:8
01 0 1 00 0 0 10 0
Figure 1: Let the ribbon structure be the one coming from the positive orientation of theplane. On the left panel, the leftmost vertex can be legally routed since it has a chip. Therouting results in the configuration of the middle panel, where the upper vertex can berouted. Routing that vertex gives the rightmost configuration.
Theorem 3.1.
The rotor-routing reachability problem can be decided in poly-nomial time, even for multigraphs.
To analyze legal rotor-routing games, it is sometimes convenient to allownon-legal moves. We call a routing an unconstrained routing if we performa routing step so that the routed vertex might not have positive amount ofchips.For some chip-and-rotor configuration ( x, ̺ ) and vector r ∈ Z V ( G ) ≥ , we de-note by π r ( x, ̺ ) the chip-and-rotor configuration obtained after routing (inan unconstrained way) each vertex v exactly r ( v ) times from initial config-uration ( x, ̺ ). Note that this is well-defined, and π r ( x, ̺ ) is computable inpolynomial time since we can compute both the chip configuration and therotor configuration by a simple calculation.Similarly to the chip-firing game, it is useful to think about which vectors r have π r ( x, ̺ ) = ( x, ̺ ) for some ( x, ̺ ). Clearly, in such a case each rotorneeds to make some full turns, hence we need to have r ( v ) = f ( v ) · deg + ( v )for each vertex. (If some vertex has deg + ( v ) = 0, then this formula gives r ( v ) = 0, but the routing of these vertices has no effect, so this is reasonable.)For a vector of the form r ( v ) = f ( v ) · deg + ( v ), routing r has the same effecton the chip configuration as firing the firing vector f . Hence we get backto ( x, ̺ ) if any only if r is of the form r ( v ) = p ( v ) · deg + ( v ) for each v ∈ V where p is a period vector of G . We will call vectors of this form routingperiod vector .We call a vector routing reduced , if it is not coordinatewise greater orequal to any routing period vector. Clearly, a vector r is routing reduced, if9or the vector f with f ( v ) = ⌊ r ( v )deg + ( v ) ⌋ for each vertex v , f is a reduced firingvector.We say that ( x , ̺ ) is reachable from ( x , ̺ ) in the unconstrained senseif there is a vector r ≥ π r ( x , ̺ ) = ( x , ̺ ). Clearly, in this case r can be chosen to be routing reduced (by subtracting an appropriate routingperiod vector).Reachablity in the unconstrained sense is a necessary condition for “legal”reachability. Fortunatelly, reachability in the unconstrained sense can bedecided in polynomial time: Proposition 3.2.
There is a polynomial algorithm that for a given digraph G and chip-and-rotor configuations ( x , ̺ ) and ( x , ̺ ) decides whether thereexists a nonnegative integer vector r such that π r ( x , ̺ ) = ( x , ̺ ) . If sucha vector exists, a routing reduced r can be computed in polynomial time.Proof. At each vertex v , we need at least as many routings so that the rotorat v turns into the position ̺ ( v ). We can achieve this by routing each vertex v some r ( v ) < deg + ( v ) times. Now we are in a chip-and-rotor configuration( y, ̺ ) for some chip configuration y . We need to determine if there exista nonnegative vector transforming ( y, ̺ ) to ( x , ̺ ). For this, we need avector r ≥ r ( v ) is a multiple of deg + ( v ) for each v . Hencethe suitable vectors are exactly of the form r ( v ) = z ( v ) · deg + ( v ) for each v where z ∈ Z V ( G ) ≥ is a solution to Lz = x − y . By Proposition 2.11, theexistence of such a z can be decided in polynomial time, and if the answeris yes, a reduced z can also be computed. Now r = r + r , and as z wasreduced and r ≤ deg + , r will also be routing reduced.Now we can state our condition for the reachability of chip-and-rotorconfigurations. Note that by Proposition 3.2, the following condition can bechecked in polynomial time. Theorem 3.3.
Suppose that ( x, ̺ x ) and ( y, ̺ y ) are two chip-and-rotor con-figurations on the digraph G . Then ( x, ̺ x ) ( y, ̺ y ) if and only if ( y, ̺ y ) isreachable from ( x, ̺ x ) in the unconstrained sense and for the routing reducedvector r transforming ( x, ̺ x ) to ( y, ̺ y ) , we have S = { v ∈ V : y ( v ) < and r ( v ) > } = ∅ and S = { v ∈ V : y ( v ) = 0 , r ( v ) > , and in the subgraph ̺ y , no vertex u is reachable from v with either y ( u ) > or with r ( u ) = 0 } = ∅ . Lemma 3.4.
Let p be a routing period vector of a digraph G , and suppose that α = ( v , v , . . . , v s ) is a legal sequence of routings on G from some initial chip-and-rotor configuration. Let α ′ be the sequence obtained from α by deletingthe first p ( v ) occurrence of each vertex v (if v occurs less than p ( v ) times in α , then we delete all of its occurrences). Then α ′ is also a legal sequence ofroutings from the same initial chip-and-rotor configuration.Proof. The proof is analogous to [2, Lemma 4.3]. Let α ′ = ( v i , . . . , v i m ).Suppose by induction that routing ( v i , . . . v i k − ) was legal for some k . Weshow that routing v i k is also legal.In the game α , one can legally route v i k , hence at that moment, there isa positive amount of chips in it. Compared to α , in α ′ up to this point thevertex v i k was routed p ( v i k ) times less, hence it gave out p ( v i k ) less chips. Upto this point, any in-neighbor u of v i k routed at most p ( u ) times less thanin α . As p is a routing period vector, if each in-neighbor u routed exactly p ( u ) times less than in α , then v i k would have the same number of chips atits turn as in α . If some in-neighbor decreased its number of routings by lessthan p ( u ), then v i k can potentially have more chips at this point than in α .Hence v i k necessarily has the required amount of chips to be able to performthe routing. Corollary 3.5. If ( x, ̺ x ) ( y, ̺ y ) , then there exist a legal game transform-ing ( x, ̺ x ) to ( y, ̺ y ) with a routing reduced odometer. We have already seen that one can compute in polynomial time whether( y, ̺ y ) is reachable from ( x, ̺ x ) in the unconstrained sense, and if yes, givethe routing reduced vector transforming ( x, ̺ x ) to ( y, ̺ y ). Hence for decidingreachability it is now enough to decide if there is a legal game with the givenrouting reduced vector as odometer. To answer this question, we introducethe bounded game for rotor-routing.Fix a vector r ≥
0. The r -bounded rotor-routing game proceeds as fol-lows: If there is a vertex v with positive number of chips such that v hasbeen routed less than r ( v ) times, then choose one such vertex and route it. Ifeach vertex v either has at most 0 chips or has been routed r ( v ) times, thenthe bounded game stops. This bounded game also has the Abelian property:11 emma 3.6. For any initial configuration ( x, ̺ ) and r ≥ , any maximal r -bounded rotor-routing game with initial configuration ( x, ̺ ) ends in the samechip-and-rotor configuration, and the odometer is the same in each maximalrunning. We note that this follows from the general “Abelian theorem” of [4] asthe bounded rotor-routing game is also an Abelian network. Still, for com-pleteness we include a direct proof by a variant of an argument of Thorup[11], as this is also very simple.
Proof.
Suppose that there are two maximal bounded games where the odome-ters are different. Suppose that the odometer of the first running is o andthe odometer of the second running is o . By symmetry, we can supposethat there exist a vertex v such that o ( v ) < o ( v ). Play the running withodometer o and stop it at the first moment when some vertex v is to berouted for the o ( v ) + 1 th time. So far, v has transmitted as many chipsas altogether in the running with odometer o . However, all other verticestransmitted at most as many. As the two runnings start from the same initialconfiguration, the multiset of edge traversals by chips in the stopped secondrun is a subset of of the multiset of edge traversals by chips in the first run.Hence in particular, v has received at most as many chips in the stoppedsecond run as in the first run. In the second run, v can be routed at thismoment, hence it has at least one chip. Thus, v has a chip at the end ofthe first run, which means o ( v ) = r ( v ) contradicting the assumption that r ( v ) ≥ o ( v ) > o ( v ).We denote by odom ( x, ̺ ; r ) the maximal odometer in the r -bounded rotor-routing game, started from ( x, ̺ ). Corollary 3.7. ( x, ̺ x ) ( y, ̺ y ) is equivalent to the property that ( y, ̺ y ) isreachable from ( x, ̺ x ) in the unconstrained sense, and for the routing reducedvector r transforming ( x, ̺ x ) to ( y, ̺ y ) , we have odom ( x, ̺ x ; r ) = r .Proof of Theorem 3.3. We first show that the conditions are necessary. Un-constrained reachability is clearly necessary for the reachability, as it meansreachability in the weaker sense where no nonnegativity is required for theroutings.We claim that if ( x, ̺ x ) ( y, ̺ y ), then for any v with r ( v ) > y ( v ) ≥
0. Indeed, by Corollary 3.5, in this case there is a legalrotor-routing game from ( x, ̺ x ) to ( y, ̺ y ) with odometer r . If v is routed in12 legal game, then after the moment of the first routing, it has a nonnegativeamount of chips. Moreover, v can only loose chips by routings, and it cannotgo negative by a legal routing. Hence after its first routing, v always has anonnegative number of chips, thus, y ( v ) ≥
0. This implies S = ∅ .We also claim that if a legal game leads from ( x, ̺ x ) to ( y, ̺ y ) and hasodometer r , then in the rotor subgraph ̺ y , from each routed vertex v somevertex u with either y ( u ) > r ( u ) = 0 is reachable. This can beproved by induction for the number of routings. There is nothing to proveif there are no routings. If the statement is true after some routings and wemake one more routing, then the additionally routed vertex v has at least onechip before the additional routing. After the routing, the rotor at v points tothe vertex u where the chip was transmitted. Either u had at least 0 chipsbefore the routing, in which case now it has a positive amount of chips, or u had a negative number of chips, but then it has not been routed yet. Hencethe statement is true for v . The rotor-edges of vertices other than v do notchange. If v was reachable from some vertex w in the rotor subgraph, then u is reachable from w after the routing. Hence the condition stays true for allother routed vertices. This implies that S = ∅ , hence we have proved thenecessity of the conditions.For the sufficiency, it is enough to show that if ( x, ̺ x ) ( y, ̺ y ) but ( y, ̺ y )is reachable from ( x, ̺ x ) in the unconstrained sense via the primitive routingvector r , moreover, S = ∅ , then there is a cycle C in ̺ y with y ( v ) = 0 foreach v ∈ C , but where each vertex v ∈ C has r ( v ) >
0. In this case allvertices of C are in S since in ̺ y only the vertices of C are reachable fromthem.By Corollary 3.7, if ( x, ̺ x ) ( y, ̺ y ) but ( y, ̺ y ) = π r ( x, ̺ x ), then the r -bounded rotor-routing game ends so that there there is a nonempty set Z ⊆ V of vertices such that each v ∈ Z has been routed less than r ( v )times, but currently has at most 0 chips. This also implies that r ( v ) > v ∈ Z . Suppose that this bounded game ends with chip-and-rotorconfiguration ( z, ̺ z ).Now do the remaining routings in some order, such that each vertex getsrouted r ( v ) times altogether. This will not be a legal game, but nevertheless,at the end, the configuration will be ( y, ̺ y ). Each vertex v ∈ Z starts from z ( v ) ≤ y ( v ) ≥ r ( v ) >
0, and we supposed that S = ∅ ). As only the vertices of Z are routed in this second phase, inthe second phase, vertices of Z can only gain chips from vertices in Z . As z ( Z ) ≤ y ( Z ) ≥
0, we conclude that in the second phase vertices only13ass chips to vertices in Z , and each vertex of Z receives as many chips asit passes away. Specifically, each vertex v ∈ Z has z ( v ) = y ( v ) = 0. Thefinal rotor configuration ̺ y shows for each vertex the edge through whichit transmitted its last chip. Hence for each vertex v ∈ Z , ̺ y ( v ) is an edgepointing to some vertex in Z . This means that each vertex v ∈ Z has out-degree at least one in ̺ y , and no edge leaves Z in ̺ y . Hence ̺ y has a cycle C that only contains vertices of Z . As y | Z ≡ ̺ y contains a cycle with no chips, but with r ( v ) > v ∈ C .Hence C ⊆ S .Notice that Theorem 2.3 can be rephrased like this (note that thoughthe vector r was routing reduced in the previous proof, we did not use thisproperty). Corollary 3.8.
Take a chip-and-rotor configuration ( x, ̺ x ) and vector r ≥ . Then the r -bounded rotor-routing game started from ( x, ̺ x ) has maximalodometer r if and only if S = { v ∈ V : y ( v ) < and r ( v ) > } = ∅ and S = { v ∈ V : y ( v ) = 0 and in the subgraph ̺ y , no vertex u is reachablefrom v with either y ( u ) > or with r ( u ) = 0 } = ∅ . More generally, one could ask what is the complexity of computing themaximal odometer odom ( x, ̺ x ; r ) for a bounded rotor-routing game. Notethat even though we can decide the reachability problem in polynomial time,it is unclear how to compute odom ( x, ̺ x ; r ).We note that the computation of the rotor-routing action of Holroyd etal [7] is a similar problem, whose complexity is also open.Finally, we note that this situation is similar to what can be seen forthe chip-firing reachability problem for Eulerian digraphs: There also, thereachability problem can be solved in polynomial time, but the computationof the maximal odometer of the bounded game is open [8]. Acknowledgement
I would like to thank Lionel Levine, Swee Hong Chan, Viktor Kiss andB´alint Hujter for inspiring discussions.14 eferences [1] Matthew Baker and Serguei Norine. Riemann–Roch and Abel–Jacobitheory on a finite graph.
Adv. Math. , 215(2):766–788, 2007.[2] Anders Bj¨orner and L´aszl´o Lov´asz. Chip-firing games on directedgraphs.
J. Algebraic Combin. , 1(4):305–328, 1992.[3] Anders Bj¨orner, L´aszl´o Lov´asz, and Peter W. Shor. Chip-firing gameson graphs.
European J. Combin. , 12(4):283–291, 1991.[4] Benjamin Bond and Lionel Levine. Abelian networks I. Foundationsand examples.
SIAM J. Discrete Math. , 30(2):856–874, 2016.[5] Matthew Farrell and Lionel Levine. CoEulerian graphs.
Proc. Amer. Math. Soc. , 144:2847–2860, 2016.[6] Martin Gr¨otschel, L´aszl´o Lov´asz, and Alexander Schrijver.
Geomet-ric Algorithms and Combinatorial Optimization . Springer-Verlag BerlinHeidelberg, 1988.[7] Alexander E. Holroyd, Lionel Levine, Karola M´esz´aros, Yuval Peres,James Propp, and David B. Wilson. Chip-firing and rotor-routing ondirected graphs. In Vladas Sidoravicius and Maria Eul´alia Vares, editors,
In and Out of Equilibrium 2 , volume 60 of
Progress in Probability , pages331–364. Birkh¨auser Basel, 2008.[8] B´alint Hujter, Viktor Kiss, and Lilla T´othm´er´esz. On the complexityof the chip-firing reachability problem.
Proceedings of the AmericanMathematical Society , 145:3343–3356, 2017.[9] Trung Van Pham. Orbits of rotor-router operation and stationary dis-tribution of random walks on directed graphs.
Advances in AppliedMathematics , 70:45–53, 2015. arXiv:1403.5875.[10] Robert Tarjan. Depth-first search and linear graph algorithms.
SIAMJ. Comput. , 1(2):146–160, 1972.[11] Mikkel Thorup. Firing games. Technical Report 94/15, University ofCopenhagen, 1994. 1512] Lilla T´othm´er´esz. The chip-firing game. PhD thesis,http://web.cs.elte.hu/ tmlilla/tezis.pdf, 2017.[13] Lilla T´othm´er´esz. Algorithmic aspects of rotor-routing and the notion oflinear equivalence.