The Complexity of Finding Small Separators in Temporal Graphs

Temporal graphs are graphs with time-stamped edges. We study the problem of finding a small vertex set (the separator) with respect to two designated terminal vertices such that the removal of the set eliminates all temporal paths connecting one terminal to the other. Herein, we consider two models of temporal paths: paths that pass through arbitrarily many edges per time step (non-strict) and paths that pass through at most one edge per time step (strict). Regarding the number of time steps of a temporal graph, we show a complexity dichotomy (NP-hardness versus polynomial-time solvability) for both problem variants. Moreover we prove both problem variants to be NP-complete even on temporal graphs whose underlying graph is planar. We further show that, on temporal graphs with planar underlying graph, if additionally the number of time steps is constant, then the problem variant for strict paths is solvable in quasi-linear time. Finally, we introduce and motivate the notion of a temporal core (vertices whose incident edges change over time). We prove that the non-strict variant is fixed-parameter tractable when parameterized by the size of the temporal core, while the strict variant remains NP-complete, even for constant-size temporal cores.


Introduction
In complex network analysis, it is nowadays very common to have access to and process graph data where the interactions among the vertices are time-stamped. When using static graphs as a mathematical model, the dynamics of interactions are not reflected and important information of the data might not be captured. Temporal graphs address this issue. A temporal graph is, informally speaking, a graph where the edge set may change over a discrete time interval, while the vertex set remains unchanged. Having the dynamics of interactions represented in the model, it is essential to adapt definitions such as connectivity and paths to respect temporal features. This directly affects the notion of separators in the temporal setting. Vertex separators are a fundamental primitive in static network analysis and it is well-known that they can be computed in polynomial time (see, e.g., proof of [1, Theorem 6.8] ). In contrast to the static case, Kempe et al. [27] showed that in temporal graphs it is NP-hard to compute minimum separators.
networks [9], and edge-scheduled networks [8]. In this work, we use the well-established model in which each edge has a time stamp [2,4,9,24,26,27,32]. Assuming discrete time steps, this is equivalent to a sequence of static graphs over a fixed set of vertices [33]. Formally, we define a temporal graph as follows.
See Figure 1 for an example with τ = 4, that is, a temporal graph with four time steps, also referred to as layers. The static graph obtained from a temporal graph G by removing the time stamps from all time-edges we call the underlying graph of G.
Many real-world applications have temporal graphs as underlying mathematical model. For instance, it is natural to model connections in public transportation networks with temporal graphs. Other examples include information spreading in social networks, communication in social networks, biological pathways, or spread of diseases [26].
A fundamental question in temporal graphs, addressing issues such as connectivity [6,32], survivability [29], and robustness [36], is whether there is a "time-respecting" path from a distinguished start vertex s to a distinguished target vertex z. 1 We provide a thorough study of the computational complexity of separating s from z in a given temporal graph.
Moreover, we study two natural restrictions of temporal graphs: (i) planar temporal graphs and (ii) temporal graphs with a bounded number of vertices incident to edges that are not permanently existing-these vertices form the so-called temporal core. Both restrictions are naturally motivated by settings e.g. occurring in (hierarchical) traffic networks. We also consider two very similar but still significantly differing temporal path models (both used in the literature), leading to two corresponding models of temporal separation.
Our second path model is the "strict" variant. A temporal (s, z)-path P is called strict if t i < t i+1 for all i ∈ {1, . . . , −1}. In the literature, strict temporal paths are also known as journeys [2,3,32,33]. 2 A vertex set S is a strict temporal (s, z)-separator if there is no strict temporal (s, z)-path in G − S. Thus, our second main problem, Strict Temporal (s, z)-Separation, is defined in complete analogy to Temporal (s, z)-Separation, just replacing (non-strict) temporal separators by strict ones.
While the strict version of temporal separation immediately appears as natural, the non-strict variant can be viewed as a more conservative version of the problem. For instance, in a diseasespreading scenario the spreading speed might be unclear. To ensure containment of the spreading by separating patient zero (s) from a certain target (z), a temporal (s, z)-separator might be the safer choice.
Main results. Table 1 provides an overview on our results. A central contribution is to prove that both Temporal (s, z)-Separation and Strict Temporal (s, z)-Separation are NP-complete for all τ ≥ 2 and τ ≥ 5, respectively, strengthening a result by Kempe et al. [27] (they show NP-hardness of both variants for all τ ≥ 12 ). For Temporal (s, z)-Separation, our hardness result is already tight. 3 For the strict variant, we identify a dichotomy in the computational complexity by proving polynomial-time solvability of Strict Temporal (s, z)-Separation for τ ≤ 4. Moreover, we prove that both problems remain NP-complete on temporal graphs that have an underlying graph that is planar.
We introduce the notion of temporal cores in temporal graphs. Informally, the temporal core of a temporal graph is the set of vertices whose edge-incidences change over time. We prove that Temporal (s, z)-Separation is fixed-parameter tractable (FPT) when parameterized by the size of the temporal core, while Strict Temporal (s, z)-Separation remains NP-complete even if the temporal core is empty.
A particular aspect of our results is that they demonstrate that the choice of the model (strict versus non-strict) for a problem can have a crucial impact on the computational complexity of said problem. This contrasts with wide parts of the literature where both models were used without discussing the subtle but crucial differences in computational complexity.
Technical contributions. To show the polynomial-time solvability of Strict Temporal (s, z)-Separation for τ ≤ 4, we prove that a classic separator result of Lovász et al. [30] translates to the strict temporal setting. This is surprising since many other results about separators in the static case do not apply in the temporal case. In this context, we also develop a linear-time algorithm for Single-Source Shortest Strict Temporal Paths, improving the running time of the best known algorithm due to Wu et al. [39] by a logarithmic factor.
We settle the complexity of Length-Bounded (s, z)-Separation on planar graphs by showing its NP-hardness, which was left unanswered by Fluschnik et al. [19] and promises to be a valuable intermediate problem for proving hardness results. In the hardness reduction for Length-Bounded (s, z)-Separation we introduce a grid-like, planarity-preserving vertex gadget that is generally useful to replace "twin" vertices which in many cases are not planarity-preserving and which are often used to model weights.
While showing that Temporal (s, z)-Separation is fixed-parameter tractable when parameterized by the size of the temporal core, we employ a case distinction on the size of the temporal core, and show that in the non-trivial case we can reduce the problem to Node Multiway Cut. We identify an "above lower bound parameter" for Node Multiway Cut that is suitable to lower-bound the size of the temporal core, thereby making it possible to exploit a fixed-parameter tractability result due to Cygan et al. [14].
Related work. Our most important reference is the work of Kempe et al. [27] who proved that Temporal (s, z)-Separation is NP-hard. In contrast, Berman [8] proved that computing temporal (s, z)-cuts (edge deletion instead of vertex deletion) is polynomial-time solvable. In the context of survivability of temporal graphs, Liang and Modiano [29] studied cuts where an edge deletion only lasts for δ consecutive time stamps. Moreover, they studied a temporal maximum flow defined as the maximum number of sets of journeys where each two journeys in a set do not use a temporal edge within some δ time steps. A different notion of temporal flows on temporal graphs was introduced by Akrida et al. [3]. They showed how to compute in polynomial time the maximum amount of flow passing from a source vertex s to a sink vertex z until a given point in time.
The vertex-variant of Menger's Theorem [31] states that the maximum number of vertex-disjoint paths from s to z equals the size of a minimum-cardinality (s, z)-separator. In static graphs, Menger's Theorem allows for finding a minimum-cardinality (s, z)-separator via maximum flow computations. However, Berman [8] proved that the vertex-variant of an analogue to Menger's Theorem for temporal graphs, asking for the maximum number of (strict) temporal paths instead, does not hold. Kempe et al. [27] proved that the vertex-variant of the former analogue to Menger's Theorem holds true if the underlying graph excludes a fixed minor. Mertzios et al. [32] proved another analogue of Menger's Theorem: the maximum number of strict temporal (s, z)-path which never leave the same vertex at the same time equals the minimum number of node departure times needed to separate s from z, where a node departure time (v, t) is the vertex v at time point t.
Michail and Spirakis [34] introduced the time-analogue of the famous Traveling Salesperson problem and studied the problem on temporal graphs of dynamic diameter d ∈ N, that is, informally speaking, on temporal graphs where every two vertices can reach each other in at most d time steps at any time. Erlebach et al. [16] studied the same problem on temporal graphs where the underlying graph has bounded degree, bounded treewidth, or is planar. Additionally, they introduced a class of temporal graphs with regularly present edges, that is, temporal graphs where each edge is associated with two integers upper-and lower-bounding consecutive time steps of edge absence. Axiotis and Fotakis [6] studied the problem of finding the smallest temporal subgraph of a temporal graph such that single-source temporal connectivity is preserved on temporal graphs where the underlying graph has bounded treewidth. In companion work, we recently studied the computational complexity of (non-strict) temporal separation on several other restricted temporal graphs [20].

