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.  showed that in temporal graphs it is NP-hard to compute minimum separators.
Temporal graphs are well-established in the literature and are also referred to as time-varying  and evolving  graphs, temporal networks [26, 27, 32], link streams [28, 38], multidimensional networks , and edge-scheduled networks . In this work, we use the well-established model in which each edge has a time stamp [9, 26, 2, 24, 27, 32, 4]. Assuming discrete time steps, this is equivalent to a sequence of static graphs over a fixed set of vertices . Formally, we define a temporal graph as follows.
Definition 1.1 (Temporal Graph).
An (undirected) temporal graph is an ordered triple consisting of a set of vertices, a set of time-edges, and a maximal time label .
See Figure 1 for an example with , that is, a temporal graph with four time steps, also referred to as layers. The static graph obtained from a temporal graph by removing the time stamps from all time-edges we call the underlying graph of .
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 .
A fundamental question in temporal graphs, addressing issues such as connectivity [6, 32], survivability , and robustness , is whether there is a “time-respecting” path from a distinguished start vertex to a distinguished target vertex .111In the literature the sink is usually denoted by . To be consistent with Michail  we use instead as we reserve to refer to points in time. We provide a thorough study of the computational complexity of separating from 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.
Two path models.
We start with the introduction of the “non-strict” path model . Given a temporal graph with two distinct vertices , a temporal -path of length in is a sequence of time-edges in , where for all with and for all . A vertex set with is a temporal -separator if there is no temporal -path in . We are ready to state the central problem of our paper.Temporal -Separation Input: A temporal graph , two distinct vertices , and . Question: Does admit a temporal -separator of size at most ?
Our second path model is the “strict” variant. A temporal -path is called strict if for all . In the literature, strict temporal paths are also known as journeys [2, 3, 33, 32].222We also refer to Himmel  for a thorough discussion and comparison of temporal path concepts. A vertex set is a strict temporal -separator if there is no strict temporal -path in . Thus, our second main problem, Strict Temporal -Separation, is defined in complete analogy to Temporal -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 disease-spreading scenario the spreading speed might be unclear. To ensure containment of the spreading by separating patient zero () from a certain target (), a temporal -separator might be the safer choice.
|(Section 3)||(Section 4)||(Section 5)|
Table 1 provides an overview on our results.
A central contribution is to prove that both Temporal -Separation and Strict Temporal -Separation are NP-complete for all and , respectively, strengthening a result by Kempe et al.  (they show NP-hardness of both variants for all ). For Temporal -Separation, our hardness result is already tight.333Temporal -Separation with is equivalent to -Separation on static graphs. For the strict variant, we identify a dichotomy in the computational complexity by proving polynomial-time solvability of Strict Temporal -Separation for . 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 -Separation is fixed-parameter tractable (FPT) when parameterized by the size of the temporal core, while Strict Temporal -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.
To show the polynomial-time solvability of Strict Temporal -Separation for , we prove that a classic separator result of Lovász et al.  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.  by a logarithmic factor.
We settle the complexity of Length-Bounded -Separation on planar graphs by showing its NP-hardness, which was left unanswered by Fluschnik et al.  and promises to be a valuable intermediate problem for proving hardness results. In the hardness reduction for Length-Bounded -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 -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. .
Our most important reference is the work of Kempe et al.  who proved that Temporal -Separation is NP-hard. In contrast, Berman  proved that computing temporal -cuts (edge deletion instead of vertex deletion) is polynomial-time solvable. In the context of survivability of temporal graphs, Liang and Modiano  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. . They showed how to compute in polynomial time the maximum amount of flow passing from a source vertex to a sink vertex until a given point in time.
The vertex-variant of Menger’s Theorem  states that the maximum number of vertex-disjoint paths from to equals the size of a minimum-cardinality -separator. In static graphs, Menger’s Theorem allows for finding a minimum-cardinality -separator via maximum flow computations. However, Berman  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.  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.  proved another analogue of Menger’s Theorem: the maximum number of strict temporal -path which never leave the same vertex at the same time equals the minimum number of node departure times needed to separate from , where a node departure time is the vertex at time point .
Michail and Spirakis  introduced the time-analogue of the famous Traveling Salesperson problem and studied the problem on temporal graphs of dynamic diameter , that is, informally speaking, on temporal graphs where every two vertices can reach each other in at most time steps at any time. Erlebach et al.  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  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 .
Let denote the natural numbers without zero. For , we use .
Static graphs. We use basic notations from (static) graph theory . Let be an undirected, simple graph. We use and to denote the set of vertices and set of edges of , respectively. We denote by the graph without the vertices in . For , denotes the induced subgraph of by . A path of length is sequence of edges where for all with . We set . Path is an -path if and . A set of vertices is an -separator if there is no -path in .
Temporal graphs. Let be a temporal graph. The graph is called layer of the temporal graph where . The underlying graph of a temporal graph is defined as , where . (We write , , , and for short if is clear from the context.) For we define the induced temporal subgraph of by . We say that is connected if its underlying graph is connected. For surveys concerning temporal graphs we refer to [10, 33, 26, 28, 25].
Regarding our two models, we have the following connection:
There is a linear-time computable many-one reduction from Strict Temporal -Separation to Temporal -Separation that maps any instance to an instance with and .
Let be an instance of Strict Temporal -Separation. We construct an equivalent instance in linear-time. Set , where is called the set of edge-vertices. Next, let be initially empty. For each , add the time-edges to . This completes the construction of . Note that this can be done in time. It holds that and that .
We claim that is a yes-instance if and only if is a yes-instance.
: Let be a temporal -separator in of size at most . We claim that is also a temporal -separator in . Suppose towards a contradiction that this is not the case. Then there is a temporal -path in . Note that the vertices on alternated between vertices in and . As each vertex in corresponds to an edge, there is a temporal -path in induced by the vertices of . This is a contradiction.
: Observe that from any temporal -separator, we can obtain a temporal -separator of not larger size that only contains vertices in . Let be a temporal -separator in of size at most only containing vertices in . We claim that is also a temporal -separator in . Suppose towards a contradiction that this is not the case. Then there is a temporal path in . Note that we can obtain a temporal -path in by adding for all consecutive vertices , , where appears before at time-step on , the vertex . This is a contradiction. ∎
Throughout the paper we assume that the underlying graph of the temporal input graph is connected and that there is no time-edge between and . Furthermore, in accordance with Wu et al.  we assume that the time-edge set is ordered by ascending time stamps.
2.1 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 -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 -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.1.
Let be a temporal graph and let be an interval where for all the layer is an edgeless graph. Then for all where replace with in .
Reduction Rule 2.2.
Let be a temporal graph. If there is a non-empty interval where for all the layer is an edgeless graph, then set to .
We prove next that both reduction rules are exhaustively applicable in linear time.
First we discuss Reduction Rule 2.1. Let be a temporal graph, , be an interval where for all the layer is an edgeless graph. Let be a temporal -path, and let be the graph after we applied Reduction Rule 2.1 once on . We distinguish three cases.
If , then no time-edge of is touched by Reduction Rule 2.1. Hence, also exists in .
If , then there is a temporal -path in , because .
If , then there is clearly a temporal -path in
The other direction works analogously. We look at a temporal -path in and compute the corresponding temporal -path in .
Reduction Rule 2.1 can be exhaustively applied by iterating over the by time-edges in the time-edge set ordered by ascending labels until the first with the given requirement appear. Set . Then we iterate further over and replace each time-edge with until the next with the given requirement appear. Then we set and iterate further over and replace each time-edge with . We repeat this procedure until the end of is reached. Since we iterate over only once, this can be done in time.
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.
Let be an instance of (Strict) Temporal -Separation. There is an algorithm which computes in time an instance of (Strict) Temporal -Separation which is equivalent to , where .
3 Hardness Dichotomy Regarding the Number of Layers
In this section we settle the complexity dichotomy of both Temporal -Separation and Strict Temporal -Separation regarding the number of time steps. We observe that both problems are strongly related to the following NP-complete [11, 37] problem:Length-Bounded -Separation (LBS) Input: An undirected graph , distinct vertices , and . Question: Is there a subset such that and there is no -path in of length at most ?
Length-Bounded -Separation is NP-complete even if the lower bound for the path length is five  and W-hard with respect to the postulated separator size . We obtain the following, improving a result by Kempe et al.  who showed NP-completeness of Temporal -Separation and Strict Temporal -Separation for all .
Temporal -Separation is NP-complete for every maximum label and Strict Temporal -Separation is NP-complete for every . Moreover, both problems are W-hard when parameterized by the solution size .
We remark that our NP-hardness reduction for Temporal -Separation is inspired by Baier et al. [7, Theorem 3.9].
To show NP-completeness of Temporal -Separation for we present a reduction from the Vertex Cover problem where, given a graph and an integer , the task is to determine whether there exists a set of size at most such that does not contain any edge.
Let be an instance of Vertex Cover. We say that is a vertex cover in of size if and is a solution to . We refine the gadget of Baier et al. [7, Theorem 3.9] and reduce from Vertex Cover to Temporal -Separation. Let be a Vertex Cover instance and . We construct a Temporal -Separation instance , where are the vertices and the time-edges are defined as
Note that , , and can be computed in polynomial time. For each vertex there is a vertex gadget which consists of three vertices and six vertex-edges. In addition, for each edge there is an edge gadget which consists of two edge-edges and . See Figure 3 for an example.
We prove that is a yes-instance if and only if is a yes-instance.
: Let be a vertex cover of size for . We claim that is a temporal -separator. There are vertices not in the vertex cover and for each of them there is exactly one vertex in . For each vertex in the vertex cover there are two vertices in . Hence, .
First, we consider the vertex-gadget of a vertex . Note that in the vertex-gadget of , there are two distinct temporal -separators and . Hence, every temporal -path in contains an edge-edge. Second, let and let and be the temporal -paths which contain the edge-edges of edge-gadget of such that and . Since is a vertex cover of we know that at least one element of is in . Thus, or , and hence neither nor exist in . It follows that is a temporal -separator in of size at most , as there are no other temporal -paths in .
: Let be a temporal -separator in of size and let . Recall that there are two distinct temporal -separators in the vertex gadget of , namely and , and that all vertices in are from a vertex gadget. Hence, is of the form . We start with a preprocessing to ensure that for vertex gadget only one of these two separators are in . Let . We iterate over for each :
If or then we do nothing.
If then we remove from and decrease by one. One can observe that all temporal -paths which are visiting are still separated by or .
If then we remove from and add . One can observe that is still a temporal -separator of size in .
If then we remove from and add . One can observe that is still a temporal -separator of size in .
That is a complete case distinction because neither nor separate all temporal -paths in the vertex gadget in . Now we construct a vertex cover for by taking into if both and are in . Since there are vertex gadgets in each containing either one or two vertices from , it follows that ,
Assume towards a contradiction that is not a vertex cover of . Then there is an edge where . Hence, and . This contradicts the fact that is a temporal -separator in , because is a temporal -path in . It follows that is a vertex cover of of size at most . ∎
There is a polynomial-time reduction from LBS to Strict Temporal -Separation that maps any instance of LBS to an instance with for all of Strict Temporal -Separation.
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 -Separation can be solved in polynomial time, if the maximum label .
3.1 Strict Static Expansion
A key tool [8, 27, 32, 3, 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 -paths. Let be a temporal graph and let . For each , we define the sets and . The strict static expansion of is a directed acyclic graph where and , , , , and (referred to as column-edges of ). Observe that each strict temporal -path in has a one-to-one correspondence to some -path in . We refer to Figure 4 for an example.
Let be a temporal graph, where are two distinct vertices. The strict static expansion for can be computed in time.
Let be a temporal graph, where and are two distinct vertices. Note that because is connected. We construct the strict static expansion for as in four steps follows: First, we initiate for each an empty linked list. Second, we iterate over the set with non-decreasing labels and for each :
Add to if they do not already exist. If we added a vertex then we push to the -th linked list.
Add to .
This can be done in time. Observe, that the two consecutive entries in the -th linked list is an entry in . Third, we iterate over each linked list in increasing order to add the column-edges to . Note that the sizes of all linked lists sum up to . Last, we add and to as well as the edges in and to .
Note that the as well as can be upper-bounded by . We employed a constant number of procedures each running in time. Thus, can be computed in time. ∎
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 to all other vertices in the temporal graph. Herein, we say that a strict temporal -path is shortest if there is no strict temporal -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. , but in contrast to the algorithm of Wu et al.  our subroutine cannot be adjusted to the non-strict case.
Single-Source Shortest Strict Temporal Paths is solvable in time.
The following proof makes use of a strict static expansion of a temporal graph. See Sec. 3.1 for more details.
By Lemma 3.3, we compute the strict static expansion of in time and define a weight function
Observe that with is a weighted directed acyclic graph and that the weight of an -path in with is equal to the length of the corresponding strict temporal -path in . Hence, we can use an algorithm, which makes use of the topological order of on , to compute for all a shortest -path in in time (cf. Cormen et al. [12, Section 24.2]).
Now we iterate over and construct the shortest strict temporal -path in from the shortest -path in , where , and . This can be done in time because . Consequently, the overall running time is . Since the shortest strict temporal -path in can have length , this algorithm is asymptotically optimal. ∎
3.2 Adaptation of Proposition 3.4 for the Model of Wu et al. 
Wu et al.  considered a model where the temporal graph is directed and a time-edge has a traversal time . In the context of strict temporal path is always one. They excluded the case where , but pointed out that their algorithms can be adjusted to allow . However, this is not possible for our algorithm, because then the strict static expansion can contain cycles. Hence, we assume that for all directed time-edges .
Let be a directed temporal graph. We denote a directed time-edge from to in layer by . First, we initiate many linked lists. Without loss of generality we assume that , see Lemma 2.3. Second, we construct a directed temporal graph , where and is empty in the beginning. Then we iterate over the time-edge set by ascending labels. If has then we add to . If has then we add a new vertex to and add time-edge to and to the -th linked list, where . We call the original edge of and the connector edge of . If we reach a directed time-edge with label for the first time, then we add all directed time-edges from the -th linked list to . Observe that for each strict temporal -path in there is a corresponding strict temporal -path in , additionally we have that is ordered by ascending labels and that can be constructed in time.
To construct a strict static expansion for a directed temporal graph , we modify the edge set , where . Finally, we adjust the weight function from the algorithm of Proposition 3.4 such that if is a column-edges of correspond to a connector-edges, and otherwise. Observe that for a strict temporal -path of traversal time the corresponding -path in the strict static expansion is of weight of the traversal time of .
Our algorithm behind Theorem 3.6 executes the following steps:
As a preprocessing step, remove unnecessary time-edges and vertices from the graph.
Compute an auxiliary graph called directed path cover graph of the temporal graph.
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 with two distinct vertices is reduced if (i) the underlying graph is connected, (ii) for each time-edge there is a strict temporal -path which contains , and (iii) there is no strict temporal -path of length at most two in . This preprocessing step can be performed in polynomial time:
Let be an instance of Strict Temporal -Separation. In time, one can either decide or construct an instance of Strict Temporal -Separation such that is equivalent to , is reduced, , , and .
The following proof makes use of a strict static expansion of a temporal graph. See Sec. 3.1 for more details.
First, we remove all time-edges which are not used by a strict temporal -path. Let be an instance of Strict Temporal -Separation. We execute the following procedure.
Construct the strict static expansion of .
Perform a breadth-first search in from and mark all vertices in the search tree as reachable. Let be the reachable vertices from .
Construct , where . Observe that is the reachable part of from , where all directed arcs change their direction.
If , then our instance is a yes-instance.
Perform a breadth-first search from in and mark all vertices in the search tree as reachable. Let be the reachable set of vertices from . In the graph , all vertices are reachable from and from each vertex the vertex is reachable.
Output the temporal graph , where and .
One can observe that is a temporal subgraph of and that is connected. Note that all subroutines are computable in time (see Lemma 3.3). Consequently,