ARRIVAL: Next Stop in CLS
Bernd Gärtner, Thomas Dueholm Hansen, Pavel Hubáček, Karel Král, Hagar Mosaad, Veronika Slívová
Introduction
Variants of switch graphs have applications and are studied for example in combinatorics and in automata theory (cf. and the references therein). Dohrau et al. introduced Arrival, a natural computational problem on switch graphs, which they informally described as follows:
Suppose that a train is running along a railway network, starting from a designated origin, with the goal of reaching a designated destination. The network, however, is of a special nature: every time the train traverses a switch, the switch will change its position immediately afterwards. Hence, the next time the train traverses the same switch, the other direction will be taken, so that directions alternate with each traversal of the switch. Given a network with origin and destination, what is the complexity of deciding whether the train, starting at the origin, will eventually reach the destination?
The above rather straightforward question remains unresolved. Dohrau et al. showed that deciding Arrival is unlikely to be -complete (by demonstrating that it is in ), but it is currently not known to be efficiently solvable.
To determine whether the train eventually reaches its destination, it is natural to consider a run profile, i.e., the complete transcript describing how many times the train traversed each edge. Dohrau et al. presented a natural integer programming interpretation of run profiles called switching flows, which have the advantage of being trivial to verify. The downside of switching flows is that they do not guarantee to faithfully represent the number of times each edge has been traversed; a switching flow might contain superfluous circulations compared to a valid run profile. Nevertheless, Dohrau et al. proved that the existence of a switching flow implies that the train reaches its destination, and thus a switching flow constitutes an witness for Arrival.
The membership was shown by an insightful observation about the structure of switch graphs. Specifically, the train reaches its destination if and only if it never enters a node from which there is no directed path to . The railway network can thus be altered so that all such vertices point to an additional “dead-end” vertex . The witness is then simply a switching flow from the origin to the dead-end .
Given that the decision variant of Arrival is in , it is natural to study the search complexity of Arrival in the context of total search problems with the guaranteed existence of a solution, i.e., within the complexity class (which contains the search analogue of ). Total search problems are classified into subclasses of using the methodology proposed by Papadimitriou that clusters computational problems according to the type of argument assuring the existence of a solution. Karthik C. S. noticed that the search for a switching flow is a prime candidate to fit into the hierarchy of problems. He introduced S-Arrival, a search version of Arrival that seeks a switching flow to either the destination or the dead-end vertex , and showed that it is contained in the complexity class of total problems amenable to local search.
Fearnley et al. recently studied multiple variants of reachability games on switch graphs and as one of their results gave a lower bound on the complexity of deciding ARRIVAL. Specifically, they showed that Arrival is -hard.
One of the open problems suggested by Dohrau et al. was whether deciding the termination of Arrival is contained in . Recall that given a railway network with an origin and a destination , the transcript of the route of the train captured in the run profile from to (if it exists) is unique. We show that it is possible to efficiently decide whether a switching flow corresponds to a run profile, which provides a positive answer to the above question and places Arrival inside . We similarly also improve the upper bound on the search complexity of Arrival: We show that S-Arrival is contained in the complexity class . Daskalakis and Papadimitriou introduced to classify problems that can be reduced to local search over continuous domains. contains multiple important search problems such as solving simple stochastic games, finding equilibria in congestion games, and solving linear complementarity problems on P-matrices. For all of these problems, as well as for S-Arrival, we currently do not have a polynomial time algorithm, and they are not known to be complete for some subclass of .
We establish the containment in through a reduction to End-Of-Metered-Line (EOML), a total search problem that was recently introduced by Hubáček and Yogev who also showed that it is in . In EOML we are given a source in a directed graph with vertices of in-degree and out-degree at most one, and the task is to find a sink or a source different from the given trivial source. The access to the graph is given locally via information about the successor and predecessor of each vertex together with its distance from the trivial source (for the formal definition see Definition 19).
Our result makes it unlikely for S-Arrival to be -hard, which was one of the possibilities suggested by the containment in shown by Karthik C. S. . This is due to known black-box separations among subclasses of , which suggest that is a proper subclass of . Note that our reduction from S-Arrival to End-Of-Metered-Line results in instances with a significantly restricted structure: the End-Of-Metered-Line graph consists only of a single path and many isolated vertices. We believe that this structure may in future work be used to show that S-Arrival is contained in .
Our reduction from S-Arrival to End-Of-Metered-Line also implies that we can use an algorithm by Aldous to solve S-Arrival. The algorithm is randomized and runs in expected time on switch graphs with vertices. This is the first algorithm with expected runtime for . (A trivial time algorithm can be obtained by following the path of the train through the network.) Aldous’ algorithm, in fact, solves any problem in . It samples a large number of candidate solutions and then performs a local search from the best sampled solution. The advantage of our reduction is that the resulting search space for End-Of-Metered-Line is small enough to make Aldous’ algorithm useful, unlike in the previous reduction by Karthik C. S. that showed containment in .
Fearnley et al. recently gave a reduction from -matrix linear complementarity problems (PLCP) to End-Of-Metered-Line. As in our case for Arrival, this implies that Aldous’ algorithm can be used to solve PLCP. In fact this gives the fastest known randomized algorithm for PLCP, running in expected time for input matrices of dimension . Fearnley et al. do not make this observation themselves, but it is straightforward to check that their reduction also gives an efficient representation of the search space. Although Aldous’ algorithm is very simple, it thus non-trivially improves the best runtime of algorithms for multiple problems. We believe that this way of applying Aldous’ algorithm is a powerful technique that will produce additional results in the future.
2 Technical remarks
Recall that a switching flow is a run profile with additional superfluous circulations compared to the valid run profile. Our main technical observation is a characterization of switching flows that correspond to the valid run profile. Given a switch graph and a switching flow , we consider the subgraph induced over the railway network by the “last-used” edges; for every vertex , we include in only the outgoing edge that was, according to the switching flow, used by the train last time it left from . Note that such last-used edges can be efficiently identified simply by considering the parity of the total number of visits at every vertex. When is a valid run profile, then it is straightforward to see that the subgraph is acyclic. We show that this property is in fact a characterization, i.e., any switching flow for which the induced graph is acyclic must be a run profile. Given that this property is easy to check, we can use it to efficiently verify run profiles as witnesses. (The witness is then a run profile to the dead-end at .)
For our reduction from S-Arrival to End-Of-Metered-Line we extend the above observation to partial switching flows that are not required to end at the destination. The vertices of the End-Of-Metered-Line graph created by our reduction correspond to partial switching flows in the S-Arrival instance. The directed edges connect partial run profiles to their natural successors and predecessors, i.e., the partial run extended or shortened by a single step of the train. Any switching flow that does not correspond to some partial run profile is an isolated vertex in the End-Of-Metered-Line graph. Finally, the trivial source is the empty switching flow, and the distance from it can be computed for any partial run simply as the number of steps taken by the train so far. Given that there is only a single path in the resulting End-Of-Metered-Line graph and that its sink is exactly the complete run, we get that the unique solution to the End-Of-Metered-Line instance gives us a solution for the original instance of S-Arrival.
To make the reduction efficiently computable, we need to address the verification of partial run profiles. As it turns out, partial run profiles can be efficiently verified using the graph , in a similar way to complete run profiles discussed above. The main difference is that the graph of last-used edges for a partial run profile can contain a cycle, as the train might visit the same vertex multiple times on its route to the destination. However, we show that there is at most one cycle in , which always contains the current end-vertex of the partial run. The complete characterization of partial run profiles (which covers also full run profiles) is given in Lemma 9, and the formal reduction is described in Section 4.2.1.
Finally, we show that every partial run profile is uniquely determined by its last-used edges and its end-vertex. This limits the size of the search space for the EOML instances that are produced by our reduction, which allows us to efficiently use Aldous’ algorithm to solve Arrival and S-Arrival.
Preliminaries
A switch graph is a tuple where and .Whenever for some vertex we depict them as multiple edges in figures.
In order to avoid cumbersome notation, we slightly overload the use of and treat both as functions from vertices to edges; that is by we denote the edge for . We use this convention throughout the paper unless stated otherwise.
The Arrival problem was formally defined by Dohrau et al. as follows.
Given a switch graph and two vertices , the Arrival problem is to decide whether the algorithm Run (Algorithm 1) terminates, i.e., whether the train reaches the destination starting from the origin .
To simplify theorem statements and our proofs, we assume without loss of generality that both and end in .
A natural witness for termination of the Run procedure considered in previous work (e.g., ) is a switching flow. We extend the definition of a switching flow to allow for partial switching flows that do not necessarily end in the desired destination .
where is the indicator variable of the event in brackets.
Kirchoff’s law means that emits one unit of flow, absorbs one unit of flow, and at all other vertices, in-flow equals out-flow. If , we have a circulation.
A run profile is the switching flow returned by the algorithm Run (Algorithm 1) upon termination. A partial run profile is a partial switching flow corresponding to some intermediate value of in the algorithm Run (Algorithm 1).
Each (partial) run profile is a (partial) switching flow.
An end-vertex of a switching flow is computable in polynomial time.
It is sufficient to determine which vertex has a net in-flow of one. ∎
The Complexity of Run Profile Verification
Dohrau et al. proved that it is possible to efficiently verify whether a given vector is a switching flow. In this section we show that we can also efficiently verify whether a switching flow is a run profile. Combining this with the results by Dohrau et al. , we prove that the decision problem of Arrival is in (see Section 4.1) and that the search problem of Arrival lies in the complexity class (see Section 4.2). As outlined in Section 1.2, our approach for verification of run profiles is based on finding a cycle in a natural subgraph of the railway network defined below. Specifically, we consider the subgraph of that contains only the last visited outgoing edge of each vertex, i.e., every vertex has out-degree at most one (see Figure 1 for an illustration).
Given a partial switching flow , the graph can be computed in polynomial time.
A partial switching flow is a partial run profile iff and one of the following two conditions holds:
There exists no cycle in .
There exists exactly one cycle in and this cycle contains the end-vertex of .
The main idea of the proof is based on the following fact: a switching flow which is not a run profile must contain a circulation (as shown by Dohrau et al. ). Let be a switching flow that we get from a run profile by adding some flows on cycles, then the last added circulation (the last added cycle) must form a cycle in the corresponding graph . On the other hand, a cycle containing the end-vertex is formed in whenever the train arrives to a previously visited vertex. An illustration of the graph at consecutive steps of the algorithm Run, with the corresponding evolution of the end-vertices and cycles, is given in Figure 2.
We prove the “” implication of Lemma 9 by contradiction. Given a switching flow we consider the longest run profile that is everywhere at most . We denote the difference by . We utilize the following observation at two points in our proof. First, to prove that both and have the same end-vertex, that is . Second, to prove that any cycle we find in the intersection of and the non-zero edges of avoids .
Let be a switching flow and let be the longest partial run profile such that all coordinates are at most and denote . Then .
Suppose that either or , and that is such that the next edge for the train to continue on is . From the maximality of we get that is equal to zero. Then we get
This leads to a contradiction with the parity condition of Definition Parity Condition: as .
The other case is similar: suppose that the train should continue with the edge . From the maximality of we get that is equal to zero. And thus we get
This gives a contradiction with the parity condition of Definition Parity Condition: as . ∎
We start by proving that any partial run profile has at most one cycle and that this cycle always contains the end-vertex . We proceed by induction on the length of the run profile, i.e., the number of steps in the algorithm Run. The base case is the initial run profile for which contains no cycle. For the induction step, let us assume that a vector is a partial run profile and the vector is the partial run profile after one step from .
If contains a cycle then removing the edge from the end-vertex to its successor in produces a cycle-free graph. Adding an edge between and creates a graph with at most one cycle. Moreover, if there is a cycle then it has to contain .
To prove the reverse implication, assume we have a partial switching flow that satisfies the conditions from the statement of this lemma, i.e., has at most one cycle and if the cycle is present it contains the end-vertex . Let us denote by the longest partial run profile such that all its coordinates are at most , that is for each . Consider the difference of the switching flow and its longest run profile. We complete the proof by the following case analysis:
If the end-vertex is the same as the end-vertex (), then the difference is a flow, and moreover it is a circulation. That is the Kirchhoff’s law is satisfied in all vertices of :
If is identically zero we are done as , and thus is a partial run profile.
Otherwise, we show that the circulation will result in a cycle in . Namely we prove that contains an outgoing edge from with a non-zero value in iff has a non-zero outgoing edge in . Using this and the fact that satisfies the Kirchhoff’s law everywhere, we find a cycle in .
Let be any vertex of such that only one of the edges and is non-zero in . We claim that then the non-zero edge is contained in the graph . There are only two possible cases:
Either , and thus and (see Table 1(a)), and contains the edge ,
or , and thus and (see Table 1(b)), and contains the edge .
On the other hand, if both and are non-zero in then contains one of them. Thus we may choose any non-zero edge in which is in and proceed by another adjacent non-zero directed edge (in ) in until we construct a directed cycle in .
By the Observation 10, we know that all outgoing edges from are zero in , and thus the end-vertex is not contained in the cycle we have found.
If the end-vertex is not the same as the end-vertex () then we get a contradiction with being a partial switching flow. It follows from Observation 10 that
which is in contradiction with being a partial switching flow for which the end-vertex differs from .
It is possible to verify in polynomial time whether a vector is a run profile.
We can check that a vector is a switching flow in polynomial time due to Dohrau et al. . The construction of the graph is polynomial by Observation 8. Lemma 9 gives us a polynomial time procedure to check if is also a run profile as it is sufficient to check if contains more than one cycle or whether it has a cycle not containing the end-vertex. This check can be done by a simple modification of the standard depth-first search on . ∎
The Computational Complexity of Arrival
In this section we use our efficient structural characterization of run profiles from Lemma 9 to improve the known results about the computational complexity of Arrival. Specifically, we show that the decision version of Arrival is in and the search version is in .
Our upper bound on the decision complexity of Arrival follows directly from the work of Dohrau et al. by application of Lemma 11.
Arrival is in .
The unique certificate for a YES-instance of Arrival is the run profile returned by the algorithm Run. Clearly, for each YES-instance there exists only one such vector and does not exist for NO-instances. By Lemma 11, we can determine whether a candidate switching flow is a run profile in polynomial time.
The membership follows directly from the reduction of NO-instances of Arrival to YES-instances of Arrival as suggested by Dohrau et al. . The reduction adds to the original graph a new vertex , and for each vertex such that there is no directed path from to the destination , the edges and are replaced with edges . This alteration of the original switch graph can be performed in polynomial time. Dohrau et al. proved that the train eventually arrives either at or . The unique witness for Arrival is then a run profile from to the dead-end . ∎
2 The Search Complexity of Arrival
The search complexity of Arrival was first studied by Karthik C. S. , who introduced a total search variant of Arrival as follows.
Given a switch graph and a pair of vertices , define a graph as follows:
For each vertex such that there is no directed path from to , replace edges and with edges .
Edges , and are self-loops.
The problem S-Arrival is to find a switching flow in either from to or from to .
The above Definition 13 is motivated by the proof of membership in by Dohrau et al. . Namely, in order to ensure that a solution for S-Arrival always exists, it was necessary to add to the switch graph the dead-end vertex .
Note that our method for efficient verification of run profiles from Lemma 11 allows us to define a more natural version of S-Arrival directly on the graph without any modifications. Instead of relying on the dead-end vertices, we can use the fact that a partial run profile with an edge that was visited for times is an efficiently verifiable witness for NO-instances of Arrival.
Given a switch graph and a pair of vertices , the S-Arrival problem asks us to find one of the following:
, where is the last vertex visited by the train before it reached the end-vertex of , and
for all .
The correspondence of the above version of S-Arrival to the original one follows formally from the following lemma.
For any and a pair of vertices . Let be a run profile (thus ), then for each edge .
To argue membership of our version of S-Arrival in , we need to show that both types of solutions in Definition 14 can be verified efficiently. Solutions of the first type are simply run profiles, and we have already shown that they can be verified in polynomial time in Lemma 11. In order to be able to verify solutions of the second type, it remains to argue that for any partial run profile, the immediate predecessor of its end-vertex can be determined in polynomial time.
Let be a partial run profile after steps and be the vertex visited by the train at step . Then
either is the unique predecessor of in , or
there is a single cycle in containing and is the predecessor of on this cycle.
First, note that if is the end-vertex one step before becomes the end-vertex then must contain the edge , as it is the last edge used by the train to leave . Thus, in the first case the immediate predecessor of in the partial run is unambiguously given by the only predecessor of in .
For the second case we show that contains a directed cycle (containing the end-vertex ) and is unambiguously given by the predecessor of in that lies on . We find the cycle by constructing the longest possible directed path in without repeating vertices. Note that it cannot happen that has no outgoing edge in . Otherwise, would have two different end-vertices and (as having no outgoing edge in means that the train has never left this vertex). By Lemma 9, the directed edge from has to end in the end-vertex , or else there would be a cycle in that avoids .
The algorithm Run takes steps to generate the run profile , i.e., . Let be the function returning the last step after which a vertex was left by the train in the partial run profile . Observe that, except for the edge through which the train arrived to ,The inequality does not hold for , since has not been updated to the time yet. it holds for all edges that However, the above inequality cannot hold for all edges on the cycle , and thus has to contain the last used edge and the train had to be in at step . ∎
S-Arrival from Definition 13 reduces to simplified S-Arrival from Definition 14.
Given a solution of the second type of the simplified S-Arrival, i.e., the long run profile, we can get a run profile to in polynomial time. For each vertex we can determine whether there is an oriented path from it to the destination , and if there is no such path we set . We compute the end vertex and set . All other components of are set according to the original solution of the simplified S-Arrival. ∎
Karthik C. S. showed that S-Arrival is contained in the class . We improve this result and prove that S-Arrival is in fact contained in . As a by-product, we also obtain a randomized algorithm for S-Arrival with runtime which is the first algorithm for this problem with expected runtime for .
The class of total search problems that are amenable to “continuous” local search was defined by Daskalakis and Papadimitriou using the following canonical problem.
is the class of total search problems reducible to the following problem called CLOpt.
Given two arithmetic circuits and , and two real constants , find either a point such that or a pair of points certifying that either or is not -Lipschitz.
Instead of working with CLOpt, we use as a gateway for our reduction a problem called End-Of-Metered-Line (EOML) which was recently defined and shown to lie in by Hubáček and Yogev .
Given circuits , and such that and , find a string satisfying one of the following:
either or ,
either and or and .
The circuits from Definition 19 implicitly represent a directed graph with vertices labelled by binary strings of length , where each vertex has both out-degree and in-degree at most one. The circuit represents the predecessor and the circuit represents the successor of a given vertex as follows: there is an edge from a vertex to a vertex iff and . Finally, the circuit can be thought of as an odometer that returns the distance from the trivial source at or value for vertices lying off the path starting at the trivial source. The task in End-Of-Metered-Line is to find a sink or a source different from the trivial one at (the solutions of the second and of the third type in Definition 19 ensure that behaves as explained above).
We are now ready to present our reduction from S-Arrival to End-Of-Metered-Line.
S-Arrival can be reduced to End-Of-Metered-Line, and thus it is contained in .
Let be an instance of S-Arrival. We construct an instance of EOML that contains a vertex for each candidate partial switching flow over the switch graph , i.e., for each vector with coordinates and values from . The EOML instance will comprise of a directed path starting at the initial (empty) partial run profile . Each vertex on the path has an outgoing edge to its consecutive partial run profile. Any vertex that does not correspond to a partial run profile becomes a self-loop. Finally, the valuation circuit returns either the number of steps in the corresponding partial run profile or the zero value if the vertex does not correspond to a partial run profile.
Formal description of the circuits , , and defining the above EOML graph is given by algorithms Successor (Algorithm 2), Predecessor (Algorithm 3), and Valuation (Algorithm 4).
A polynomial bound on the size of the circuits , and follows directly from Observation 8 (computing ), Lemma 11 (testing whether a given vector is a partial run profile), Observation 6 (computing the end-vertex), and Lemma 16 (computing the previous position of the train).
Lemma 9 and Lemma 16 imply that the EOML graph indeed consists of a single directed path and isolated vertices with self-loops. By the construction of (it outputs the number of steps of the train), there are no solutions of the second or the third type (cf. Definition 19). Thus, the EOML instance has a unique solution which has to correspond to a run profile in the original S-Arrival instance or to a partial run profile certifying that the train ran for too long (see the second type of solution in Definition 14). ∎
Consider any problem that can be put into the complexity class , i.e., can be reduced to the canonical -complete problem LocalOpt (see also [13, Definition 1]):
Given circuits , and , find a string such that .
Aldous introduced the following simple algorithm that can be used to solve LocalOpt: pick binary strings uniformly and independently at random from , and let be the selected string that maximizes the value . Starting from , repeatedly move to the successor , until . He showed that the expected number of circuit evaluations performed by the algorithm before finding a local optimum is at most . Note that in the case of EOML it is possible that all sampled solutions are isolated vertices in the EOML graph. In this case the string has the best known value, and the search is started from there.
In the case of S-Arrival, the membership proof of Karthik C. S. constructs the circuits for successor and valuation with input bits [13, Theorem 2]; the EOML instance constructed in Theorem 20—proving and in particular membership—yields circuits of input bits as well. This number is too high to yield a randomized algorithm of non-trivial runtime.
This number of input bits comes from the obvious encoding of a partial run profile: each of the edges has a nonnegative integer flow value of at most . But in fact, a terminating run has at most partial run profiles, as no vertex-state pair can repeat in Algorithm 1. In other words, a partial run profile is determined by its end-vertex as well as the positions of all switches at the time of the corresponding visit of . This means that a partial run profile can be encoded with bits, and if we had a or membership proof of S-Arrival with circuits of this many inputs only, we could solve S-Arrival in time .
Next, we show that such membership proofs indeed exist. For this, we show that the above encoding (of a partial run profile by an end-vertex and the positions of all switches) can be efficiently decoded: given an end-vertex and the positions of all switches, we can efficiently compute a unique candidate for a corresponding partial run profile. The resulting encoding and decoding circuits can be composed with the ones in Theorem 20 to obtain and membership proofs with circuits of input bits, and hence yield a randomized algorithm of runtime , as explained above.
We work with instances of S-Arrival as in Definition 13, i.e., there is always a run profile either to or to . This is without loss of generality .
Note that we do not care about (the parity of) the switches at and , since the algorithm stops as soon as or is reached.
Here is the main result of this section. For a given target vertex and given parity , there is exactly one candidate for a partial run profile from to with parity . Moreover, this candidate can be computed by solving a system of linear equations.
where is the indicator variable of the event in brackets.
, i.e.,
Let us use coefficients for each for the rows corresponding to the flow conservation constraints (1), and coefficients for each for the rows corresponding to the parity constraints (2). The column of corresponding to variable , has a entry from the flow conservation constraint at , and a entry (if ) or a entry (if ) from the parity constraint at . If , there is another entry from the flow conservation constraint at . All other entries are zero. The equations that express as a linear combination of rows of are therefore the following.
We now show that there are unique coefficients satisfying these equations. Let us define and . Adding corresponding equations of (3) and (4) then yields
These are exactly the equations for the vertex values in a stoppping simple stochastic game on the graph with only average or degree-1 vertices and sinks and (stopping means that or are reachable from everywhere which is exactly what we require in a switch graph). Condon proved that these values are unique . This also determines the ’s uniquely. ∎
Conclusion and Open Problems
We showed that candidate run profiles in Arrival can be efficiently verified due to their structure. This allowed us to improve the known upper bounds for the search complexity of Arrival and S-Arrival. Here we mention some natural questions arising from our work.
Are there any non-trivial graph properties that make Arrival or S-Arrival efficiently solvable? Given that we currently do not know of any polynomial time algorithm for Arrival on general switch graphs, we could study the complexity of Arrival on some interesting restricted classes of switch graphs.
Are there other natural problems in such that their corresponding search variant is reducible to EOML? Does End-Of-Metered-Line capture the computational complexity of any problem with unique solution? Fearnley et al. recently gave a reduction from the PLCP to EOML. Given that Arrival and PLCP can be both reduced to EOML, yet another intriguing question is whether there exists any reduction between the two.
As mentioned in Section 1.1, the reduction from PLCP to EOML by Fearnley et al. implies that PLCP can be solved faster with Aldous’ algorithm than with any other known algorithm. It would be interesting to see whether Aldous’ algorithm can similarly give improved runtimes for other problems than Arrival and PLCP.
We wish to thank Karthik C. S. for helpful discussions and suggestions.