Preliminaries
Let N denote the natural numbers without zero. For n ∈ N, we use Static graphs. We use basic notations from (static) graph theory [15]. Let G = (V, E) be an undirected, simple graph. We use V (G) and E(G) to denote the set of vertices and set of edges of G, respectively. We denote by We say that G is connected if its underlying graph G ↓ is connected. For surveys concerning temporal graphs we refer to [10,25,26,28,33].
Regarding our two models, we have the following connection: There is a linear-time computable many-one reduction from Strict Temporal (s, z)-Separation to Temporal (s, z)-Separation that maps any instance (G = (V, E, τ ), s, z, k) to an instance (G = (V , E , τ ), s, z, k ) with k = k and τ = 2 · τ .
Proof. Let I = (G = (V, E, τ ), s, z, k) be an instance of Strict Temporal (s, z)-Separation. We construct an equivalent instance We claim that I is a yes-instance if and only if I is a yes-instance.
⇒: Let S be a temporal (s, z)-separator in G of size at most k. We claim that S is also a temporal (s, z)-separator in G . Suppose towards a contradiction that this is not the case. Then there is a temporal (s, z)-path P in G − S. Note that the vertices on P alternated between vertices in V and V E . As each vertex in V E corresponds to an edge, there is a temporal (s, z)-path in G − S induced by the vertices of V (P ) ∩ V . This is a contradiction. ⇐: Observe that from any temporal (s, z)-separator, we can obtain a temporal (s, z)-separator of not larger size that only contains vertices in V . Let S be a temporal (s, z)-separator in G of size at most k only containing vertices in S. We claim that S is also a temporal (s, z)-separator in G .
Suppose towards a contradiction that this is not the case. Then there is a temporal (s, z) path P in G − S . Note that we can obtain a temporal (s, z)-path P in G − S by adding for all consecutive vertices v, w, where v appears before w at time-step t on P , the vertex e (v,w),t . This is a contradiction.
Throughout the paper we assume that the underlying graph of the temporal input graph G is connected and that there is no time-edge between s and z. Furthermore, in accordance with Wu et al. [39] we assume that the time-edge set E is ordered by ascending time stamps.

