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 NP\mathsf{NP}-complete (by demonstrating that it is in NPcoNP\mathsf{NP}\cap\mathsf{coNP}), 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 NP\mathsf{NP} witness for Arrival.

The coNP\mathsf{coNP} 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 dd. The railway network can thus be altered so that all such vertices point to an additional “dead-end” vertex dˉ\bar{d}. The coNP\mathsf{coNP} witness is then simply a switching flow from the origin to the dead-end dˉ\bar{d}.

Given that the decision variant of Arrival is in NPcoNP\mathsf{NP}\cap\mathsf{coNP}, 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 TFNP\mathsf{TFNP} (which contains the search analogue of NPcoNP\mathsf{NP}\cap\mathsf{coNP}). Total search problems are classified into subclasses of TFNP\mathsf{TFNP} 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 TFNP\mathsf{TFNP} problems. He introduced S-Arrival, a search version of Arrival that seeks a switching flow to either the destination dd or the dead-end vertex d\overline{d}, and showed that it is contained in the complexity class PLS\mathsf{PLS} 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 NL\mathsf{NL}-hard.

One of the open problems suggested by Dohrau et al. was whether deciding the termination of Arrival is contained in UPcoUP\mathsf{UP}\cap\mathsf{coUP}. Recall that given a railway network with an origin oo and a destination dd, the transcript of the route of the train captured in the run profile from oo to dd (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 UPcoUP\mathsf{UP}\cap\mathsf{coUP}. We similarly also improve the upper bound on the search complexity of Arrival: We show that S-Arrival is contained in the complexity class CLS\mathsf{CLS}. Daskalakis and Papadimitriou introduced CLS\mathsf{CLS} to classify problems that can be reduced to local search over continuous domains. CLS\mathsf{CLS} 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 TFNP\mathsf{TFNP}.

We establish the containment in CLS\mathsf{CLS} 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 CLS\mathsf{CLS}. 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 PLS\mathsf{PLS}-hard, which was one of the possibilities suggested by the containment in PLS\mathsf{PLS} shown by Karthik C. S. . This is due to known black-box separations among subclasses of TFNP\mathsf{TFNP} , which suggest that CLS\mathsf{CLS} is a proper subclass of PLS\mathsf{PLS}. 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 FP\mathsf{FP}.

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 O(2n/2poly(n))\mathcal{O}(2^{n/2}poly(n)) expected time on switch graphs with nn vertices. This is the first algorithm with expected runtime O(cn)\mathcal{O}(c^{n}) for c<2c<2. (A trivial O(2npoly(n))\mathcal{O}(2^{n}poly(n)) time algorithm can be obtained by following the path of the train through the network.) Aldous’ algorithm, in fact, solves any problem in PLS\mathsf{PLS}. 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 PLS\mathsf{PLS}.

Fearnley et al. recently gave a reduction from PP-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 O(2n/2poly(n))\mathcal{O}(2^{n/2}poly(n)) for input matrices of dimension n×nn\times n. 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 GG and a switching flow ff, we consider the subgraph GG^{*} induced over the railway network by the “last-used” edges; for every vertex vv, we include in GG^{*} only the outgoing edge that was, according to the switching flow, used by the train last time it left from vv. 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 ff is a valid run profile, then it is straightforward to see that the subgraph GG^{*} is acyclic. We show that this property is in fact a characterization, i.e., any switching flow for which the induced graph GG^{*} 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 UP\mathsf{UP} witnesses. (The coUP\mathsf{coUP} witness is then a run profile to the dead-end at dˉ\bar{d}.)

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 GG^{*}, 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 GG^{*}, 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 G=(V,E,s0,s1)G=(V,E,s_{0},s_{1}) where s0,s1 ⁣:VVs_{0},s_{1}\colon V\rightarrow V and E={(v,s0(v)),(v,s1(v))vV}E=\{(v,s_{0}(v)),(v,s_{1}(v))\mid\forall v\in V\}.Whenever s0(v)=s1(v)s_{0}(v)=s_{1}(v) for some vertex vVv\in V we depict them as multiple edges in figures.

In order to avoid cumbersome notation, we slightly overload the use of s0,s1s_{0},s_{1} and treat both as functions from vertices to edges; that is by sb(v)s_{b}(v) we denote the edge (v,sb(v))(v,s_{b}(v)) for b{0,1}b\in\{0,1\}. 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 G=(V,E,s0,s1)G=(V,E,s_{0},s_{1}) and two vertices o,dVo,d\in V, the Arrival problem is to decide whether the algorithm Run (Algorithm 1) terminates, i.e., whether the train reaches the destination dd starting from the origin oo.

To simplify theorem statements and our proofs, we assume without loss of generality that both s0(d)s_{0}(d) and s1(d)s_{1}(d) end in dd.

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 dd.

where [][\cdot] is the indicator variable of the event in brackets.

Kirchoff’s law means that oo emits one unit of flow, dd absorbs one unit of flow, and at all other vertices, in-flow equals out-flow. If d=od=o, we have a circulation.

A run profile is the switching flow r\boldsymbol{r} returned by the algorithm Run (Algorithm 1) upon termination. A partial run profile is a partial switching flow corresponding to some intermediate value of r\boldsymbol{r} in the algorithm Run (Algorithm 1).

Each (partial) run profile is a (partial) switching flow.

An end-vertex vfv_{\boldsymbol{f}} of a switching flow f\boldsymbol{f} 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 UPcoUP\mathsf{UP}\cap\mathsf{coUP} (see Section 4.1) and that the search problem of Arrival lies in the complexity class CLS\mathsf{CLS} (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 GG defined below. Specifically, we consider the subgraph of GG 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 f\boldsymbol{f}, the graph GfG_{\boldsymbol{f}}^{*} can be computed in polynomial time.

A partial switching flow f\boldsymbol{f} is a partial run profile iff fs0(d)=fs1(d)=0\boldsymbol{f}_{s_{0}(d)}=\boldsymbol{f}_{s_{1}(d)}=0 and one of the following two conditions holds:

There exists no cycle in GfG_{\boldsymbol{f}}^{*}.

There exists exactly one cycle in GfG_{\boldsymbol{f}}^{*} and this cycle contains the end-vertex of f\boldsymbol{f}.

The main idea of the proof is based on the following fact: a switching flow ff which is not a run profile must contain a circulation (as shown by Dohrau et al. ). Let ff be a switching flow that we get from a run profile rr by adding some flows on cycles, then the last added circulation (the last added cycle) must form a cycle in the corresponding graph GfG^{*}_{f}. On the other hand, a cycle containing the end-vertex is formed in GfG^{*}_{f} whenever the train arrives to a previously visited vertex. An illustration of the graph GG^{*} 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 “\Leftarrow” implication of Lemma 9 by contradiction. Given a switching flow f\boldsymbol{f} we consider the longest run profile r\boldsymbol{r} that is everywhere at most f\boldsymbol{f}. We denote the difference fr\boldsymbol{f}-\boldsymbol{r} by δ\boldsymbol{\delta}. We utilize the following observation at two points in our proof. First, to prove that both f\boldsymbol{f} and r\boldsymbol{r} have the same end-vertex, that is vr=vfv_{\boldsymbol{r}}=v_{\boldsymbol{f}}. Second, to prove that any cycle we find in the intersection of GfG_{\boldsymbol{f}}^{*} and the non-zero edges of δ\boldsymbol{\delta} avoids vfv_{\boldsymbol{f}}.

Let f\boldsymbol{f} be a switching flow and let r\boldsymbol{r} be the longest partial run profile such that all coordinates are at most f\boldsymbol{f} and denote δ=fr\boldsymbol{\delta}=\boldsymbol{f}-\boldsymbol{r}. Then δs0(vr)=δs1(vr)=0\boldsymbol{\delta}_{s_{0}(v_{\boldsymbol{r}})}=\boldsymbol{\delta}_{s_{1}(v_{\boldsymbol{r}})}=0.

Suppose that either δs0(vr)0\boldsymbol{\delta}_{s_{0}(v_{\boldsymbol{r}})}\neq 0 or δs1(vr)0\boldsymbol{\delta}_{s_{1}(v_{\boldsymbol{r}})}\neq 0, and that r\boldsymbol{r} is such that the next edge for the train to continue on is s0(vr)s_{0}(v_{\boldsymbol{r}}). From the maximality of r\boldsymbol{r} we get that δs0(vr)\boldsymbol{\delta}_{s_{0}(v_{\boldsymbol{r}})} is equal to zero. Then we get

This leads to a contradiction with the parity condition of Definition Parity Condition: as fs1(vr)>fs0(vr)\boldsymbol{f}_{s_{1}(v_{\boldsymbol{r}})}>\boldsymbol{f}_{s_{0}(v_{\boldsymbol{r}})}.

The other case is similar: suppose that the train should continue with the edge s1(vr)s_{1}(v_{\boldsymbol{r}}). From the maximality of r\boldsymbol{r} we get that δs1(vr)\boldsymbol{\delta}_{s_{1}(v_{\boldsymbol{r}})} is equal to zero. And thus we get

This gives a contradiction with the parity condition of Definition Parity Condition: as fs0(vr)>fs1(vr)+1\boldsymbol{f}_{s_{0}(v_{\boldsymbol{r}})}>\boldsymbol{f}_{s_{1}(v_{\boldsymbol{r}})}+1. ∎

We start by proving that any partial run profile r\boldsymbol{r} has at most one cycle and that this cycle always contains the end-vertex vrv_{\boldsymbol{r}}. 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 02n0^{2n} for which G02nG_{0^{2n}}^{*} contains no cycle. For the induction step, let us assume that a vector ri\boldsymbol{r}^{i} is a partial run profile and the vector ri+1\boldsymbol{r}^{i+1} is the partial run profile after one step from ri\boldsymbol{r}^{i}.

If GriG_{\boldsymbol{r}^{i}}^{*} contains a cycle then removing the edge from the end-vertex vriv_{\boldsymbol{r}^{i}} to its successor in GriG_{\boldsymbol{r}^{i}}^{*} produces a cycle-free graph. Adding an edge between vriv_{\boldsymbol{r}^{i}} and vri+1v_{\boldsymbol{r}^{i+1}} creates a graph with at most one cycle. Moreover, if there is a cycle then it has to contain vri+1v_{\boldsymbol{r}^{i+1}}.

To prove the reverse implication, assume we have a partial switching flow f\boldsymbol{f} that satisfies the conditions from the statement of this lemma, i.e., GfG_{\boldsymbol{f}}^{*} has at most one cycle and if the cycle is present it contains the end-vertex vfv_{\boldsymbol{f}}. Let us denote by r\boldsymbol{r} the longest partial run profile such that all its coordinates are at most f\boldsymbol{f}, that is refe\boldsymbol{r}_{e}\leq\boldsymbol{f}_{e} for each eEe\in E. Consider the difference δ=fr\boldsymbol{\delta}=\boldsymbol{f}-\boldsymbol{r} of the switching flow and its longest run profile. We complete the proof by the following case analysis:

If the end-vertex vfv_{\boldsymbol{f}} is the same as the end-vertex vrv_{\boldsymbol{r}} (vf=vrv_{\boldsymbol{f}}=v_{\boldsymbol{r}}), then the difference δ=fr\boldsymbol{\delta}=\boldsymbol{f}-\boldsymbol{r} is a flow, and moreover it is a circulation. That is the Kirchhoff’s law is satisfied in all vertices of GG:

If δ\boldsymbol{\delta} is identically zero we are done as f=r\boldsymbol{f}=\boldsymbol{r}, and thus f\boldsymbol{f} is a partial run profile.

Otherwise, we show that the circulation δ\boldsymbol{\delta} will result in a cycle in GfG_{\boldsymbol{f}}^{*}. Namely we prove that GfG_{\boldsymbol{f}}^{*} contains an outgoing edge from vv with a non-zero value in δ\boldsymbol{\delta} iff vv has a non-zero outgoing edge in δ\boldsymbol{\delta}. Using this and the fact that δ\boldsymbol{\delta} satisfies the Kirchhoff’s law everywhere, we find a cycle in GfG_{\boldsymbol{f}}^{*}.

Let uu be any vertex of GG such that only one of the edges s0(v)s_{0}(v) and s1(v)s_{1}(v) is non-zero in δ\boldsymbol{\delta}. We claim that then the non-zero edge is contained in the graph GfG_{\boldsymbol{f}}^{*}. There are only two possible cases:

Either rs0(u)=fs0(u)\boldsymbol{r}_{s_{0}(u)}=\boldsymbol{f}_{s_{0}(u)}, and thus rs0(u)=rs1(u)1\boldsymbol{r}_{s_{0}(u)}=\boldsymbol{r}_{s_{1}(u)}-1 and fs0(u)=fs1(u)\boldsymbol{f}_{s_{0}(u)}=\boldsymbol{f}_{s_{1}(u)} (see Table 1(a)), and GfG_{\boldsymbol{f}}^{*} contains the edge s1(u)s_{1}(u),

or rs1(u)=fs1(u)\boldsymbol{r}_{s_{1}(u)}=\boldsymbol{f}_{s_{1}(u)}, and thus rs0(u)=rs1(u)\boldsymbol{r}_{s_{0}(u)}=\boldsymbol{r}_{s_{1}(u)} and fs0(u)=fs1(u)+1\boldsymbol{f}_{s_{0}(u)}=\boldsymbol{f}_{s_{1}(u)}+1 (see Table 1(b)), and GfG_{\boldsymbol{f}}^{*} contains the edge s0(u)s_{0}(u).

On the other hand, if both s0(u)s_{0}(u) and s1(u)s_{1}(u) are non-zero in δ\boldsymbol{\delta} then GfG_{\boldsymbol{f}}^{*} contains one of them. Thus we may choose any non-zero edge in δ\boldsymbol{\delta} which is in GfG_{\boldsymbol{f}}^{*} and proceed by another adjacent non-zero directed edge (in δ\boldsymbol{\delta}) in GfG_{\boldsymbol{f}}^{*} until we construct a directed cycle in GfG_{\boldsymbol{f}}^{*}.

By the Observation 10, we know that all outgoing edges from vr=vfv_{\boldsymbol{r}}=v_{\boldsymbol{f}} are zero in δ\boldsymbol{\delta}, and thus the end-vertex vfv_{\boldsymbol{f}} is not contained in the cycle we have found.

If the end-vertex vfv_{\boldsymbol{f}} is not the same as the end-vertex vrv_{\boldsymbol{r}} (vfvrv_{\boldsymbol{f}}\neq v_{\boldsymbol{r}}) then we get a contradiction with f\boldsymbol{f} being a partial switching flow. It follows from Observation 10 that

which is in contradiction with f\boldsymbol{f} being a partial switching flow for which the end-vertex vfv_{\boldsymbol{f}} differs from vrv_{\boldsymbol{r}}.

It is possible to verify in polynomial time whether a vector is a run profile.

We can check that a vector f\boldsymbol{f} is a switching flow in polynomial time due to Dohrau et al. . The construction of the graph GfG_{\boldsymbol{f}}^{*} is polynomial by Observation 8. Lemma 9 gives us a polynomial time procedure to check if f\boldsymbol{f} is also a run profile as it is sufficient to check if GfG_{\boldsymbol{f}}^{*} 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 GfG_{\boldsymbol{f}}^{*}. ∎

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 UPcoUP\mathsf{UP}\cap\mathsf{coUP} and the search version is in CLS\mathsf{CLS}.

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 UPcoUP\mathsf{UP}\cap\mathsf{coUP}.

The unique UP\mathsf{UP} certificate for a YES-instance of Arrival is the run profile r\boldsymbol{r} returned by the algorithm Run. Clearly, for each YES-instance there exists only one such vector r\boldsymbol{r} and r\boldsymbol{r} does not exist for NO-instances. By Lemma 11, we can determine whether a candidate switching flow r\boldsymbol{r} is a run profile in polynomial time.

The coUP\mathsf{coUP} 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 GG a new vertex dˉ\bar{d}, and for each vertex vVv\in V such that there is no directed path from vv to the destination dd, the edges s0(v)s_{0}(v) and s1(v)s_{1}(v) are replaced with edges (v,dˉ)(v,\bar{d}). This alteration of the original switch graph can be performed in polynomial time. Dohrau et al. proved that the train eventually arrives either at dd or dˉ\bar{d}. The unique coUP\mathsf{coUP} witness for Arrival is then a run profile from oo to the dead-end d\overline{d}. ∎

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 G=(V,E,s0,s1)G=(V,E,s_{0},s_{1}) and a pair of vertices o,dVo,d\in V, define a graph GG^{\prime} as follows:

For each vertex vv such that there is no directed path from vv to dd, replace edges s0(v)s_{0}(v) and s1(v)s_{1}(v) with edges (v,dˉ)(v,\bar{d}).

Edges s0(d),s1(d),s0(dˉ)s_{0}(d),s_{1}(d),s_{0}(\bar{d}), and s1(dˉ)s_{1}(\bar{d}) are self-loops.

The problem S-Arrival is to find a switching flow in GG^{\prime} either from oo to dd or from oo to dˉ\bar{d}.

The above Definition 13 is motivated by the proof of membership in NPcoNP\mathsf{NP}\cap\mathsf{coNP} 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 GG the dead-end vertex dˉ\bar{d}.

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 GG 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 2n+12^{n}+1 times is an efficiently verifiable witness for NO-instances of Arrival.

Given a switch graph G=(V,E,s0,s1)G=(V,E,s_{0},s_{1}) and a pair of vertices o,dVo,d\in V, the S-Arrival problem asks us to find one of the following:

r(u,v)=2n+1\boldsymbol{r}_{(u,v)}=2^{n}+1, where uu is the last vertex visited by the train before it reached the end-vertex vv of r\boldsymbol{r}, and

re2n\boldsymbol{r}_{e^{\prime}}\leq 2^{n} for all e(u,v)e^{\prime}\neq(u,v).

The correspondence of the above version of S-Arrival to the original one follows formally from the following lemma.

For any G=(V,E,s0,s1)G=(V,E,s_{0},s_{1}) and a pair of vertices o,dVo,d\in V. Let r\boldsymbol{r} be a run profile (thus vr=dv_{\boldsymbol{r}}=d), then re2n\boldsymbol{r}_{e}\leq 2^{n} for each edge eEe\in E.

To argue membership of our version of S-Arrival in TFNP\mathsf{TFNP}, 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 r\boldsymbol{r} be a partial run profile after R1R\geq 1 steps and uu be the vertex visited by the train at step R1R-1. Then

either uu is the unique predecessor of vrv_{\boldsymbol{r}} in GrG_{\boldsymbol{r}}^{*}, or

there is a single cycle in GrG_{\boldsymbol{r}}^{*} containing vrv_{\boldsymbol{r}} and uu is the predecessor of vrv_{\boldsymbol{r}} on this cycle.

First, note that if uu is the end-vertex one step before vrv_{\boldsymbol{r}} becomes the end-vertex then GrG_{\boldsymbol{r}}^{*} must contain the edge (u,vr)(u,v_{\boldsymbol{r}}), as it is the last edge used by the train to leave uu. Thus, in the first case the immediate predecessor of vrv_{\boldsymbol{r}} in the partial run r\boldsymbol{r} is unambiguously given by the only predecessor of vrv_{\boldsymbol{r}} in GrG_{\boldsymbol{r}}^{*}.

For the second case we show that GrG_{\boldsymbol{r}}^{*} contains a directed cycle CC (containing the end-vertex vrv_{\boldsymbol{r}}) and uu is unambiguously given by the predecessor of vrv_{\boldsymbol{r}} in GrG_{\boldsymbol{r}}^{*} that lies on CC. We find the cycle CC by constructing the longest possible directed path c0=vr,c1,,ckc_{0}=v_{\boldsymbol{r}},c_{1},\ldots,c_{k} in GrG_{\boldsymbol{r}}^{*} without repeating vertices. Note that it cannot happen that ckc_{k} has no outgoing edge in GrG_{\boldsymbol{r}}^{*}. Otherwise, r\boldsymbol{r} would have two different end-vertices vrv_{\boldsymbol{r}} and ckc_{k} (as having no outgoing edge in GrG_{\boldsymbol{r}}^{*} means that the train has never left this vertex). By Lemma 9, the directed edge from ckc_{k} has to end in the end-vertex vrv_{\boldsymbol{r}}, or else there would be a cycle in GrG_{\boldsymbol{r}}^{*} that avoids vrv_{\boldsymbol{r}}.

The algorithm Run takes RR steps to generate the run profile r\boldsymbol{r}, i.e., eEre=R\sum_{e\in E}\boldsymbol{r}_{e}=R. Let tr ⁣:V{0,1,,R1}t_{\boldsymbol{r}}\colon V\rightarrow\{0,1,\ldots,R-1\} be the function returning the last step after which a vertex was left by the train in the partial run profile r\boldsymbol{r}. Observe that, except for the edge through which the train arrived to vrv_{\boldsymbol{r}},The inequality does not hold for vrv_{\boldsymbol{r}}, since t(vr)t(v_{\boldsymbol{r}}) has not been updated to the time RR yet. it holds for all edges (x,y)Gr(x,y)\in G_{\boldsymbol{r}}^{*} that tr(x)<tr(x)+1tr(y).t_{\boldsymbol{r}}(x)<t_{\boldsymbol{r}}(x)+1\leq t_{\boldsymbol{r}}(y). However, the above inequality cannot hold for all edges on the cycle CC, and thus CC has to contain the last used edge and the train had to be in ckc_{k} at step R1R-1. ∎

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 r\boldsymbol{r} to dˉ\bar{d} in polynomial time. For each vertex uu we can determine whether there is an oriented path from it to the destination dd, and if there is no such path we set rs0(v)=rs1(v)=0\boldsymbol{r}_{s_{0}(v)}=\boldsymbol{r}_{s_{1}(v)}=0. We compute the end vertex vrv_{\boldsymbol{r}} and set s0(vr)=1s_{0}(v_{\boldsymbol{r}})=1. All other components of r\boldsymbol{r} are set according to the original solution of the simplified S-Arrival. ∎

Karthik C. S. showed that S-Arrival is contained in the class PLS\mathsf{PLS}. We improve this result and prove that S-Arrival is in fact contained in CLS\mathsf{CLS}. As a by-product, we also obtain a randomized algorithm for S-Arrival with runtime O(1.4143n)\mathcal{O}(1.4143^{n}) which is the first algorithm for this problem with expected runtime O(cn)\mathcal{O}(c^{n}) for c<2c<2.

The class of total search problems that are amenable to “continuous” local search was defined by Daskalakis and Papadimitriou using the following canonical problem.

CLS\mathsf{CLS} is the class of total search problems reducible to the following problem called CLOpt.

Given two arithmetic circuits f ⁣:33f\colon^{3}\rightarrow^{3} and p ⁣:3p\colon^{3}\rightarrow, and two real constants ε,λ>0\varepsilon,\lambda>0, find either a point x3x\in^{3} such that p(f(x))p(x)+εp(f(x))\leq p(x)+\varepsilon or a pair of points x,x3x,x^{\prime}\in^{3} certifying that either pp or ff is not λ\lambda-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 CLS\mathsf{CLS} by Hubáček and Yogev .

Given circuits S,P ⁣:{0,1}m{0,1}mS,P\colon\{0,1\}^{m}\rightarrow\{0,1\}^{m}, and V ⁣:{0,1}m[2m]{0}V\colon\{0,1\}^{m}\rightarrow[2^{m}]\cup\{0\} such that P(0m)=0mS(0m)P(0^{m})=0^{m}\neq S(0^{m}) and V(0m)=1V(0^{m})=1, find a string x{0,1}mx\in\{0,1\}^{m} satisfying one of the following:

either P(S(x))xP(S(x))\neq x or S(P(x))x0mS(P(x))\neq x\neq 0^{m},

either V(x)>0V(x)>0 and V(S(x))V(x)1V(S(x))-V(x)\neq 1 or V(x)>1V(x)>1 and V(x)V(P(x))1V(x)-V(P(x))\neq 1.

The circuits S,PS,P from Definition 19 implicitly represent a directed graph with vertices labelled by binary strings of length mm, where each vertex has both out-degree and in-degree at most one. The circuit PP represents the predecessor and the circuit SS represents the successor of a given vertex as follows: there is an edge from a vertex uu to a vertex vv iff S(u)=vS(u)=v and P(v)=uP(v)=u. Finally, the circuit VV can be thought of as an odometer that returns the distance from the trivial source at 0m0^{m} 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 0m0^{m} (the solutions of the second and of the third type in Definition 19 ensure that VV 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 CLS\mathsf{CLS}.

Let (G,o,d)(G,o,d) 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 GG, i.e., for each vector with 2n2n coordinates and values from [2n+1]{0}[2^{n}+1]\cup\left\{0\right\}. The EOML instance will comprise of a directed path starting at the initial (empty) partial run profile 02n0^{2n}. 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 VV 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 SS, PP, and VV 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 S,PS,P, and VV follows directly from Observation 8 (computing GG^{*}), 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 VV (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 PLS\mathsf{PLS}, i.e., can be reduced to the canonical PLS\mathsf{PLS}-complete problem LocalOpt (see also [13, Definition 1]):

Given circuits S ⁣:{0,1}m{0,1}mS\colon\{0,1\}^{m}\rightarrow\{0,1\}^{m}, and V ⁣:{0,1}m[2m]{0}V\colon\{0,1\}^{m}\rightarrow[2^{m}]\cup\{0\}, find a string x{0,1}mx\in\{0,1\}^{m} such that V(x)V(S(x))V(x)\geq V(S(x)).

Aldous introduced the following simple algorithm that can be used to solve LocalOpt: pick 2m/22^{m/2} binary strings uniformly and independently at random from {0,1}m\{0,1\}^{m}, and let xmaxx_{\max} be the selected string that maximizes the value V(x)V(x). Starting from x=xmaxx=x_{\max}, repeatedly move to the successor S(x)S(x), until V(x)V(S(x))V(x)\geq V(S(x)). He showed that the expected number of circuit evaluations performed by the algorithm before finding a local optimum is at most O(m2m/2)\mathcal{O}(m2^{m/2}). 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 0m0^{m} string has the best known value, and the search is started from there.

In the case of S-Arrival, the PLS\mathsf{PLS} membership proof of Karthik C. S. constructs the circuits for successor and valuation with O(n2)\mathcal{O}(n^{2}) input bits [13, Theorem 2]; the EOML instance constructed in Theorem 20—proving CLS\mathsf{CLS} and in particular PLS\mathsf{PLS} membership—yields circuits of O(n2)\mathcal{O}(n^{2}) input bits as well. This number is too high to yield a randomized algorithm of non-trivial runtime.

This number of O(n2)\mathcal{O}(n^{2}) input bits comes from the obvious encoding of a partial run profile: each of the 2n2n edges has a nonnegative integer flow value of at most 2n+12^{n}+1. But in fact, a terminating run has at most n2nn2^{n} partial run profiles, as no vertex-state pair (v,s_curr)(v,s\_\text{curr}) can repeat in Algorithm 1. In other words, a partial run profile f\boldsymbol{f} is determined by its end-vertex vfv_{\boldsymbol{f}} as well as the positions of all switches at the time of the corresponding visit of vfv_{\boldsymbol{f}}. This means that a partial run profile can be encoded with n+log2nn+\log_{2}n bits, and if we had a PLS\mathsf{PLS} or CLS\mathsf{CLS} membership proof of S-Arrival with circuits of this many inputs only, we could solve S-Arrival in time O(poly(n)×2n/2)O(\mathop{\rm poly}(n)\times 2^{n/2}).

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 PLS\mathsf{PLS} and CLS\mathsf{CLS} membership proofs with circuits of n+log2nn+\log_{2}n input bits, and hence yield a randomized algorithm of runtime O(poly(n)×2n/2)=O(1.4143n)O(\mathop{\rm poly}(n)\times 2^{n/2})=O(1.4143^{n}), as explained above.

We work with instances of S-Arrival as in Definition 13, i.e., there is always a run profile either to dd or to dˉ\bar{d}. This is without loss of generality .

Note that we do not care about (the parity of) the switches at dd and dˉ\bar{d}, since the algorithm stops as soon as dd or dˉ\bar{d} is reached.

Here is the main result of this section. For a given target vertex tVt\in V and given parity p\boldsymbol{p}, there is exactly one candidate for a partial run profile from oo to tt with parity p\boldsymbol{p}. Moreover, this candidate can be computed by solving a system of linear equations.

where [][\cdot] is the indicator variable of the event in brackets.

pf=p\boldsymbol{p}_{\boldsymbol{f}}=\boldsymbol{p}, i.e.,

Let us use coefficients λv\lambda_{v} for each vVv\in V^{\prime} for the rows corresponding to the flow conservation constraints (1), and coefficients μv\mu_{v} for each vVv\in V^{\prime} for the rows corresponding to the parity constraints (2). The column of AA corresponding to variable f(v,si(v))\boldsymbol{f}_{(v,s_{i}(v))}, has a 1-1 entry from the flow conservation constraint at vv, and a 11 entry (if i=0i=0) or a 1-1 entry (if i=1i=1) from the parity constraint at vv. If si(v)d,dˉs_{i}(v)\neq d,\bar{d}, there is another 11 entry from the flow conservation constraint at si(v)s_{i}(v). All other entries are zero. The equations that express q\boldsymbol{q} as a linear combination of rows of AA are therefore the following.

We now show that there are unique coefficients λv,μv\lambda_{v},\mu_{v} satisfying these equations. Let us define λd=1\lambda_{d}=1 and λdˉ=0\lambda_{\bar{d}}=0. 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 GG with only average or degree-1 vertices and sinks dd and dˉ\bar{d} (stopping means that dd or dˉ\bar{d} 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 μv\mu_{v}’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 UPcoUP\mathsf{UP}\cap\mathsf{coUP} such that their corresponding search variant is reducible to EOML? Does End-Of-Metered-Line capture the computational complexity of any TFNP\mathsf{TFNP} 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.

References