Sinks and Ladders: ARRIVAL and SSG with Two Vertices per Level
Abstract
ARRIVAL is the problem of deciding whether a token, following a deterministic process, eventually reaches a designated destination. While the problem is known to lie in , whether it can be solved in polynomial time remains a major open question. In this article, we study ladders, a class of graphs that constitutes a family of worst-case instances for many existing algorithms, including the currently best known algorithm by Gärtner, Haslebacher, and Hoang (ICALP 2021). We show that ARRIVAL restricted to ladders can be solved in polynomial time, and we further extend this result to stopping binary simple stochastic games (SSG). This article is partly based on an unpublished work in the thesis of the last author [14].
Keywords and phrases:
ARRIVAL, Rotor-Routing, Simple Stochastic GamesFunding:
Hung P. Hoang: Austrian Science Foundation (FWF, project ESP1136425).Copyright and License:
2012 ACM Subject Classification:
Theory of computation Graph algorithms analysisAcknowledgements:
We are grateful to three anonymous referees for their helpful comments.Editor:
John IaconoSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
ARRIVAL is the following decision problem, first introduced by Dohrau, Gärtner, Kohler, Matoušek, and Welzl [7]. As the input, we are given a directed graph with a designated origin and two designated destinations, and .111In the literature, the two sinks are often called and . However, in this paper, as we want to emphasize a parallel between ARRIVAL and simple stochastic games, we call them and instead. Every other vertex has two outgoing edges, with one edge marked as even edge and the other as odd edge. We place a token on and move it according to the following deterministic rule: At every vertex, if the token has visited it an even number of times, the token traverses the even edge; otherwise, it takes the odd edge. The task is to decide whether the token eventually reaches . See Figure 1 for an example.
This simple deterministic process has appeared in many contexts. Most notable is the study of deterministic simulations of a random walk under different names, such as Eulerian walkers [16], rotor-router walks [15], and Propp machines [6]. It also naturally arises from combinatorial games. The introduction of ARRIVAL problem by [7] was inspired by an online game called Looping Piggy developed by Gärtner for Kinderlabor, an initiative for computer science education in kindergartens. The latest reporting of a similar problem is in a blog post by Aaronson [1], also motivated by a children’s game. As the author pointed out in the post, this in turn is a rediscovery of a result back in 1994 [4].
Arguably one of the main attractions of ARRIVAL is its curious complexity status. It is shown in [7] that the problem lies in . Subsequent papers have established more specific results, such as the membership in [10] and -hardness [8] as well as containment in subclasses of [10, 9], but one key question remains wide open: Is ARRIVAL in ?
Two common approaches to tackle this question are finding a faster algorithm for a general instance and expanding the classes of graphs where a polynomial-time algorithm for ARRIVAL exists. For the first approach, the best algorithm so far runs in subexponential time [11], where is the number of non-sinks in the graph. For the second approach, there have been (quasi-)polynomial-time algorithms on tree-like multigraphs [2, 12], path-like multigraphs [3], and bounded treewidth [13]. Notably, most of these results also extend to a more generalized variant with multiple tokens.
Contributions.
This paper contributes towards the second approach above. In particular, we consider the class of graphs where for every , there are either no or exactly two vertices of distance to the destinations (i.e., the length of the shortest path to either or is ); see Figure 1 for an example. These graphs, which we call ladders, capture one of the worst cases for the current state-of-the-art subexponential algorithm [11] and also for another deterministic algorithm, which we elaborate in Section 3. It turns out that ladders have an interesting structural property, expressed in terms of hitting properties of a Markov chain, which we can exploit to design a polynomial-time algorithm for ARRIVAL; see Section 5. Note that the technique used for this case is different than most of the existing algorithms for ARRIVAL, as we do not simulate the movement of the token in any way. Instead, we progressively and simultaneously construct a witness for a YES-instance and a witness for a NO-instance, and whichever fails first helps us decide the instance.
Moreover, ARRIVAL has a very close connection to Simple Stochastic Games (SSG), a famous problem that shares the same complexity status: It is also in but not known to be in . While there has been no reduction between these two problems, they share many parallels; see [13] for a recent discussion. Due to this connection, we also explore how SSG can be solved on ladders. Using an analogous observation on the hitting probabilities, we can derive a simple polynomial-time algorithm for SSG on ladders; see Section 4.
2 Preliminaries
A binary graph is a directed simple graph such that there are exactly two sinks and (i.e., these two vertices have no outgoing edges). All other vertices have exactly two outgoing edges. We also assume that it is possible to reach at least one of the two sinks starting at any vertex. In this paper, we define ; that is is the number of non-sinks in the graph.
For a vertex , denote by the distance of to either of the sinks, i.e. is the length of a shortest path (number of edges) in the graph from to either or . In particular, we have . For , let denote the set of vertices of distance exactly from the sinks. We call the -th levelset and call the level decomposition of . Observe that we can compute the level decomposition of in linear time by inverting all edge directions and starting a multi-source breadth-first search with sources and .
An edge is a forward edge if is closer to the sinks than (i.e., in and in for some ). Otherwise, we call a backward edge. Note that a backward edge may connect two vertices in the same levelset.
A binary graph is a ladder, if every non-empty levelset of consists of exactly two vertices, except for the last non-empty levelset which may consist of a single vertex. In other words, let be the level decomposition of ; then is a ladder, if for all and implies for all with .
2.1 ARRIVAL
For a binary graph , a partition of the edge set is balanced, if every vertex has exactly one outgoing edge in and one outgoing edge in . We call these edges the even edge and the odd edge of and denote them by and , respectively. Then an instance of ARRIVAL is defined formally as a tuple of a binary graph , a designated source vertex , and a balanced partition of into and .
Given such an instance of ARRIVAL, consider moving a token along the edges of the graph according to the following rules: Whenever the token reaches a vertex , it follows the even edge of if it has been at an even number of times already. Otherwise, it follows the odd edge of . This results in the token effectively switching between the two outgoing edges at every vertex. The process finishes once the token reaches one of the two sinks. The problem is to decide which of the two sinks the token will end up at.
2.2 (Binary) SSG
Following roughly the definition given by Condon [5], a (binary) Simple Stochastic Game (SSG) is played on a binary graph with . Moreover, one of the vertices is considered the designated source.
The game works as follows: For every vertex , the so-called max-player chooses one of the outgoing edges of . Next, the min-player chooses one outgoing edge for every . A token is then placed on and starts moving along the directed edges of the graph. Whenever the token reaches a vertex , the token follows the outgoing edge that was chosen by the max-player for this vertex. Analogously, the edges chosen by the min-player determine where the token moves to from vertices in . When the token reaches an average vertex , an outgoing edge of is chosen uniformly at random and the token continues along this edge. The game ends when the token reaches either of the sinks or . The max-player wins if the token eventually reaches . If the token never reaches , the min-player wins. This can happen if the token reaches instead or if it continues traversing the graph indefinitely without ever reaching any of the sinks.
A (positional) strategy for the max-player is a function that assigns each vertex one of its outgoing edges. If the max-player plays according to the strategy , this means that whenever the token reaches a vertex , it will continue along the outgoing edge . Analogously, a strategy for the min-player is a function that assigns to each vertex in one of its outgoing edges.
We denote by the graph that we obtain if we delete outgoing edges from vertices in that are not used by and . In other words, is the graph restricted to the strategies . This can be thought of as a Markov chain: Vertices in have exactly one outgoing edge that is taken with probability , vertices in have two outgoing edges each with a transition probability of . Given strategies and a vertex , the value (or hitting probability) is the probability that a token starting at vertex will eventually hit in the Markov chain . In other words, this is the probability of the max-player winning the game if the players play according to and and the token starts at . The optimal value of a vertex is defined as .
The computational problem SSG is to decide whether or not, where is the optimal value of the designated source.
An SSG is called stopping if and only if a sink is reachable from every vertex in the graph for all strategies and of the players. In other words, in a stopping game, the probability of the token looping indefinitely in the graph without ever reaching a sink is zero, regardless of the played strategies. There is a well-known trick that reduces SSGs to stopping SSGs [5]. However, using it for SSGs on ladders would destroy the ladder structure of the underlying graph. Hence, in this article, we only consider stopping SSGs on ladders.
3 Prelude: An -time algorithm for ARRIVAL
As a motivation for studying ladders, consider the following simple algorithm for ARRIVAL that runs in time . Note that this algorithm has been discovered independently by Rote [17], who also bootstrapped it into a -time algorithm.
Suppose we are given an instance of ARRIVAL consisting of the binary graph , , and a balanced partition of the edge set. Let be the level decomposition of . Now assume there is a vertex in some levelset such that all forward edges from (i.e., all edges from a vertex in to a vertex in ) have as the target. Let be the graph obtained from by contracting all vertices in to ; that is, we replace every edge such that by and then remove all vertices in and their outgoing edges. Let be if and be otherwise. Finally, let be the balanced partition of obtained from through the process of replacement and deletion above.
Lemma 1.
is a YES ARRIVAL instance, if and only if is also a YES ARRIVAL instance.
Proof.
Let and be the sequences of vertices that the token visits for and , respectively. We prove by induction the claim that every prefix of can be obtained from some prefix of by removing vertices in . For the base case, suppose . Observe that the token only terminates when it visits a vertex in (i.e., or ); and by the construction of the level decomposition, after visiting , the token has to visit at least one vertex in each of the levelsets between and . This implies that it has to visit , and until the first time it visits after this visit at , the token only visits vertices in layers for . Hence, contains a prefix that ends with and otherwise contains only vertices in . Since when , the claim then holds for the prefix of . Note that it trivially holds for this prefix when , since in this case .
For the inductive step, suppose for some prefix of , we have the corresponding prefix of as guaranteed by the claim. Note that we can choose such that and end at the same vertex . Suppose the vertex after in is . If , then the vertex after in is also , since at this point, the token should have visited the same number of times in both and . Otherwise, the token visits next in , since should have been contracted to when we constructed from . By a similar argument as above, we also conclude that after in , there is a substring that ends with and otherwise contains only vertices in . Concatenating this substring to , we obtain a prefix in corresponding to the prefix resulting from the concatenation of and in , as required by the claim. This completes the proof of the claim.
Since and are not contracted, the lemma then follows from the claim above.
We are now ready to describe our algorithm: If there exists a levelset with only one vertex, let be the smallest index such that , and let be the only vertex in layer . Let be the graph obtained by performing the contractions described above. If there exists no such levelset, then we define to be the same as the original instance. Next, we simulate the movement of the token in until it reaches or . By Lemma 1, we can then decide the original instance accordingly.
As shown in [11], the number of steps the token takes is , since is the highest index of a nonempty levelset for . By the choice of , we obtain that , and it attains the maximum, when there are exactly two vertices per non-empty levelset, except for potentially the last such levelset (i.e., when the graph is a ladder). In other words, the ladders capture a class of “hard” instances for the algorithm above (i.e., instances for which the algorithm runs the longest). Interestingly, they are also hard instances for the current state-of-the-art algorithms for ARRIVAL [11].
4 Stopping SSG on ladders in polynomial time
Since the arguments for SSG is simpler than for ARRIVAL, we present first the polynomial-time algorithm for stopping SSGs on ladders in this section.
Theorem 2.
Stopping SSG can be solved in polynomial time on ladders.
Our algorithm roughly works as follows: We start at the levelset . It contains the two sinks and and we know that . Now consider the next levelset and assume it contains the two vertices and . We claim that by looking at forward edges of and , and by considering which types of vertices and are (max, min, or avg), we can figure out whether or not. Moreover, we can repeat this for the other levelsets. Combined with a further observation, we can deduce a total order on the optimal values of all vertices which allows us to solve the SSG.
For the rest of this section, assume that we are given a stopping SSG on a ladder as defined in Section 2 with being the smallest number such that . In particular, this implies for all with , and for all with . By adding up to two new vertices (e.g. to ) with outgoing edges to vertices from , we also get . This does not change the game since these new vertices have no incoming edges and will never be visited by the token. Hence, from now on we assume for all .
4.1 Optimal values within levelsets
The first ingredient for our algorithm is to find out which of the two vertices in each levelset has larger optimal value. For this, consider the following definition.
Definition 3.
For every , define to be a vertex , and define such that , i.e. is the other vertex in . Note that this implies .
In particular, we have and . The following observation will be crucial.
Lemma 4.
For every , we have .
Proof.
Let be arbitrary and assume are optimal strategies. In particular, we have for all . Assume the token is currently at and recall that we assume that the game is stopping. Consider any walk of the token through the graph eventually ending at a sink. The walk has to pass through or which implies that is a convex combination of and . The same argument works for (and in fact all vertices in levelsets ). The goal of this subsection hence becomes determining and for each . As we have observed, we already know this for .
We process the remaining levelsets iteratively going from up to . Assume that we are in iteration and hence know and . We are trying to determine and .
Lemma 5 (one max-vertex).
Assume there is a vertex , and let denote the other vertex in . Then .
Proof.
We distinguish two cases: assume first that has a forward edge with target . The best strategy for the max-player is to use this edge since it will yield which is best possible according to Lemma 4. We conclude that , as desired.
Thus, assume now that has no forward edge to . Then the outgoing edges of are and with for some . By Lemma 4, we have and hence it is optimal for the max-player to choose the edge . This again means that under optimal strategies, a token starting at needs to go through in order to get to a sink. Hence, we get .
Analogously, we can prove the following lemma.
Lemma 6 (one min-vertex).
Assume there is a vertex , and let denote the other vertex in . Then .
Proof.
We again distinguish two cases: assume first that has a forward edge with target . The best strategy for the min-player is to use this edge since it will yield which is best possible according to Lemma 4. We conclude that , as desired.
Thus, assume now that has no forward edge to . Then the outgoing edges of are and with for some . By Lemma 4, we have and hence it is optimal for the min-player to choose the edge . This again means that under optimal strategies, a token starting at needs to go through in order to get to a sink. Hence, we get .
Lemma 7 (average vertices I).
Assume that the two vertices with are both average vertices, i.e. . If the edge exists but the edge does not exist, then we have .
Proof.
Assume first that the edge exists, and let and be the remaining outgoing edges of and . Observe that both and are in one of the levelsets and hence we have and . We conclude that indeed .
Thus, assume now that does not exist. Then the edge must exist instead. Let and be the remaining outgoing edges of and . Observe that all paths from to any of the sinks must go through . Hence, we get .
Lemma 8 (average vertices II).
Assume that the two vertices with are both average vertices, i.e. . If the edge exists but the edge does not exist, then we have .
Proof.
Assume first that the edge exists, and let and be the remaining outgoing edges of and . Observe that both and are in one of the levelsets and hence we have and . We conclude that indeed .
Thus, assume now that does not exist. Then the edge must exist instead. Let and be the remaining outgoing edges of and . Observe that all paths from to any of the sinks must go through . Hence, we get .
The only remaining case is the one where both average vertices have edges to both and .
Proof.
If none of the Lemmas 5-8 apply, then must be average vertices, both with edges to and . Hence, we have .
We conclude that we can determine and in constant time by just looking at and the two vertices as well as their outgoing edges.
4.2 The algorithm
In Section 4.1 we proved that we can find and in polynomial time for all . From Lemma 4, we know that this gives us a total order
on the optimal values of all vertices in the graph. From this total order, we can directly derive optimal strategies for both players. More precisely, for each vertex in , we keep the outgoing edges to the out-neighbor with the higher value, while for each vertex in , we keep the edge to the one with the lower value. Finally, we can solve the Markov chain to obtain the optimal value and decide the game in polynomial time.
5 ARRIVAL on ladders in polynomial time
This section is wholly dedicated to show the following.
Theorem 10.
ARRIVAL can be solved in polynomial time on ladders.
We start by some structural observations on ladders in Section 5.1. Next, in Section 5.2, we define switching flows and recap the result that integral switching flows are certificates for whether an ARRIVAL instance is a YES- or a NO-instance. Then we give an overview of our polynomial-time algorithm in Section 5.3. After that, we explain the key lemma in Section 5.4 and the main technical recursive argument of the algorithm in Section 5.5. Finally, we wrap up the algorithm in Section 5.6.
For the rest of this section, we consider an ARRIVAL instance on a ladder with a designated source and a balanced partition of the edges . Let be the level decomposition of . Similar to Section 4, we also assume that there exists such that for and for .
5.1 Zero-player hitting probabilities
Consider the Markov chain on the ladder , where the transition probability of every edge is . That is, from every vertex in , there is an equal probability to visit one of its two out-neighbors next. Let be the hitting probability at vertex in this Markov chain. In other words, is exactly the optimal of the SSG on where . For this reason, we call this the zero-player hitting probability. We drop the subscript from when the graph is clear from context.
As explained in Section 4, in polynomial time, we can label the two vertices in each levelset for as and such that , , and
| (1) |
Next, we can assume without loss of generality that and are two directed paths in . Indeed, suppose for some , there is no edge from to . (The case of the missing edge can be argued analogously.) Then must have an edge to . By Lemma 8, . Combined with (1), this implies that . If has an edge to , we can exchange the labels of and , and after this relabeling, we have the edges and . Otherwise, the target of all forward edge(s) of is . This means that all vertices of have their forward edges to . Then by using the same argument as in Section 3, we can contract all vertices in to .
Finally, for each vertex , we define the gap We also drop the subscript from when the graph is clear. The following lemma shows a crucial structural property of ladders that allows us to design an efficient algorithm later.
Lemma 11.
.
Proof.
See Figure 2 for an illustration of the following proof. For each vertex , is the absolute difference between the -value of and that of any its out-neighbor. Combining this with (1) and the fact that and are two directed paths in , we have for ,
Therefore,
The last line above follows from (1). Specifically, the equality follows from the facts that and , while the inequality follows from the fact that .
5.2 Switching Flows
Switching flows were first introduced in [7]. We define them here more generally.
Definition 12 (Switching Flow).
Given a binary graph , a balanced partition of , and a function , a switching flow with respect to is a function satisfying the equations
for all .
Definition 13 (Inflow and Outflow).
Given a binary graph , a balanced partition , and a function , and a switching flow with respect to , we call the inflow of . Analogously, we call the outflow of .
We distinguish between different types of switching flows.
Definition 14 (Types of Switching Flows).
Suppose we are given a binary graph , a balanced partition of , a function , and a switching flow with respect to . We use the following adjectives to define different types of switching flows.
-
We call integral if for all .
-
Suppose for some , satisfies and for . Then we say is a switching flow from .
-
Finally, we call a switching flow to if , and we call it a switching flow to if .
The following result goes back to Dohrau, Gärtner, Kohler, Matoušek, and Welzl [7] and implicitly proves that ARRIVAL is in .
Theorem 15 (Switching Flows are Certificates [7]).
An instance of ARRIVAL has an integral switching flow from the origin to if and only if the token eventually arrives at . Analogously, it has an integral switching flow from the origin to if and only if the token ends up at .
In other words, in order to solve ARRIVAL, it suffices to find an integral switching flow.
5.3 Overview of the algorithm
As we have seen in the previous subsection, one way to try to solve ARRIVAL is to solve its integer linear program (ILP) formulation implicitly given in Definition 12 together with the constraints that all variables are integral. Unfortunately, we do not know how to solve this ILP fast. However, we can easily obtain a (not necessarily integral) switching flow by solving the linear system in Definition 12 in polynomial time. In fact, for each of the two sinks, we can efficiently check if there exists a switching flow to that sink. The non-existence of a switching flow to one sink suffices to decide ARRIVAL. Thus, the interesting case is when there are two switching flows from , one to and one to .
The general idea to solve this case is as follows. We start with the two switching flows above. At every iteration, we attempt to make more values in the two switching flows to be integral, while maintaining that one switching flow is from to and the other to . More specifically, at iteration , we require the flow on the edges starting from a vertex in to be integral. We show that for each switching flow, there is at most one choice of integral values for these edges, and we can compute it in polynomial time. Hence, either we can decide the instance immediately (because no integral values are possible for one switching flow) or we can progressively fix more integral values in both switching flows.
5.4 Difference between two switching flows
This subsection is dedicated to Lemma 16 below, which is the key lemma to our algorithm and discusses the relationship between any two switching flows with respect to the same tuple . In particular, it shows that the inflows to in any two switching flows cannot differ by more than one. This is trivial when the switching flows are from an origin , since the inflows to can then be at most one. However, it is not obvious for an arbitrary function , where the inflow to can potentially take any value between 0 and . Further, Lemma 16 also states that when the difference between the inflows to in the two switching flows is exactly one, we know exactly the difference between the flows of the even and odd edges from each vertex such that , in both switching flows.
Lemma 16.
Let be a ladder, a balanced partition of , and a function. Let and be two switching flows with respect to . Then .
Further, if , then , and for each ,
-
if , then and ; and
-
if , then and .
Proof.
Consider the following sum over all edges of :
On one hand, we can sum over the vertices and obtain
| (2) |
In the last equality, we use the facts that , that , that , and that for , .
On the other hand, we can consider the two cases of whether is an odd edge or even edge and obtain
| (3) |
The second and third inequalities above follow from Lemma 11, while in the first inequality, we use the fact that for , and to deduce that
If , the equalities of (3) must hold at equalities. This implies that and for ,
-
if , then and ; and
-
if , then and .
5.5 Fixing flow values from the next levelset
For convenience, we first define a few notations. For , define and . Moreover, we say a switching flow is -integral if for every edge from a vertex in , . is an -pair, if and are -integral switching flows from to and , respectively. In this subsection, we package the idea of the algorithm in Section 5.3 in the following lemma.
Lemma 17.
For , if there exists an -pair , then
-
1.
for every outgoing edge of a vertex in , there exists only one possible value for each of and ;
-
2.
if such is a backward edge, then ; and
-
3.
for , .
Moreover, in polynomial time, we can output either an -pair, or that there is no -integral switching flow from to , or that there is no -integral switching flow from to .
Proof.
We prove by induction on . For the base case , a -pair is simply a pair of switching flows from to and to , without any integrality constraint. Then statements 1 and 2 are vacuously true, while statement 3 holds since and . Hence, we only need to argue about the run time. As noted before, can be obtained by solving the linear program that comprises the inequalities in Definition 12 and the constraint that the inflow to is one. Likewise, can be obtained by solving a similar linear program but with the constraint that the inflow to is instead zero. These linear programs can be solved in polynomial time. If one of them is infeasible, we conclude that the corresponding 0-integral switching flow does not exist. Otherwise, combining a solution of each linear program yields a 0-pair.
For the inductive step, assume that the lemma statement holds for some . We show that it also holds for . Suppose that there exists an -pair . Note that this is also an -pair. Hence, statements 1–3 already holds for vertices in , and we only need to show them for vertices in . The idea is to apply Lemma 16 to fix the differences and for and from this information deduce the unique values for , , , and . However, the issue here is that we require in order to apply the lemma, and this may not hold. In order to circumvent this, instead of applying Lemma 16 directly to the original ladder , we apply it to the ladder induced on the layers instead.
Formally, let be the graph obtained from by removing the vertices in , removing the outgoing edges from and , and relabeling and to and . It is easy to see that is a ladder with the level decomposition . To avoid confusion, we still refer to the vertices in by their old labels and . Let and . Then is a balanced partition of . Next, let be the function such that for ,
Finally, let and be the functions obtained by restricting and to the set . Then by construction, is a switching flow with respect to . Moreover, applying statement 2 in the inductive hypothesis, we also have that is a switching flow with respect to .
We now argue that . Let be the sequence . Let be a vertex in the sequence except for and . Suppose the two out-neighbors of precede it in the sequence . Since there are two directed paths and , must be for some . However, due to the definition of the level decomposition, the preceding out-neighbors of in the sequence can only be . Now together with the fact that the graph is simple, we arrive at a contradiction. Hence, must have at least one out-neighbor succeeding it in . By an analogous argument, must also have at least one out-neighbor preceding it in . Hence, has exactly one preceding and one succeeding out-neighbor. Now, if , then since and , we have . Combined with (1), this implies that for all between and in , where indicates the further vertex among the two in the sequence. As shown before, has one preceding and one succeeding out-neighbor in . We then use the same argument as above to derive that for all between and in . Repeating this argument, we obtain that the whole sequence has the same values. However, this is false, since . Hence, . By a similar argument, .
Therefore, we can now apply Lemma 16 on , and the two switching flows and . By statements 2 and 3 of the inductive hypothesis, we obtain that . Further, as argued above, for . Therefore, Lemma 16 implies that for exactly one of and has value 0 and the other has value 1. Further, we know exactly these values, since we can compute and . (Recall that can easily computed from , which in turn can be computed in polynomial time as explained in Section 4.)
In the remainder of the proof, we assume that
| (4) |
the other case can be argued analogously. By Lemma 16, in this case, one of the following holds:
-
and ; or
-
and .
Note that since , in the former case, we have , and in the latter case, .
We now complete the proof of the inductive step by considering the two following cases.
Case 1.
At least one of and have only one forward edge. Suppose has only one forward edge. Then for , other than its incoming edge , all its other incoming edges are from vertices in . We have
where takes value one if and zero otherwise.
Note that the edges in the sums in the two expressions above are backward edges from vertices in . Hence, by the inductive hypothesis, the two sums have the same value. Further, also by the inductive hypothesis, the values of and are fixed and differ by one. Hence, the values of and are also unique and
| (5) |
Now suppose . Then . As argued above, this implies and . Then combining this with (4) and (5), we obtain that and have the same unique value. Hence, the statements 1–3 hold for the outgoing edges of . With a similar analysis for the incident edges of , we also conclude statements 1–3 hold for the outgoing edges of . Further, note that all these unique values can be computed in polynomial time. Once we have all the unique values for the outgoing edges from , we add constraints to fix these values in the linear program to compute the switching flows from to and to . If one of these linear programs is infeasible, we conclude that the corresponding -switching flow does not exist; otherwise, their solutions form an -pair.
The case for can be argued analogously. It remains to consider the case when the two outgoing edges of are forward edges. Then must have only one forward edge. We then use similar arguments as before to show that statements 1–3 hold for all outgoing edges of and and that the relevant computation can be done in polynomial time.
Case 2.
All outgoing edges of and are forward edges. Since the values of the outgoing edges from and in and are integral, the assumption of (4) implies that is odd and is even.
We now define similar to how we defined , . Since the outgoing edges of and are both forward edges, and since the values for the backward edges from vertices in are the same in and , we obtain that and are switching flows with respect to . Lemma 16 states that for any two switching flows with respect to , the inflows to differ by at most one. This means that if we know the parity of the inflow to then there can only be a unique value for this inflow, since if any distinct values of the same parity have difference at least two. This implies statement 1 for the outgoing edges of . Statement 2 for these edges hold vacuously, as these edges are not backward edges. Statement 3 is also implied from the analysis above: We know that the inflows to in and differ by at most one. Since the parities of these inflows are different, they have to differ exactly by one.
It remains to show that we can do the computation in polynomial time. By the inductive hypothesis, in polynomial time, we can obtain an -pair . As argued above, we know that is an odd number in the range . If there is only one odd number in the range, then that is the value for . If there are two odd numbers in the range, we use the earlier observation that one of these numbers cannot be the outflow of for any -switching flow from to . Hence, by using the same linear program to obtain with the additional constraint to fix the outflow of to one of odd numbers in this range, we can verify which odd number is the unique possible value for based on the feasibility of this linear program. After obtaining the unique value for , we can easily deduce the unique values of and . By the same procedure, we can also obtain the unique values for and , as well as the values for the outgoing edges of . Note that in the entire process, if something is infeasible, we can immediate conclude that the corresponding -switching flow does not exist.
5.6 Summary
Theorem 15 states that a -integral switching flow from to (resp., to ) is a certificate of a YES-instance (resp., NO-instance). This implies that there is no -pair. Hence, using the algorithm as guaranteed by Lemma 17 for , in polynomial time, we conclude that either the non-existence of a -integral switching flow from to or non-existence of a -integral switching flow from to . We can then decide the ARRIVAL instance accordingly.
6 Concluding remarks
In this article, we prove that ARRIVAL and SSG on ladders can be solved in polynomial time. Note that our proof of Lemma 17 above mainly aims at making the run time polynomial rather than optimizing it as much as possible. Instead of solving a linear number of linear programs as this proof implies, we can solve as few as linear programs, where is the number of levelsets such that all four outgoing edges from are forward edges. Further, the results can also be extended to the generalization of ARRIVAL with multiple tokens. We refer to [14] for more detail on both of these results.
Whether ARRIVAL can be solved in polynomial time remains open. While ladders capture a subset of worst-case instances for the subexponential time algorithm by [11], there are still other instances with the same asymptotic run time, e.g., when all non-empty levelsets have vertices for some constant . Unfortunately, the analysis in this article does not extend to these cases, and they could form another interesting class of graphs for future work.
References
- [1] Scott Aaronson. The computational expressiveness of a model train set: A paperlet. https://scottaaronson.blog/?p=5402, 2021. Accessed: 6 July 2022.
- [2] David Auger, Pierre Coucheney, and Loric Duhazé. Polynomial Time Algorithm for ARRIVAL on Tree-Like Multigraphs. In Stefan Szeider, Robert Ganian, and Alexandra Silva, editors, 47th International Symposium on Mathematical Foundations of Computer Science (MFCS 2022), volume 241 of Leibniz International Proceedings in Informatics (LIPIcs), pages 12:1–12:14, Dagstuhl, Germany, 2022. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. doi:10.4230/LIPIcs.MFCS.2022.12.
- [3] David Auger, Pierre Coucheney, Loric Duhazé, and Kossi Roland Etse. Generalized ARRIVAL problem for rotor walks in path multigraphs. In Reachability problems, volume 14235 of Lecture Notes in Comput. Sci., pages 183–198. Springer, Cham, [2023] ©2023. doi:10.1007/978-3-031-45286-4_14.
- [4] Adam Chalcraft and Michael Greene. Train sets. Eureka, 53:5–12, 1994.
- [5] Anne Condon. The complexity of stochastic games. Information and Computation, 96(2):203–224, 1992. doi:10.1016/0890-5401(92)90048-K.
- [6] Joshua Cooper, Benjamin Doerr, Joel Spencer, and Gábor Tardos. Deterministic random walks on the integers. European Journal of Combinatorics, 28(8):2072–2090, 2007. EuroComb ’05 - Combinatorics, Graph Theory and Applications. doi:10.1016/J.EJC.2007.04.018.
- [7] Jérôme Dohrau, Bernd Gärtner, Manuel Kohler, Jiří Matoušek, and Emo Welzl. ARRIVAL: A Zero-Player Graph Game in NP coNP. In Martin Loebl, Jaroslav Nešetřil, and Robin Thomas, editors, A Journey Through Discrete Mathematics: A Tribute to Jiří Matoušek, pages 367–374. Springer International Publishing, Cham, 2017. doi:10.1007/978-3-319-44479-6_14.
- [8] John Fearnley, Martin Gairing, Matthias Mnich, and Rahul Savani. Reachability switching games. In 45th International Colloquium on Automata, Languages, and Programming, volume 107 of LIPIcs. Leibniz Int. Proc. Inform., pages Art. No. 124, 14. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2018.
- [9] John Fearnley, Spencer Gordon, Ruta Mehta, and Rahul Savani. Unique end of potential line. Journal of Computer and System Sciences, 114:1–35, December 2020. doi:10.1016/j.jcss.2020.05.007.
- [10] Bernd Gärtner, Thomas Dueholm Hansen, Pavel Hubácek, Karel Král, Hagar Mosaad, and Veronika Slívová. ARRIVAL: Next Stop in CLS. In Ioannis Chatzigiannakis, Christos Kaklamanis, Dániel Marx, and Donald Sannella, editors, 45th International Colloquium on Automata, Languages, and Programming (ICALP 2018), volume 107 of Leibniz International Proceedings in Informatics (LIPIcs), pages 60:1–60:13, Dagstuhl, Germany, 2018. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. ISSN: 1868-8969. doi:10.4230/LIPIcs.ICALP.2018.60.
- [11] Bernd Gärtner, Sebastian Haslebacher, and Hung P. Hoang. A subexponential algorithm for ARRIVAL. In 48th International Colloquium on Automata, Languages, and Programming, volume 198 of LIPIcs. Leibniz Int. Proc. Inform., pages Art. No. 69, 14. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2021.
- [12] Ebrahim Ghorbani, Jonah Leander Hoff, and Matthias Mnich. A quasi-polynomial time algorithm for multi-arrival on tree-like multigraphs. In 42nd International Symposium on Theoretical Aspects of Computer Science, volume 327 of LIPIcs. Leibniz Int. Proc. Inform., pages Art. No. 39, 19. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2025. doi:10.4230/lipics.stacs.2025.39.
- [13] Sebastian Haslebacher. ARRIVAL: recursive framework & -contraction. In 52nd International Colloquium on Automata, Languages, and Programming, volume 334 of LIPIcs. Leibniz Int. Proc. Inform., pages Art. No. 95, 17. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2025. doi:10.4230/lipics.icalp.2025.95.
- [14] Hung P. Hoang. On Two Combinatorial Reconfiguration Problems: Reachability and Hamiltonicity. PhD thesis, ETH Zurich, 2022. doi:10.3929/ethz-b-000572947.
- [15] Alexander E. Holroyd and James Propp. Rotor walks and Markov chains. In Algorithmic probability and combinatorics, volume 520 of Contemp. Math., pages 105–126. Amer. Math. Soc., Providence, RI, 2010.
- [16] Viacheslav B. Priezzhev, Deepak Dhar, Abhishek Dhar, and Supriya Krishnamurthy. Eulerian walkers as a model of self-organized criticality. Phys. Rev. Lett., 77:5079–5082, 1996.
- [17] Günter Rote. Personal communication, 2020.