The Maximum Label is Bounded in the Input Size
In the following, we prove that for every temporal graph in an input to (Strict) Temporal (s, z)-Separation, we can assume that the number of layers is at most the number of time-edges. Observe that a layer of a temporal graph that contains no edge is irrelevant for Temporal (s, z)-Separation. This also holds true for the strict case. Hence, we can delete such a layer from the temporal graph. This observation is formalized in the following two data reduction rules.
Reduction Rule 2.2. Let G = (V, E, τ ) be a temporal graph. If there is a non-empty interval [t 1 , τ ] where for all t ∈ [t 1 , τ ] the layer G t is an edgeless graph, then set τ to t 1 − 1.
We prove next that both reduction rules are exhaustively applicable in linear time. Proof. First we discuss Reduction Rule 2.
be an interval where for all t ∈ [t α , t β ] the layer G t is an edgeless graph. Let P = ((e 1 , t 1 ), . . . , (e i , t i ), (e i+1 , t j ), . . . , (e n , t n )) be a temporal (s, z)-path, and let G be the graph after we applied Reduction Rule 2.1 once on G. We distinguish three cases. Case 1: If t β > t n , then no time-edge of P is touched by Reduction Rule 2.1. Hence, P also exists in G . (b) Reduction Rule 2.1 is not applicable Figure 2: Figure 2a shows a temporal graph where Reduction Rule 2.1 is applicable. In particular, layers 3, 4, 5, 6 are edgeless. Figure 2b shows the same temporal graph after Reduction Rule 2.1 was applied exhaustively.
The other direction works analogously. We look at a temporal (s, z)-path in G and compute the corresponding temporal (s, z)-path in G. Reduction Rule 2.1 can be exhaustively applied by iterating over the by time-edges (e i , t i ) in the time-edge set E ordered by ascending labels until the first t 1 , t 2 with the given requirement appear. Set x 0 := −t 2 +t 1 −1. Then we iterate further over E and replace each time-edge (e, t) with (e, t+x 0 ) until the next t 1 , t 2 with the given requirement appear. Then we set x 1 = x 0 − t 2 + t 1 − 1 and iterate further over E and replace each time-edge (e, t) with (e, t + x 1 ). We repeat this procedure until the end of E is reached. Since we iterate over E only once, this can be done in O(|E|) time.
Reduction Rule 2.2 can be executed in linear time by iterating over all edges and taking the maximum label as t 1 . Note that the sets V and E remain untouched by Reduction Rule 2.2. Hence, the application of Reduction Rule 2.2 does not add or remove any temporal (s, z)-path.
A consequence of Lemma 2.2 is that the maximum label τ can be upper-bounded by the number of time-edges and hence the input size.

Hardness Dichotomy Regarding the Number of Layers
In this section we settle the complexity dichotomy of both Temporal (s, z)-Separation and Strict Temporal (s, z)-Separation regarding the number τ of time steps. We observe that both problems are strongly related to the following NP-complete [11,37] problem: An undirected graph G = (V, E), distinct vertices s, z ∈ V , and k, ∈ N. Question: Is there a subset S ⊆ V \ {s, z} such that |S| ≤ k and there is no (s, z)-path in G − S of length at most ?
Length-Bounded (s, z)-Separation is NP-complete even if the lower bound for the path length is five [7] and W[1]-hard with respect to the postulated separator size [22]. We obtain the following, improving a result by Kempe et al. [27] who showed NP-completeness of Temporal (s, z)-Separation and Strict Temporal (s, z)-Separation for all τ ≥ 12.  We remark that our NP-hardness reduction for Temporal (s, z)-Separation is inspired by Baier et al. [7,Theorem 3.9].
Proof. To show NP-completeness of Temporal (s, z)-Separation for τ = 2 we present a reduction from the Vertex Cover problem where, given a graph G = (V, E) and an integer k, the task is to determine whether there exists a set V ⊆ V of size at most k such that G − V does not contain any edge.
We refine the gadget of Baier et al. [7,Theorem 3.9] and reduce from Vertex Cover to Temporal (s, z)-Separation.
Let I := (G = (V, E), k) be a Vertex Cover instance and n := |V |. We construct a Temporal (s, z)-Separation instance I : z} are the vertices and the time-edges are defined as Note that |V | = 3 · n + 2, |E | = 6 · |V | + 2 · |E|, and I can be computed in polynomial time.
For each vertex v ∈ V there is a vertex gadget which consists of three vertices s v , v, z v and six vertex-edges. In addition, for each edge {v, w} ∈ E there is an edge gadget which consists of two edge-edges {s v , z w } and {z v , s w }. See Figure 3 for an example.
Correctness. We prove that I is a yes-instance if and only if I is a yes-instance.
There are |V | − |X| = n − k vertices not in the vertex cover X and for each of them there is exactly one vertex in S. For each vertex in the vertex cover X there are two vertices in S. Hence, |S| = n − k + 2k ≤ n + k. First, we consider the vertex-gadget of a vertex v ∈ V . Note that in the vertex-gadget of v, there are two distinct temporal (s, z)-separators {v} and {s v , z v }. Hence, every temporal (s, z)-path in G −S contains an edge-edge. Second, let e = {v, w} ∈ E and let P e and P e be the temporal (s, z)paths which contain the edge-edges of edge-gadget of e such that V (P e ) = {s, s v , z w , z} and V (P e ) = {s, s w , z v , z}. Since X is a vertex cover of G we know that at least one element of e is in X. Thus, s v , z v ∈ S or s w , z w ∈ S, and hence neither P e nor P e exist inĜ − S. It follows that S is a temporal (s, z)-separator in G of size at most n + k, as there are no other temporal (s, z)-paths in G . ⇐: Let S be a temporal (s, z)-separator in G of size ≤ n + k and let v ∈ V . Recall that there are two distinct temporal (s, z)-separators in the vertex gadget of v, namely {v} and {s v , z v }, and that all vertices in V \ {s, z} are from a vertex gadget. Hence, is of the form = n + k ≤ n + k. We start with a preprocessing to ensure that for vertex gadget only one of these two separators are in S.
That is a complete case distinction because neither {s v } nor {z v } separate all temporal (s, z)-paths in the vertex gadget in v. Now we construct a vertex cover X for G by taking v into X if both s v and z v are in S. Since there are n vertex gadgets in G each containing either one or two vertices from S, it follows that |X| = |S| − n = k ≤ k, Assume towards a contradiction that X is not a vertex cover of G. Then there is an edge {v, w} ∈ E where v, w ∈ X. Hence, s v , z v , s w , z w ∈ S and v, w ∈ S. This contradicts the fact that S is a temporal (s, z)-separator in G , because P = (({s, s v }, 1), ({s v , z w }, 1), ({z w , z}, 2)) is a temporal (s, z)-path in G − S. It follows that X is a vertex cover of G of size at most k.
In the remainder of this section we prove that the bound on τ is tight in the strict case (for the non-strict case the tightness is obvious). This is the first case where we can observe a significant difference between the strict and the non-strict variant of our separation problem. In order to do so, we have to develop some tools which we need in subroutines. In Section 3.1, we introduce a common tool to study reachability in temporal graphs on directed graphs. This helps us to solve the Single-Source Shortest Strict Temporal Paths efficiently (Proposition 3. 4). Note that this might be of independent interest since it improves known algorithms, see Section 3.2. Afterwards, in Section 3.3, we prove that Strict Temporal (s, z)-Separation can be solved in polynomial time, if the maximum label τ ≤ 4.

Strict Static Expansion
A key tool [3,8,27,32,39] is the time-expanded version of a temporal graph which reduces reachability and other related questions in temporal graphs to similar questions in directed graphs.
Here, we introduce a similar tool for strict temporal (s, z)-paths.
Observe that each strict temporal (s, z)-path in G has a one-to-one correspondence to some (s, z)-path in H. We refer to Figure 4 for an example. an empty linked list. Second, we iterate over the set E with non-decreasing labels and for each As a subroutine hidden in several of our algorithms, we need to solve the Single-Source Shortest Strict Temporal Paths problem on temporal graphs: find shortest strict paths from a source vertex s to all other vertices in the temporal graph. Herein, we say that a strict temporal (s, z)-path is shortest if there is no strict temporal (s, z)-path of length < . Indeed, we provide a linear-time algorithm for this. We believe this to be of independent interest; it improves (with few adaptations to the model; for details see Section 3.2) previous results by Wu et al. [39], but in contrast to the algorithm of Wu et al. [39] our subroutine cannot be adjusted to the non-strict case. The following proof makes use of a strict static expansion of a temporal graph. See Sec. 3.1 for more details.

Adaptation of Proposition 3.4 for the Model of Wu et al. [39]
Wu et al. [39] considered a model where the temporal graph is directed and a time-edge e has a traversal time φ(e) ∈ N ∪ {0}. In the context of strict temporal path φ(e) is always one. They excluded the case where φ(e) = 0, but pointed out that their algorithms can be adjusted to allow φ(e) = 0. However, this is not possible for our algorithm, because then the strict static expansion can contain cycles. Hence, we assume that φ(e) > 0 for all directed time-edges e.
Let G = (V, E, τ ) be a directed temporal graph. We denote a directed time-edge from v to w in layer t by ((v, w), t) ∈ E. First, we initiate τ many linked lists. Without loss of generality we assume that τ ≤ |E|, see Lemma 2. 3. Second, we construct a directed temporal graph G = (V , E , τ ), where V = V and E is empty in the beginning. Then we iterate over the time-edge set E by ascending labels. If ((v, w) the original edge of (v, w) and ((x (v,w) , w), t ) the connector edge of (v, w). If we reach a directed time-edge with label t for the first time, then we add all directed time-edges from the t-th linked list to E . Observe that for each strict temporal (s, z)-path in G there is a corresponding strict temporal (s, z)-path in G , additionally we have that E is ordered by ascending labels and that G can be constructed in O(|E|) time.
To construct a strict static expansion for a directed temporal graph G, we modify the edge Finally, we adjust the weight function ω from the algorithm of Proposition 3.4 such that ω(e) = 0 if e is a columnedges of correspond to a connector-edges, and ω(e) = φ(e) otherwise. Observe that for a strict temporal (s, z)-path P = (e 1 , . . . , e ) of traversal time i=1 φ(e i ) the corresponding (s, z)-path in the strict static expansion is of weight of the traversal time of P . Our algorithm behind Theorem 3.6 executes the following steps: 1. As a preprocessing step, remove unnecessary time-edges and vertices from the graph. 2. Compute an auxiliary graph called directed path cover graph of the temporal graph. 3. Compute a separator for the directed path cover graph. In the following, we explain each of the steps in more detail.
The preprocessing reduces the temporal graph such that it has the following properties. A temporal graph G = (V, E, τ ) with two distinct vertices s, z ∈ V is reduced if (i) the underlying graph G ↓ is connected, (ii) for each time-edge e ∈ E there is a strict temporal (s, z)-path which contains e, and (iii) there is no strict temporal (s, z)-path of length at most two in G. This preprocessing step can be performed in polynomial time: The following proof makes use of a strict static expansion of a temporal graph. See Sec. 3.1 for more details. We claim that for each time-edge in E there is a strict temporal (s, z)-path in G which contains it. Let e = ({v j , v j }, i) ∈ E and assume towards a contradiction that there is no strict temporal (s, z)-path P in G which contains e. From the construction of G we know . Hence, there is an (s, z)-path in H which contains either (x (i−1),j , x i,j ) or (x (i−1),j , x i,j ). Thus, there is a corresponding strict temporal (s, z)-path in G as well as in G which contains ({v j , v j }, i). This is a contradiction.
Furthermore, we claim that a strict temporal (s, z)-path P in G if and only if P is a strict temporal (s, z)-path in G . Let P be a strict temporal (s, z)-path in G. Since P is a strict temporal (s, z)-path in G there is a corresponding (s, z)-path P in H. Note that P is a witness that all vertices in V (P ) are in R(s) as well as in R(z). It follows from the construction of G that P is also a strict temporal (s, z)-path in G . The other direction works analogously.
Let P be a strict temporal (s, z)-path in G of length two, where V (P ) = {s, z, v}. One can observe that each strict temporal (s, z)-separator must contain v. By Proposition 3.4, we can compute the shortest strict temporal (s, z)-path P s in G in O(|E|) time and check whether P s is of length two. If this is the case, then we remove vertex v ∈ V (P s ) \ {s, z} and decrease k by one. Note that I is a no-instance if we can find k + 1 vertex-disjoint strict temporal (s, z)-paths of length two and that, this can be done in O(k · |E|) time.
If we have not decided yet whether I is a yesor no-instance, then we construct the Strict Temporal (s, z)-Separation instance I = (G = (V , E , τ ), s, z, k ), where k is k minus the number of vertex-disjoint strict temporal (s, z)-path of length two we have found.
Finally, observe that I is a yes-instance if and only if I is a yes-instance, G is reduced, and that we only removed vertices and time-edges. Thus, |V | ≤ |V | and |E | ≤ |E|.

Efficient Algorithm for Strict Temporal (s, z)-Separation with Few Layers
Now we are all set to show the following result. Lovász et al. [30] showed that the minimum size of an (s, z)-separator for paths of length at most four in a graph is equal to the number of vertex-disjoint (s, z)-paths of length at most four in a graph. We adjust their idea to strict temporal paths on temporal graphs. The proof of Lovász et al. [30] implicitly relies on the transitivity of connectivity in static graphs. This does not hold for temporal graphs; hence, we have to put in some extra effort to adapt their result to the temporal case. To this end, we define a directed auxiliary graph.  2) and w ∈ V (2,1) , v = s and w ∈ V (1,j) , or w = z and v ∈ V (i,1) for some i, j ∈ {2, 3}. Herein, a vertex x ∈ V is in the set V (i,j) if the shortest strict temporal (s, x)-path is of length i and the shortest strict temporal (x, z)-path is of length j. Figure 5 depicts a generic directed path cover graph of a reduced temporal graph with τ = 4. Note that due to the definition of reduced temporal graphs, one can prove that the set V (1,1) is always empty, and hence not depicted in Figure 5. This is a crucial property that allows us to prove the following. We introduce some notation we will use in the following proof. The departure time (arrival time) of a temporal (s, z)-path P = ((e 1 , t 1 ), . . . , (e , t )) is t 1 (t ), the traversal time of P is t − t 1 , and the length of P is .  ). If P is not a shortest strict temporal (v, z)-path in G, then there is a shorter strict temporal (v, z)-path P in G. We say that a strict temporal (s, z)-path P of length n in G is chordless if G[V (P )] does not contain a strict temporal (s, z)-path P of length n − 1. If such a P exists, we call P a chord of P . Obviously, for a set X of vertices, if G−X does not contain any chordless strict temporal (s, z)-path, then G − X does not contain any strict temporal (s, z)-path. Now, we discuss the appearance of the directed path cover graph D. Assume towards a contradiction that there is a vertex v ∈ V (1,1) . Since G is reduced, there is no strict temporal (s, z)-paths of length two. Thus, if there is a vertex v ∈ V (1,1) , then there must be time-edges ({s, v}, t 1 ) and ({v, z}, t 2 ) such that t 2 ≤ t 1 . We distinguish two cases.
Case 1: Let t 2 ≤ 2 ≤ t 1 . Since G is reduced, we know that there is a strict temporal (s, z)-path P which contains ({v, z}, t 2 ). The strict temporal (s, z)-path P must be of length at least three, because G is reduced Observe that the length of a strict temporal (s, z)-path is a lower bound for the arrival time. Hence, the arrival time of P is at least three. This is a contradiction because ({v, z}, t 2 ) is the last time-edge of P and, therefore, t 2 ≤ 2 is equal to the arrival time. Consequently, v / ∈ V (1,1) .
Since G is reduced, we know that there is a strict temporal (s, z)-path P which contains ({s, v}, t 1 ). The strict temporal (s, z)-path P must be of length at least three because G is reduced. Observe that ({s, v}, t 1 ) is the first time-edge of P . Hence, the departure time of P is at least three. Since, P is of length at least three, the arrival time of P is at least five. This is a contradiction because the maximum label is four. Consequently, v / ∈ V (1,1) .
Observe that the sets V (1, 3) , V (2,2) , V (3,1) , V (1, 2) , V (2,1) are a partition of V \ {s, t}, because all strict temporal (s, z)-paths are of length at most four and V (1,1) = ∅. In Figure 5, we can see the appearance of the directed path cover graph D from s to z of G.
We claim that for each chordless strict temporal (s, z)-path P in G, there is an (s, z)-path P D such that V (P ) = V (P D ). Let P be a chordless strict temporal (s, z)-path in G. Since G is reduced, P is of length three or four.
Case 1: Let the length of P be three and Since there is no strict temporal (s, z)-path of length two, P forces v 1 into V (1, 2) and v 2 ∈ V (2,1) . It is easy to see that v 1 ∈ V (1, 2) , just by the existence of P . For v 2 ∈ V (2,1) , we need that there is no strict temporal (s, v 2 )-path of length one.
Assume towards a contradiction that there would be a strict temporal (s, v 2 )-path of length one or in other words there is a time-edge ({s, v 2 }, t) ∈ E. Then v 2 ∈ V (1,1) , which contradicts the fact that V (1,1) = ∅, and hence v 2 ∈ V (2,1) .
From Definition 3.7, we know that there is an (s, z)-path P D such that V (P ) = V (P D ).
Case 2: Let the length of P be four. Thus, it looks as follows.
It immediately follows that the shortest strict temporal (s, v 1 )-path is of length one. Furthermore, the shortest strict temporal (s, v 2 )-path is of length two, otherwise P would not be chordless. z}, 4) is a shortest strict temporal (v 3 , z)-path of length one. Thus, there is a time-edge ({s, v 3 }, t) ∈ E. This time-edge must be part of a strict temporal (s, z)-path, because G is reduced. ({v 3 , z}, 4)) would be a strict temporal (s, z)-path of length two. Hence, ({s, v 3 }, t) / ∈ E and v 3 ∈ V (2,1) ∪ V (3,1) .
From Definition 3.7 we know that there is an (s, z)-path P D such that V (P ) = V (P D ).
Let S ⊆ (V \ {s, z}) be an (s, z)-separator in D. Until now, we know that S is also a strict temporal (s, z)-separator in G, because for each chordless strict temporal (s, z)-path in G there is an (s, z)-path in D. Let L ⊆ (V \ {s, z}) be a strict temporal (s, z)-separator in G. It remains to be shown that L is an (s, z)-separator in D.
Assume towards a contradiction that L is not an (s, z)-separator in D. Thus, there is an (s, z)path P D in D − L. The length of P D is either three or four, see Figure 5.
Case 1: Let the length of P D be three and V (P D ) = {s, v 1 , v 2 , z} such that v 1 is visited before v 2 .
Case 1.1: Let t 2 = 2. The time-edge ({v 1 , v 2 }, t 2 = 2) must be part of a strict temporal (s, z)-path, and therefore we have either This contradicts the fact that L is strict temporal (s, z)-separator in G.
Case 1.2: Let t 2 = 3. There is a strict temporal (s, z)-path which contains the time- This contradicts the fact that L is strict temporal (s, z)-separator in G.
Case 2: Let the length of P D be four, and V (P D ) = {s, v 1 , v 2 , v 3 , z} such that v 1 is visited before v 2 and v 2 is visited before v 3 . Considering Figure 5, one can observe that v 1 ∈ V (1, 3) ∪ V (1, 2) and v 2 ∈ V (2,2) . From Definition 3.7, we know that there are time-edges ({s, v 1 }, There is a strict temporal (s, z)-path P containing ({v 1 , v 2 }, t 2 ) because G is reduced. Since v 2 ∈ V (2,2) , we know that P is of length four.
Now assume towards a contradiction that P visits v 2 before v 1 . Hence, ({v 1 , v 2 }, t 2 ) is the third time-edge in P . The first two time-edges of P are a strict temporal (s, v 2 )-path of length two and arrival time at least two. Thus, t 2 ≥ 3. Observe that there is no strict temporal (v 1 , z)path of length one and hence there is no time-edge ({v 1 , z}, 4), because v 1 ∈ V (1,2) ∪ V (1, 3) . This contradicts P visiting v 2 before v 1 . Consequently, the strict temporal (s, z)-path P visits v 1 before v 2 and ({v 1 , v 2 }, t 2 ) is the second time-edge in P . Hence, t 2 = 2 and there is a time-edge ({s, v 1 }, 1) in P . This implies t 1 = 1.

On Temporal Graphs with Planar Underlying Graph
In this section, we study our problems on planar temporal graphs, that is, temporal graphs that have a planar underlying graph. We show that both Temporal (s, z)-Separation and Strict Temporal (s, z)-Separation remain NP-complete on planar temporal graphs. On the positive side, we show that on planar temporal graphs with a constant number of layers, Strict Temporal (s, z)-Separation can be solved in O(|E| · log |E|) time.
In order to prove our hardness results, we first prove NP-hardness for Length-Bounded (s, z)-Separation on planar graphs-a result which we consider to be of independent interest; note that NP-completeness on planar graphs was only known for the edge-deletion variant of Length-Bounded (s, z)-Separation on undirected graphs [19] and weighted directed graphs [35]. Proof. We give a many-one reduction from the NP-complete [19] edge-weighted variant of Length-Bounded (s, z)-Cut, referred to as Planar Length-Bounded (s, z)-Cut, where the input graph G = (V, E) is planar, has edge costs c : E → {1, k + 1}, has maximum degree ∆ = 6, the degree of s and z is three, and s and z are incident to the outer face. Since the maximum degree is constant, one can replace a vertex with a planar grid-like gadget.  Let I := (G = (V, E, c), s, z, , k) be an instance of Planar Length-Bounded (s, z)-Cut, and we assume k to be even 4 . We construct an instance I := (G , s , z , , k) of Length-Bounded (s, z)-Separation as follows (refer to Figure 7 for an illustration).

Construction. For each vertex
of size k + 1 that we refer to as connector sets. As we fix an orientation of G v such that u v 1,1 is in the top-left, there are two connector sets on the top of G v , two on the bottom of G v , one on the left of G v , and one on the right of G v . Formally, Let φ(G) be a plane embedding of G. We say that an edge e incident with vertex v ∈ V is at position i on v if e is the ith edge incident with v when counted clockwise with respect to φ(G). For each edge e = {v, w}, we introduce an edge-gadget G e that differs on the weight of e, as follows. Let e be at position i ∈ {1, . . . , 6} on v and at position j ∈ {1, . . . , 6} on w. If c(e) = 1, then G e is constructed as follows. Add a path consisting of ( + 1) · k − 1 vertices and connect one endpoint with each vertex in C i v by an edge and connect the other endpoint with each vertex in C j w by an edge. If c(e) = k + 1, then G e is constructed as follows. We introduce a planar matching between the vertices in C i v and C j w . That is, for instance, we connect vertex u v 1,k+2+p with vertex u w 1,2k+2−p for each p ∈ {0, . . . , k}, if i = j = 1, or we connect vertex u v 1,1+p with vertex u w 2k+2,3k/2−p for each p ∈ {0, . . . , k}, if i = 6 and j = 2 (we omit the remaining cases). Then, replace each edge by a path of length at least ( + 1) · k + 1 where its endpoints are identified with the endpoints of the replaced edge. Hence, a path between two vertex-gadgets has length at least ( + 1) · k + 1.
Next, we choose connector sets C i s and C j z such that no vertex v ∈ C i s ∪ C j z is adjacent to a vertex from an edge-gadget. Such i and j always exist because the degrees of s and z are both three. Now, we add two special vertices s and z and edges between s and each vertex in C i s , as well as between z and each vertex in C j z . Finally, we set := 2 + ( + 1) · k + (( + 1) · k + 1) . Note that G can be computed in polynomial time. Moreover, one can observe that G is planar by obtaining an embedding from φ. This concludes the description of the construction.
Correctness. We claim that I is a yes-instance if and only if I is a yes-instance. ⇒: Let I be a yes-instance. Thus, there is a solution C ⊂ E with c(C) ≤ k such that there is no (s, z)-path of length at most in G − C. We construct a set S ⊂ V (G ) of size at most k by taking for each {v, w} ∈ C one arbitrary vertex from the edge-gadget G {v,w} into S. Note that since c(C) ≤ k, each edge in C is of cost one.
Assume towards a contradiction that there is a shortest (s , z )-path P of length at most in G − S. Since a path between two vertex-gadgets has length at least ( + 1) · k + 1, we know that P goes through at most edge-gadgets. Otherwise P would be of length at least 2 + ( + 1) · [( + 1) · k + 1] = 2 + ( + 1) · k + · [( + 1) · k + 1] + 1 = + 1. Now, we reconstruct an (s, z)-path P in G corresponding to P by taking an edge e ∈ E into P if P goes through the edge-gadget G e . Hence, the length of P is at most . This contradicts that there is no (s, z)-path of length at most in G − C. Consequently, there is no (s , z )-path of length at most in G − S and I is a yes-instance. ⇐: Let I be a yes-instance. Thus, there is a solution S ⊆ V (G ) of minimum size (at most k) such that there is no (s , z )-path of length at most in G − S. Since S is of minimum size, it follows from the following claim that Proof of Claim 4.2. Let C i v , C j v two connector sets of a vertex-gadget G v , where i, j ∈ {1, . . . , 6} and i = j. We add vertices a and b and edges {a, a } and {b, b } to G v , where a ∈ C i v and b ∈ C j v . There are 6 2 different cases in which i = j. It is not difficult to see that in each case there are k + 1 vertex-disjoint (a, b)-paths. The claim then follows by Menger's Theorem [31].
Note that by minimality of S, it holds that V (G e ) ∩ S = ∅ for all e ∈ E with c(e) = k + 1. We construct an edge set C ⊆ E of cost at most k by taking {v, w} ∈ E into C if there is a y ∈ V (G {v,w} ) ∩ S.
Assume towards a contradiction that there is a shortest (s, z)-path P of length at most in G−C. We reconstruct an (s , z )-path P in G which corresponds to P as follows. First, we take an edge {s , v} ∈ E(G ) such that v ∈ C i s \ S. Such a v always exists, because |C i s | = k + 1 and |S| ≤ k. Let {s, w} ∈ E be the first edge of P and at position i on w. Then we add a (v, v )-path P s in G s −S, such that v ∈ C i s \ S. Due to Claim 4.2, such a (v, v )-path P s always exists in G s − S and is of length at most k .
We take an edge-gadget G e into P if e is in P . Recall, that an edge-gadget is a path of length ( + 1) · k + 1. Due to Claim 4.2, we can connect the edge-gadgets G {v 1 ,v 2 } , G {v 2 ,v 3 } of two consecutive edges {v 1 , v 2 }, {v 2 , v 3 } in P by a path of length at most k in G v 2 . Let {v p , z} be the last edge in P , be at position j on z, v ∈ C j z , and v ∈ C j z . We add a (v, v )-path of length k in G z − S (Claim 4.2). Note that P visits at most + 1 vertex-gadgets and edge-gadgets. The length of P is at most 2 + ( + 1) · k + [( + 1) · k + 1] = . This contradicts that S forms a solution for I . It follows that there is no (s, z)-path of length at most in G − C and I is a yes-instance.
From the proofs of Theorem 3.1 and Lemma 2.1 (planarity-preserving reductions for the underlying graph), together with Theorem 4.1 we get the following: Corollary 4. 3. Both Temporal (s, z)-Separation and Strict Temporal (s, z)-Separation on planar temporal graphs are NP-complete.
In contrast to the case of general temporal graphs, Strict Temporal (s, z)-Separation on planar temporal graphs is efficiently solvable if the maximum label τ is any constant. To this end, we introduce monadic second-order (MSO) logic and the optimization variant of Courcelle's Theorem [5,13].
Monadic second-order ( MSO) logic consists of a countably infinite set of (individual) variables, unary relation variables, and a vocabulary. A formula in monadic second-order logic on graphs is constructed from the vertex variables, edge variables, an incidence relation between edge and vertex variables inc(e, x), the relations =, ∧, ∨, ¬, and the quantifiers ∀ and ∃. We will make use of many folklore shortcuts, for example: =, ⊆ , v ∈ V to check whether v is a vertex variable, and e ∈ E to check whether e is an edge variable. The treewidth tw(G) of a graph G measures how tree-like a graph is. In this paper we are using the following theorem and the treewidth of a graph as a black box. For formal definitions of treewidth and MSO, refer to Courcelle and Engelfriet [13].
We employ Theorem 4.4 to solve Strict Temporal (s, z)-Separation on planar temporal graphs. We define the optimization variant of Strict Temporal (s, z)-Separation in monadic second order logic (MSO) and show that it is sufficient to solve the Strict Temporal (s, z)-Separation on a temporal graph where we can upper-bound the treewidth of the underlying graph by a function only depending on τ .
We define the edge-labeled graph L(G) to be the underlying graph G ↓ of G with the edgelabeling ω : whenever we find a time-edge {v, w}, t ∈ E. Furthermore, we associate with each edge in E an integer ω {v,w} which is initially zero, and gets an increment of 2 t−1 for each time-edge {v, w}, t ∈ E. With the appropriate data structure, this can be done in O(|E| · log |E|) time. Observe, that in the end ω {v,w} = ω({v, w}). Finally, we copy the vertex set of G, and hence compute L(G) in O(|V | + |E| · log |E|) = O(|E| · log |E|) time.
Arnborg et al. [5] showed that it is possible to apply Theorem 4.4 to graphs in which edges have labels from a fixed finite set, either by augmenting the graph logic to incorporate predicates describing the labels, or by representing the labels by unquantified edge set variables. Since Theorem 4.4 gives a linear-time algorithm with respect to the input size, we can conclude that if the size of that label set depends on τ , then Theorem 4.4 still gives a linear-time algorithm for arbitrary but fixed τ , the size of the MSO formula, and the treewidth.
We will define the optimization variant of Strict Temporal (s, z)-Separation in MSO on L(G).  Note that every strict temporal (s, z)-path in G and its induced (s, z)-path in G ↓ have length at most τ . Hence, we can remove all vertices from G ↓ which are not reachable from s by a path of length at most τ . We can find the set of vertices N which is reachable by a path of length τ by a breadth first search from s in linear time. Therefore, it is sufficient to solve the Strict Temporal (s, z)-Separation on G[N ∪ {s}]. Observe, that L(G[N ∪ {s}]) has diameter at most 2 · τ and is planar. The treewidth of a planar graph is at most three times the diameter (see Flum and Grohe [18]). Thus, (the optimization variant of) Strict Temporal (s, z)-Separation can be solved in f (τ ) · |E| · log |E| time, where f is a computable function. For any constant τ , this yields a running time of O(|E| · log |E|).

On Temporal Graphs with Small Temporal Cores
In this section, we investigate the complexity of deciding (Strict) Temporal (s, z)-Separation on temporal graphs where the number of vertices whose incident edges change over time is small. We call the set of such vertices the temporal core of the temporal graph.
is called the temporal core. A temporal graph is often composed of a public transport system and an ordinary street network. Here, the temporal core consists of vertices involved in the public transport system.

Conclusion
The temporal path model strongly matters when assessing the computational complexity of finding small separators in temporal graphs. This phenomenon has so far been neglected in the literature. We settled the complexity dichotomy of Temporal (s, z)-Separation and Strict Temporal (s, z)-Separation by proving NP-hardness on temporal graphs with τ ≥ 2 and τ ≥ 5, respectively, and polynomial-time solvability if the number of layers is below the respective constant. The mentioned hardness results also imply that both problem variants are W[1]-hard when parameterized by the solution size k. When considering the parameter combination k + τ , it is easy to see that Strict Temporal (s, z)-Separation is fixed-parameter tractable [40]: There is a straightforward search-tree algorithm that branches on all vertices of a strict temporal (s, z)-path which has length at most τ . Whether the non-strict variant is fixed-parameter tractable regarding the same parameter combination remains open.
We showed that (Strict) Temporal (s, z)-Separation on temporal graphs with planar underlying graphs remains NP-complete. However, for the planar case we proved that if additionally the number τ of layers is a constant, then Strict Temporal (s, z)-Separation is solvable in O(|E|·log |E|) time. We leave open whether Temporal (s, z)-Separation admits a similar result. Finally, we introduced the notion of a temporal core as a temporal graph parameter. We proved that on temporal graphs with constant-size temporal core, while Strict Temporal (s, z)-Separation remains NP-hard, Temporal (s, z)-Separation is solvable in polynomial time.