Finding Temporal Paths Under Waiting Time Constraints

Computing a (short) path between two vertices is one of the most fundamental primitives in graph algorithmics. In recent years, the study of paths in temporal graphs, that is, graphs where the vertex set is fixed but the edge set changes over time, gained more and more attention. A path is time-respecting, or temporal, if it uses edges with non-decreasing time stamps. We investigate a basic constraint for temporal paths, where the time spent at each vertex must not exceed a given duration Δ\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\varDelta $$\end{document}, referred to as Δ\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\varDelta $$\end{document}-restless temporal paths. This constraint arises naturally in the modeling of real-world processes like packet routing in communication networks and infection transmission routes of diseases where recovery confers lasting resistance. While finding temporal paths without waiting time restrictions is known to be doable in polynomial time, we show that the “restless variant” of this problem becomes computationally hard even in very restrictive settings. For example, it is W[1]-hard when parameterized by the distance to disjoint path of the underlying graph, which implies W[1]-hardness for many other parameters like feedback vertex number and pathwidth. A natural question is thus whether the problem becomes tractable in some natural settings. We explore several natural parameterizations, presenting FPT algorithms for three kinds of parameters: (1) output-related parameters (here, the maximum length of the path), (2) classical parameters applied to the underlying graph (e.g., feedback edge number), and (3) a new parameter called timed feedback vertex number, which captures finer-grained temporal features of the input temporal graph, and which may be of interest beyond this work.


Introduction
A highly successful strategy to control (or eliminate) outbreaks of infectious diseases is contact tracing [25]-whenever an individual is diagnosed positively, every person who is possibly infected by this individual is put into quarantine. However, the viral spread can be too fast to be traced manually, e.g., if the disease is transmittable in a pre-symptomatic (or asymptomatic) stage, then it seems likely that an individual already caused infection chains when diagnosed positively. Hence, large-scale digital systems are recommended which use physical proximity networks based on location and contact data [29]-this allows fast and precise contact tracing while avoiding the harmful effect of mass quarantines to society [29]. Physical proximity networks can be understood as temporal graphs 1 [18,37,39,46,51], that is, graphs where the vertex set (individuals) remains static but the edge set (physical contacts) may change over time. In this paper, we extend the literature on reachability in temporal graphs [5,7,11,14,17,44,50,61] by a computational complexity analysis of an important variation of one of the most fundamental combinational problems arising in the above mentioned scenario: given a temporal graph and two individuals s and z, is a chain of infection from s to z possible, that is, is there a temporal path from s to z? In particular, we use a reachability concept that captures the standard 3-state SIR-model (Susceptible-Infected-Recovered), a canonical spreading model for diseases where recovery confers lasting resistance [8,45,54].
In temporal graphs, the basic concepts of paths and reachability are defined in a time-respecting way [44]: a (strict) temporal path, also called "journey", is a path that uses edges with non-decreasing (increasing) time steps. To represent infection chains in the SIR-model, we restrict the time of "waiting" or "pausing" at each intermediate vertex to a prescribed duration. We call these paths restless temporal paths. They model infection transmission routes of diseases that grant immunity upon recovery [38]: An infected individual can transmit the disease until it is recovered (reflected by bounded waiting time) and it cannot be infected a second time afterwards since then it is immune (reflected by considering path instead of walk: every vertex can only be visited at most once). Another natural example of restless temporal paths is delay-tolerant networking among mobile entities, where the routing of a packet is performed over time and space by storing the packet for a limited time at intermediate nodes.
In the following we give an example to informally describe our problem setting. 2 In Fig. 1 we are given the depicted temporal graph, vertices s and z, and the time bound = 2 . We are asked to decide whether there is a restless temporal path from s to z, that is, a path which visits each vertex at most once and pauses at most units of time between consecutive hops. Here, (s, d, b, z) is a feasible solution, but (s, b, z) is not because the waiting time at b exceeds . The walk (s, b, c, d, b, z) is not a valid solution because it visits vertex b twice. Finally (s, a, c, d, b, z) is also a feasible solution.

Related Work
Several types of waiting time constraints have been considered in the temporal graph literature. An empirical study by Pan and Saramäki [56] based on phone calls datasets observed a threshold in the correlation between the duration of pauses between calls and the ratio of the network reached over a spreading process. Casteigts et al. [19] showed a dramatic impact of waiting time constraints to the expressivity of a temporal graph, when considering such a graph as an automaton and temporal paths as words. In the context of temporal flows, Akrida et al. [4] considered a concept of "vertex buffers", which however pertains to the quantity of information that a vertex can store, rather than a duration. Enright et al. [26] considered deletion problems for reducing temporal connectivity. More closely related to our work, Himmel et al. [11] studied a variant of restless temporal paths where several visits to the same vertex are allowed, i.e., restless temporal walks. They showed, among other things, that such walks can be computed in polynomial time.
Many path-related problems have been studied in the temporal setting and the nature of temporal paths significantly increases the computational complexity of many of them (compared to their static counterparts). In the temporal setting, reachability is not an equivalence relation among vertices, which makes many problems more complicated. For example, finding a maximum temporally connected component is NP-hard [14]. We further have that in a temporal graph, spanning trees may not exist. In fact, even the existence of sparse spanners (i.e., subgraphs with o(n 2 )-many edges ensuring temporal connectivity) is not guaranteed [7], unless the underlying graph is complete [20], and computing a minimum-cardinality spanner is APX-hard [3,50]. Yet another example is the problem of deciding whether there are k disjoint temporal paths between two given vertices. In a seminal article, Kempe et al. [44] showed that this problem, whose classical analogue is (again) polynomialtime solvable, becomes NP-hard. They further investigated the related problem of finding temporal separators, which is also NP-hard [30,44,62]. Deciding whether there exists a separator of a given size that cuts all restless temporal paths is known to be Σ P 2 -complete [52], that is, the problem is located in the second level of the polynomial time hierarchy.

Our Contributions
We introduce the problem Restless tempoRal path. To get a finer understanding of the computational complexity of this problem, we turn our attention to its parametrized complexity. In stark contrast to both restless temporal walks and non-restless temporal paths, we show that this problem is NP-hard even in very restricted settings-in particular, even when the lifetime is restricted to only three time steps-and W [1]-hard when parameterized by the (vertex deletion) distance to disjoint paths of the underlying graph, which implies W [1]-hardness with respect to many other parameters like feedback vertex number and pathwidth (Sect. 3). This is tight in the sense that the problem can be solved in polynomial time when the underlying graph is a forest. On the positive side, we explore parameters of three different natures. First, we show that the problem is fixed-parameter tractable (FPT) for the length (in number of hops) of the temporal path (Sect. 4). We further show that the problem is FPT when parameterized by the feedback edge number of the underlying graph (Sect. 5). Additionally, we show that the problem presumably does not admit a polynomial kernel under the previously mentioned parameterizations where the problem is in FPT. Our results provide a fine-grained characterization of the tractability boundary of the computation of restless temporal paths for parameters of the underlying graph, as illustrated by the vicinity of the corresponding parameters in Fig. 2. Then, going beyond parameters related to the output and to the underlying graph, we define a novel temporal version of the classic feedback vertex number called timed feedback vertex number. Intuitively, it counts the number of vertex appearances that have to be removed from the temporal graph such that its underlying graph becomes cycle-free. We show that finding restless temporal paths is FPT when parameterized by this parameter (Sect. 6). We believe that the latter is an interesting turn of events compared to our hardness results.

Strict Versus Non-strict Temporal Paths
In this paper, we focus mainly on the case of non-strict temporal paths, i.e., the times along a path are required to be non-decreasing. We expect most of the algorithms  [57]) for our results for Restless tempoRal path and reductions to be extendable to a strict setting, albeit with some change in the results themselves. For instance, a similar NP-hardness reduction as for non-strict temporal paths may apply, but requires more than a constant lifetime to be adapted. In fact, the length of a strict temporal path is trivially bounded by the lifetime itself, thus an FPT algorithm for the length parameter implies one for the lifetime parameter as well.

Preliminaries
Here, we formally introduce the most important concepts related to temporal graphs and paths, and give the formal problem definition of (shoRt) Restless tempoRal (s, z) -path.

Static Graphs
We use standard notation from (static) graph theory [24]. Unless stated otherwise, we assume graphs in this paper to be undirected and simple. To clearly distinguish them from temporal graphs, they are sometimes referred to as static graphs. Given a (static) graph G = (V, E) with E ⊆ V 2 , we denote by V(G) ∶= V and E(G) ∶= E the sets of its vertices and edges, respectively.
We call two vertices u, v ∈ V adjacent if {u, v} ∈ E . Two edges e 1 , e 2 ∈ E are adjacent if e 1 ∩ e 2 ≠ � . For a vertex v ∈ V , we denote by deg G (v) the degree of the vertex, that is, . We denote v 0 and v k as the endpoints of P. We further denote by E(P) the set of edges of path P, that is, , v k }} and by V(P) the set of vertices visited by the path, that is, V(P) = ⋃ e∈E(P) e . If v 0 = v k and P is of length at least three, then P is a cycle.

Temporal Graphs
We call (G) ∶= the lifetime of G . As with static graphs, we assume all temporal graphs in this paper to be undirected and simple. We call the graph G i (G) = (V, E i (G)) the layer i of G where E i (G) ∶= E i . If E i = � , then G i is a trivial layer. We call layers G i and G i+1 consecutive. We call i a time step. If an edge e is present at time i, that is, e ∈ E i , we say that e has time stamp i. We further denote . To improve readability, we remove (G) from the introduced notations whenever it is clear from the context. For every v ∈ V and every time step t ∈ [ ] , we denote the appearance of vertex v at time t by the pair (v, t). For every t ∈ [ ] and every e ∈ E t we call the pair (e, t) a time edge. For a time edge ({v, w}, t) we call the vertex appearances (v, t) and (w, t) its endpoints. We assume that the size (for example when referring to input sizes in running time analyzes) of G is �G� ∶= �V� + ∑ i=1 min{1, �E i �} , that is, we do not assume that we have compact representations of temporal graphs. Finally, we write n for |V|.
A temporal (s, z)-walk (or temporal walk) of length k from vertex s = v 0 to ver- of triples that we call transitions such that for all i ∈ [k] we have that . A restless temporal path is not allowed to wait an arbitrary amount of time in a vertex, but has to leave any vertex it visits within the next time steps, for some given value of . Analogously to the nonrestless case, a restless temporal walk may visit a vertex multiple times.
. We say that P respects the waiting time .
Having this definition at hand, we are ready to define the main decision problem of this work.
Note the waiting time at the source vertex s is ignored. This is without loss of generality, since one can add an auxiliary degree one source vertex which is only in the first layer adjacent to s. We also consider a variant, where we want to find -restless paths of a certain maximum length. In the shoRt Restless tempo-Ral path problem, we are additionally given a integer k ∈ ℕ and the question is whether there is a -restless temporal path of length at most k from s to z in G ? Note that Restless tempoRal path is the special case of shoRt Restless tempo-Ral path for k = |V| − 1 and that both problems are in NP.

Parameterized Complexity
We use standard notation and terminology from parameterized complexity theory [23] and give here a brief overview of the most important concepts that are used in this paper. A parameterized problem is a language L ⊆ Σ * × ℕ , where Σ is a finite alphabet. We call the second component the parameter of the problem. A parameterized problem is fixed-parameter tractable (in the complexity class FPT) if there is an algorithm that solves each instance (I, r) in f (r) ⋅ |I| O(1) time, for some computable function f. A decidable parameterized problem L admits a polynomial kernel if there is a polynomial-time algorithm that transforms each instance (I, r) into an instance (I � , r � ) such that (I, r) ∈ L if and only if (I � , r � ) ∈ L and |(I � , r � )| ∈ r O (1) . If a parameterized problem is hard for the parameterized complexity class W [1], then it is (presumably) not in FPT. The complexity classes W [1] is closed under parameterized reductions, which may run in FPT-time and additionally set the new parameter to a value that exclusively depends on the old parameter.

Basic Observations
If there is a -restless temporal (s, z)- The other direction does not necessarily hold. However, we now show that for any (s, z)-path in G ↓ we can decide in linear time whether this path is the support of a -restless temporal (s, z)-path in G . As a consequence, we can decide Restless tempoRal path in linear time for any temporal graph where there exists a unique (s, z)-path in the underlying graph, in particular, if the underlying graph is a forest.
be a temporal graph where the underlying graph G ↓ is an (s, z)-path with s, z ∈ V . Then there is an algorithm which computes in O(|G|) time the set … , e n = {v n−1 , v n }} be the edges of the underlying path. We further define L i as the set of layers of G in which the edge e i ∈ E(G ↓ ) exists, that is, In the following, we construct a dynamic program on the path. We compute for every vertex v i the

3
Observation 2 Restless tempoRal path on instances (G, s, z, ) can be solved in polynomial time, if = 0 or ≥ .
Proof Considering = 0 implies that the entirety of a path between s and z must be realized in a single layer. Thus, the problem is equivalent to testing if at least one of the layers G i contains a (static) path between s and z. ◻ If ≥ , then -restless temporal paths correspond to unrestricted temporal paths, whose computation can be made using any of the (polynomial time) algorithms in Bui-Xuan et al. [17].

Hardness Results for Restless Temporal Paths
In this section we present a thorough analysis of the computational hardness of Restless tempoRal path which also transfers to shoRt Restless tempoRal path.

NP-hardness for few layers
We start by showing that Restless tempoRal path is NP-complete even if the lifetime of the input temporal graph is constant. The reduction is similar in spirit to the classic NP-hardness reduction for 2-Disjoint paths in directed graphs by Fortune et al. [33].

Theorem 1
Restless tempoRal path is NP-complete for all finite ≥ 1 and ≥ + 2 even if every edge has only one time stamp.
Proof We show this result by a reduction from the NP-complete exact (3, 4)-sat problem [59]. The problem exact (3, 4)-sat asks whether a formula is satisfiable, assuming that it is given in conjunctive normal form, each clause having exactly three literals and each variable appearing in exactly four clauses.
Let be an instance of exact (3, 4)-sat with n variables and m clauses. We construct a temporal graph G = (V, (E i ) i∈[ ] ) with = 3 consisting of a series of variable gadgets followed by dedicated vertices s n and s ′ and then a series of clause gadgets. It is constructed in such a way that for = 1 , any -restless temporal (s, z)-path has to visit a vertex s n and each possible -restless temporal (s, s n )-path represents exactly one variable assignment for the formula . Further we show that for any -restless temporal (s, s n )-path it holds that it can be extended to a -restless temporal (s, z)-path if and only if the -restless temporal (s, s n )-path represents a satisfying assignment for the formula .
Variable Gadget. We start by adding a vertex s to the vertex set V of G . For each variable x i with i ∈ [n] of , we add 9 fresh vertices to V: Hence, there are exactly 3 m different temporal (s � , z)-paths at time step three. Each path must visit the clause vertices c 1 , … , c m in the given order by construction.
Finally, we set = 1 . This finishes the construction, for a visualization see Fig. 3. It is easy to check that every edge in the constructed temporal graph has only one time step and that the temporal graph can be computed in polynomial time.
Correctness. Now we can show that is satisfiable if and only if G has a -restless temporal (s, z)-path.
(⇒) : Let us assume there is a satisfying assignment for formula . Then we construct a -restless temporal path from vertex s to z as follows. Starting from s, for where x 1 appears for the fourth time, x 2 appears for the third time, and x 3 also appears for the third time. Black edges appear at time step one, the blue (dotted) edge {s n , s � } appears at time step two, and the red (dashed) edges appear at time step three each variable x i of the -restless temporal path passes through the variables x (1) i , x (2) i , x (3) i , and x (4) i , if x i is set to false, and x (1) i , x (2) i , x (3) i , and x (4) i , if x i is set to true, at time step one. The -restless temporal path arrives at time step one in the vertex s n . In time step two it goes from s n to s ′ .
At time step three, the -restless temporal path can be extended to c 1 . In each clause c j for j ∈ [m] there is at least one literal x i (or x i ) that is evaluated to true. Let c j be the kth clause in which x i appears. We have that, depending on whether x i is set to true (or false), the vertex x (k) i (or x (k) i ) has not been visited so far. Hence, the -restless temporal path can be extended from c j to c j+1 (or to z for j = m ) at time step three via x (k) i (or x (k) i ). Thus, there exists a -restless temporal (s, z)-path in G.
(⇐) : Let us assume that there exists a -restless temporal (s, z)-path in the constructed temporal graph G . Note that any -restless temporal (s, z)-path must reach s n in time step one because the variable gadget has only edges at time step one and the waiting time = 1 prevents the path to enter the clause gadget (which only has edges at time step three) before using the edge {s n , s � } at time step two.
It is easy to see that for the first part of the -restless temporal graph from s to s n it holds that for each i ∈ [n] , it visits either vertices x (1) i , In the former case we set x i to false and in the latter case we set x i to true. We claim that this produces a satisfying assignment for .
In time step three, the part of the -restless temporal path from s ′ to z has to pass vertices c 1 , c 2 , … , c m to reach z. The -restless temporal path passes exactly one variable vertex x (k) i (or x (k) i ) when going from c j to c j+1 (and finally from c m to z) that has not been visited so far and that corresponds to a variable that appears in the clause c j for the kth time. The fact that the variable vertex was not visited implies that we set the corresponding variable to a truth value that makes it satisfy clause c j . This holds for all j ∈ [m] . Hence, each clause is satisfied by the constructed assignment and, consequently, is satisfiable. ◻ The reduction used in the proof of Theorem 1 also yields a running time lower bound assuming the Exponential Time Hypothesis (ETH) [40,41].

Corollary 1 Restless tempoRal path does not admit a f ( ) o(|G|) -time algorithm for any computable function f unless the ETH fails.
Proof First, note that any 3-sat formula with m clauses can be transformed into an equisatisfiable exact (3, 4)-sat formula with O(m) clauses [59]. The reduction presented in the proof of Theorem 1 produces an instance of Restless tempoRal path with a temporal graph of size |G| = O(m) and = 3 . Hence an algorithm for Restless tempoRal path with running time f ( ) o(|G|) for some computable function f would imply the existence of an 2 o(m) -time algorithm for 3-sat. This is a contradiction to the ETH [40,41]. ◻ Furthermore, the reduction behind Theorem 1 can be modified such that it also yields that Restless tempoRal path is NP-hard, even if the underlying graph has constant maximum degree or the underlying graph is a clique where one edge ( {s, z}) is missing. Note that in the latter case the underlying graph contains all edges except the one edge which would turn the instance into a trivial yes-instance.

Corollary 2
Restless tempoRal path is NP-hard, even if the underlying graph has all but one edge or maximum degree six.
Proof That Restless tempoRal path is NP-hard, even if the underlying graph has maximum degree six follows directly from the construction used in the proof of Theorem 1. To show that that Restless tempoRal path is NP-hard, even if the underlying graph has all edges except {s, z} , we reduce from Restless tempoRal path. Let , s, z, ) be an instance of Restless tempoRal path with = 3 . We construct an instance Observe that none of the edges in E 1 ∪ E 5 can be used in temporal (s, z)-path. Hence, I is a yes-instance if and only if I ′ is a yes-instance. Furthermore, E 1 ∪ E 5 contain all possible edges except {s, z}. ◻

W[1]-Hardness for Distance to Disjoint Paths
In the following, we show that parameterizing Restless tempoRal path with structural graph parameters of the underlying graph of the input temporal graph presumably does not yield fixed-parameter tractability for a large number of popular parameters. In particular, we show that Restless tempoRal path parameterized by the distance to disjoint paths of the underlying graph is W[1]-hard. The distance to disjoint paths of a graph G is the minimum number of vertices we have to remove from G such that the reminder of G is a set of disjoint paths. Many well-known graph parameters can be upper-bounded in the distance to disjoint paths, e.g., pathwidth, treewidth, and feedback vertex number [57]. Hence, the following theorem also implies that Restless tempoRal path is W[1]-hard when parameterized by the pathwidth or the feedback vertex number of the underlying graph.

3
Let be the set of edges between vertices in U i and U j . We can assume that k ≥ 3 , otherwise we can solve the instance in polynomial time. Without loss of generality, we assume that for all Note that if this is not the case, we add new vertices and single edges to increase the cardinality of some set F i,j and this does not introduce new cliques since k ≥ 3 . We further assume without loss of generality that |U 1 | = |U 2 | = ⋯ = |U k | = n for some n ∈ ℕ . If this is not the case, we can add additional isolated vertices to increase the cardinality of some set U i . We construct a temporal graph G = (V, (E i ) i∈[ ] ) with two distinct vertices s, z ∈ V such that there is a -restless temporal (s, z)-path in G if and only if H contains a clique of size k. Furthermore, we show that the underlying graph G ↓ of G has a distance to disjoint paths of O(k 2 ).

Vertex Selection Gadgets. For each set
. Intuitively, this path contains a segment of length k for each vertex in U i which are separated by the vertices w (i) j , and the construction will allow a -restless temporal (s, z)path to skip exactly one of these segments, which is going to correspond to selecting this vertex for the clique.
For all j ∈ [n] and x ∈ [k − 1] we connect vertices v (i) j,x and v (i) j,x+1 with an edge at time Lastly, we introduce a "skip vertex" s (i) that will allow a -restless temporal (s, z)path to skip one path segment of length k that corresponds to one of the vertices in U i . For each j ∈ [n + 1] , we connect vertices s (i) and w (i) j with an edge at time (i − 1) ⋅ n + j. Now we connect the gadgets for all U i 's in sequence, that is, a -restless temporal (s, z)-path passes through the gadgets one after another, selecting one vertex of each part U i . Formally, for all i ∈ [k − 1] , we connect vertices w (i) n+1 and w (i+1) 1 with an edge at time i ⋅ n + 1 . It is easy to check that after the removal of the vertices {s (1) , s (2) , … , s (k) } , the vertex selection gadget is a path. The vertex selection gadget is visualized in Fig. 4.
Validation Gadgets. A -restless temporal (s, z)-path has to pass through the validation gadgets after it passed through the vertex selection gadgets. Here, we are forced to choose a point in time where we visit two vertices of two different vertex selection gadgets. This choice corresponds to the selection of an edge. Intuitively, this should only be possible if the selected vertices form a clique. We construct the gadget in the following way. 4 , respectively. Intuitively, the first path selects an edge from U i to U j and the transition to the second path should only be possible if the two endpoints of the selected edge are selected in the corresponding vertex selection gadgets.
Formally, for each edge e 3 and v 3 and s (i,j) 3 with an edge at time h+1,1 with an edge at time y i,j + 2h and we connect vertices v 4 and v can be interpreted as a "time offset" for the validation gadget for F i,j , the value is computed by adding all time steps needed in validation gadget for and v (i) a,j (from the vertex selection gadget for U i ) with an edge at time y i,j + 2h − 1 , we connect vertices s b,i (from the vertex selection gadget for U j ) with an edge at time y i,j + 2h − 1 , and we connect vertices s Intuitively, the time labels on the edges and the waiting time restrictions enforce that when arriving at s 1 there is only one way to continue to s (i,j) 2 for which is it necessary to visit a vertex in the vertex selection gadget that corresponds to an endpoint Now we connect the gadgets for all F i,j 's in sequence, that is, a -restless temporal (s, z)-path passes through the gadgets one after another, selecting one edge of each 4 and v with an edge at time y i,j+1 . It is easy to check that after } , the validation gadgets are a set of disjoint paths, see Fig. 5.
Finally, we create two new vertices s and z, we connect vertices s and w (1) 1 (the "first" vertex of the vertex selection gadgets) with an edge at time one, we connect vertices s and s (1) (the "skip vertex" of the first vertex selection gadget) with an edge at time one, and we connect z and v (k−1,k) m,4 (the "last" vertex of the validation gadgets) Fig. 5 Visualization of the validation gadget for F i,j from the reduction of Theorem 2. The "first path" of the gadget is depicted vertically on the left, the "second path" on the right. The connections to the vertex selection gadgets for the edge e with an edge at time k ⋅ n + m ⋅ (3k 2 + 5k + 3) . We further connect vertices w (k) n+1 and v (1,2) 1,1 (connecting the vertex selection gadgets and the validation gadgets) with an edge at time k ⋅ n . Finally, we set = 1 . This completes the construction. It is easy to check that G can be constructed in polynomial time and that the distance to disjoint paths of G ↓ is at most k + 3 ⋅ k 2 and that every edge has only one time stamp.
Correctness. Now we show that H contains a clique of size k if and only if there is a -restless temporal path from s to z in G.
(⇒) : Assume that H contains a clique of size k and let X ⊆ V(H) with |X| = k be the set of vertices that form the clique in H. Now we show how to construct a -rest- . The temporal path starts at vertex s in G and then first passes through the vertex selection gadgets. If u (i) j ∈ X for some i ∈ [k] and j ∈ [n] , then the temporal path skips the segment corresponding to u (i) j in the vertex selection gadget for U i . More formally, the temporal path follows the vertices It is easy to check that the time labels of the edges in the vertex selection gadget allow for a restless temporal path as described that respects the waiting time .
In the validation gadget for F i,j with i < j , the path "selects" the edge have not been used by the path in the vertex selection gadgets, since they appear in the segments that were skipped by the temporal path in the corresponding vertex selection gadgets. Furthermore, since the clique in H only contains one edge that connects vertices from U i and U j , the vertices v (i) a,j and v (j) b,i have not been used by the temporal path in an earlier validation gadget. It is easy to check that the time labels of the edges in the validation gadget allow for a -restless temporal path as described. After the last validation gadget the path arrives at vertex z. Hence, we have found a -restless temporal (s, z)-path in G.
(⇐) : Assume that we are given a -restless temporal (s, z)-path in G . We now show that H contains a clique of size k.
After starting at s, the -restless temporal path first passes the vertex selection gadgets. Here, we need to make the important observation, that for each i ∈ [k] , any -restless temporal (s, z)-path has to "skip" at least one segment corresponding to one vertex u (i) j ∈ U i in the vertex selection gadget corresponding to U i , otherwise the temporal path cannot traverse the validation gadgets. More formally, assume for contradiction that there is a -restless temporal (s, z)-path and an i ∈ [k] such that the temporal path visits all vertices in the vertex selection gadget corresponding to U i . Let j ∈ [k] with j ≠ i . Assume that i < j (the other case works analogously). We claim that the temporal path cannot traverse the validation gadget for F i,j . For the temporal path to go from s 2 by construction it has to visit at least one vertex from the vertex selection gadget for U i . If all vertices have already been visited, that would mean the -restless temporal (s, z)-path visits one vertex twice-a contradiction.
The waiting time prevents the temporal path from "skipping" more than one segment. More formally, any -restless temporal (s, z)-path arrives at the "skip vertex" s (i) of the vertex selection gadget for U i at time (i − 1) ⋅ n + j , for some j ∈ [k − 1] . By construction this means the path visits w (i) j , then s (i) , and then has to continue with w (i) j+1 since there is only one time edge the path can use without violating the waiting time . It follows that the temporal path skips exactly the segment This implies that any -restless temporal (s, z)-path that traverses the vertex selection gadgets leaves exactly one segment of every vertex selection gadget unvisited. 1 is an unvisited vertex.} be the set of vertices corresponding to the segments that are "skipped" by the given -restless temporal (s, z)-path. It is easy to check that |X| = k . We claim that X is a clique in H.
Assume for contradiction that it is not. Then there are two vertices We show that then the -restless temporal (s, z)-path is not able to pass through the validation gadget for F i,j . By assumption we have that Note that the validation gadget is designed in a way that the first path "selects" an edge from F i,j and then the waiting time of one enforces that a -restless temporal (s, z)-path can only move from the first path to the second path of a validation gadget if the two endpoints of the selected edge are vertices whose corresponding segments in the vertex selection gadget were skipped. We have seen that for every U i with i ∈ [k] , the path segment corresponding to exactly one vertex of that set was skipped. Since we have that for every edge in F i,j that the segment corresponding to at least one of the two endpoints of the edge was not skipped. Hence, we have that the -restless temporal path cannot pass through the validation gadget of F i,j and cannot reach z-a contradiction. ◻

An FPT-Algorithm for Short Restless Temporal Path
In this section, we discuss how to find short restless temporal paths. Recall that in shoRt Restless tempoRal path, we are given an additional integer k as input and are asked whether there exists a -restless temporal (s, z)-path that uses at most k time edges. By Theorem 1 this problem is NP-hard. Note that in the contact tracing scenario from the beginning, we can expect to have a small k and a large temporal graph.

Theorem 3 shoRt Restless tempoRal path is
Note that we can solve shoRt Restless tempoRal path such that the running time is independent from the lifetime of the temporal graph. To show Theorem 3, we first reduce the problem to a specific path problem in directed graphs. Then, we apply known algebraic tools for multilinear monomials detection. Here, Theorem 3 (i) is based on Williams [60]. To get a deterministic algorithm with a running time almost linear in |G| , we show a different approach based on representative sets [31] which results in Theorem 3 (ii).
Reduction to directed graphs. We introduce a so-called -(s, z)-expansion for two vertices s and z of a temporal graph with waiting times. That is, a time-expanded version of the temporal graph which reduces reachability questions to directed graphs. While similar approaches have been applied several times [4,12,50,61,62], to the best of our knowledge, this is the first time that waiting-times are considered. In a nutshell, the -(s, z)-expansion has for each vertex v at most many copies v 1 , … , v and if an (s, z)-dipath visits v i , it means that the corresponding -restless temporal (s, z)-walk visits v at time i.
Next, we show that a -(s, z)-expansion of a temporal graph can be computed efficiently.

Lemma 2 Given a temporal graph
, two distinct vertices s, z ∈ V , and ≤ , we can compute its -(s, z)-expansion D with Proof Let V � ∶= {s, z} and E ′ be empty in the beginning. We will fill up V ′ and E ′ simultaneously. In order to do that efficiently, we will maintain for each ver- We proceed as follows. For each t ∈ {1, … , } (in ascending order), we iterate over E t . For each {v, w} ∈ E t , we distinguish three cases.

(w = s):
We add v t to V ′ , (s, v t ) to E ′ , and add t to L v . This can be done in constant time. (w = z): We add v t to V ′ , and add t to L v . Now we iterate over all i ∈ L v (in descending order) and add Observe that after this procedure the digraph D = (V � , E � ) is the -(s, z)-expansion of G and that we added at most 2 vertices for each time-edge in G . Hence, V ′ ≤ |G| . This gives a overall running time of O(|G| ⋅ ). ◻ It is easy to see that there is a -restless temporal (s, z)-walk in the temporal graph if and only if there is an (s, z)-dipath in the -(s, z)-expansion. Next, we identify the necessary side constraint to identify -restless temporal (s, z)-paths in the -(s, z)-expansion.
In order to get an (s, v Hence, we have an (s, v Thus, P is a -restless temporal (s, z)-path of length k. ◻

Obtaining Theorem 3 (i)
We now adapt the algorithm of Williams [60] to our specific needs. To this end, we introduce some standard notation from algebraic theory.
An arithmetic circuit C over a commutative ring R is a simple labelled directed acyclic graph with its internal nodes labeled by + (sum gates) or × (product gates) and its nodes of in-degree zero (input gates) labeled with elements from R ∪ X , where X is a set of variables. There is one node of out-degree zero, called the output gate. The size of C is the number of vertices in the graph. An arithmetic circuit C over R computes a polynomial P(X) over R in the natural way: an input gate represents the polynomial it is labeled by. A sum (product) gate represents the sum (product) of the polynomials represented by its in-degree neighbors. We say C represents P(X) if the polynomial of the output gate of C is equivalent to P(X). The idea of the polynomial is similar to the one of Williams [60], but here instead of having one variable for each vertex we just have one variable for all vertices in one part of the partition of V.
Proof We define the polynomial recursively as Q(X) = x ⊥ Q k z over variables Note that we can, by simply following (1), construct an arithmetic circuit C which represents Q(X) in O(k(n + |A|)) time such that each product gate has an in-degree of two. Furthermore, observe that Q(X) has no scalar multiplication and is of degree at most k + 1.
of length at most j − 1 , and |V(P) ∩ V i | ≤ 1 for all i ∈ [n] . By induction hypothesis x ⊥ Q j−1 u contains a multilinear monomial M of degree at most j which does not contain

Obtaining Theorem 3 (ii) To show Theorem 3 (ii)
, we first note that in the (s, z)expansion of an (s, z)-path P in the directed graph describes a -restless temporal (s, z)-path exactly when V(P) is an independent set of some specific matroid. We then show an algorithm to find such a path P (if there is one). To this end, we introduce a problem, inDepenDent path, and some standard terminology from matroid theory [55]. A pair (U, I) , where U is the ground set and I ⊆ 2 U is a family of independent sets, is a matroid if the following holds: � ∈ I ; if A ′ ⊆ A and A ∈ I , then A � ∈ I ; and if A, B ∈ I and |A| < |B| , then there is an x ∈ B ⧵ A such that A ∪ {x} ∈ I . An inclusion-wise maximal independent set A ∈ I of a matroid M = (U, I) is a basis. The cardinality of the bases of M is called the rank of M. The uniform matroid of rank r on U is the matroid (U, I) with I = {S ⊆ U | |S| ≤ r} . A matroid (U, I) is linear or representable over a field if there is a matrix A with entries in and the columns labeled by the elements of U such that S ∈ I if and only if the columns of A with labels in S are linearly independent over . Such a matrix A is called a representation of (U, I) . Now we are ready to state the inDepenDent path problem.

3
For the remainder of this section, whenever we speak about independent sets, these are independent sets of a matroid and not a set of vertices which induce an edgeless graph.
Agrawal et al. [1] studied, independently from us, a similar problem where the edges of the path shall be an independent set of a matroid. To show Theorem 3 (ii), we need a single-exponential algorithm which has only a linear dependency on the input size. To this end, we show the following, based on representative families. In this section, we provide a fixed-parameter algorithm for inDepenDent path parameterized by rank r of the matroid. Since the rank r is at most |V(D)|, this algorithm is asymptotically optimal, see Corollary 3. To show Theorem 5, we provide an algorithm (Algorithm 4.1), show its correctness (Lemma 5), and prove the running time upper-bound (Lemma 6). The idea of our algorithm is based on the algorithm of Fomin et al. [31] for k -path and independently from us Agrawal et al. [1] showed an algorithm which runs in 2 O(r) n O(1) time for inDepenDent path and Lokshtanov et al. [48] provided a dynamic program, running in 5.18 r n O(1) time, for the special case of inDepenDent path when the matroid given in the input is a transversal matroid. However, in contrast to Agrawal et al. [1] and Lokshtanov et al. [48], we pay attention to the detail that the algorithm behind Theorem 5 runs in linear time, if we can perform one field operation in constant time.
The main tool of our algorithm are representative families of independent sets. Definition 3 (Representative family) Given a matroid (U, I) , and a family S ⊆ 2 U , we say that a subfamily � S ⊆ S is a q-representative for S if, for each set Y ⊆ U of size at most q, it holds that: A p-family is a family F such that each set S ∈ F is of size exactly p. For linear matroids, we can compute small representative families efficiently. Formally, the following is known. We are now ready to give the pseudo-code of the algorithm behind Theorem 5 (see Algorithm 4.1). In

Lemma 5 Algorithm 4.1 is correct.
Proof Let P w,i ∶= {X ∈ I | there is an (s, w)-dipath P of length i such that V(P) = X} , for all w ∈ V and i ∈ [r − 1] . Observe that P w,i is an (i + 1)-family of independent sets. We show by induction that after iteration i of the for-loop in Line (3) the entry T[w, i] is an (r − i)-representative of P w,i , for all w ∈ V and i ∈ [r − 1] . Then the correctness follows, since we check after each of these iterations whether T[w, i] is nonempty (Line (9)). Observe that P s,0 = {s} and P v,0 = � for all v ∈ V ⧵ {s} . Hence, the entries of T computed in Lines (1) and (2) fulfill our induction hypothesis. (3) and assume that for all j < i we have that T[w, j] is an (r − j)-representative of P w,j , for all w ∈ V . Fix a vertex w ∈ V . We first show that if there is an X ∈ T[i, w] , then there is an (s, w)-dipath P w of length i such that X = V(P w ) ∈ I . Observe that in Lines (5)- (7) we look at each possible predecessor v ∈ V of w in an (s, w)-dipath of length i, take each set X � ∈ T[v, i − 1] and check whether X � ∪ {w} is an independent set of size i + 1 . If this is the case, we add it to N w,i . After Line (8), we have that T[w, i] ⊆ N w,i . Since X � ∈ T[v, i − 1] , we know that there is an (s, v)-dipath P v of length i − 1 with X � = V(P) . Thus, if there is an X ∈ T[i, w] , then there is an (s, w)-dipath P w of length i such that X = V(P w ) ∈ I Now let X ∈ P w,i and Y ⊆ V(D) be a set of vertices of size at most r − i − 1 such that X ∩ Y = � and X ⊎ Y ∈ I . Hence, there is an (s, w)-dipath P of length i such that V(P) = X . Let v be the predecessor of w in P. Let P v be the (s, v) -dipath of length i − 1 induced by P without w. Hence, V(P v ) ∈ P v,i−1 . Moreover,

Now let i ∈ [r − 1] be the current iteration of the for-loop in Line
Next, we show that Algorithm 4.1 is actually a fixed-parameter algorithm parameterized by the length of a shortest -restless temporal (s, z)-path.

Lemma 6 Algorithm 4.1 runs in time of O(2 r ⋅ m) operations over , where is the field of A M , r is the rank of the matroid, m is the number of edges, and 2 < < 2.373 is an upper-bound for the matrix multiplication exponent.
Proof Without loss of generality we assume to have a total ordering on V. We represent a subset of V as a sorted string. Hence, union and intersection of two sets of size at most r takes O(r) time. We can thus look up and store sets of size at most r in a trie (or radix tree) in O(r) time [21]. Note that we do not have the time to completely initialize the arrays of size |V| in each trie node. Instead, we will initialize each array cell of a trie node at its first access. To keep track of the already initialized cells, we use sparse sets over V which allows membership test, insertion, and deletion of elements in constant time [16].
We denote the in-neighborhood of a vertex w by N − (w) ∶= {v ∈ V | (v, w) ∈ E} . Furthermore, let H i,w be the running time of Lines (5)-(7) in iteration i of the forloop in Line (3), and R i,w be the number of operations over of Line (8)

in iteration i of the for-loop in Line (3). Then we can run Algorithm 4.1 in time of
Note that M is of rank |V| and hence too large to show Theorem 3 with Theorem 5.
A k-truncation of a matroid (U, I) is a matroid (U, {X ∈ I | |X| ≤ k}) such that all independent sets are of size at most k. The k-truncation of a linear matroid is also a linear matroid [49]. In our reduction from shoRt Restless tempoRal path to inDepenDent path we use a (k + 1)-truncation of matroid M. Two general approaches are known to compute a representation for a k-truncation of a linear matroid-one is randomized [49] and one is deterministic [47]. 7 Both approaches require a large field implying that one operation over that field is rather slow. However, for our specific matroid we employ the Vandermonde matrix to compute a representation over a small finite field. Note that we would not get a running time linear in the input size by applying the algorithm of Lokshtanov et al. [47] or Marx [49] on M. Lemma 7 Given a universe U of size n, a partition P 1 ⊎ ⋯ ⊎ P q = U , and an integer k ∈ ℕ , we can compute in O(kn) time a representation A M for the matroid  6 Partition matroids are linear [49]. 7 For both algorithms, a representation of the original matroid must be given. memory cell can store only O(log n) many bits, where n is the input size. This avoids abuse of the unit cost random access machine by for example multiplying very large numbers in constant time.
Without loss of generality we assume that q ≤ n . Let p be a prime number with q ≤ p ≤ 2q . Such a prime exists by the folklore Betrand-Chebyshev Theorem [2] and can be computed in O(n) time using Lagarias-Odlyzko Method [58]. To perform one operation on the prime field p , one can first perform the primitive operation in ℤ and them take the result modulo p. Since p ≤ 2q ∈ O(n) , each element of p fits into one cell of the Word RAM model of computation. Thus, we can perform one operation over p in constant time.
Let x 1 , … , x q be pair-wise distinct elements from p . To compute an (k × n) -matrix A M as representation for M over p , we compose (column-wise) for each ele-  + 1 , and (G, s, z, k, )  We now claim (G, s, z, k, ) is a yes-instance if and only if (D, s, z, A M ) is a yesinstance and contains an independent (s, z)-dipath of length at most k.
is an independent set of M. Thus, P ′ is a witness of length at most k for (D, s, z, A M ) being a yes-instance.

Proof of Theorem 3 (ii) Let
, s, z, k, ) be an instance of shoRt Restless tempoRal path.
To decide whether there is a witness of length k of I being a yes-instance, we first use Lemma

Corollary 3 Independent path is NP-hard and unless the ETH fails there is no 2 o(n) -time algorithm for it, where n is the number of vertices.
Note that from Theorem 1 we can further deduce that there is not much hope for fast or early restless temporal paths, that is, restless temporal path that have a small duration or an early arrival time. The instance constructed in the reduction has lifetime = 3 and hence the duration as well as the arrival time of any restless temporal path in this instance is at most three. This implies that we presumably cannot find fast or early restless temporal paths efficiently.

Computational Complexity Landscape for the Underlying Graph
In this section we investigate the parameterized computational complexity of Restless tempoRal path when parameterized by structural parameters of the underlying graph. We start by observing that whenever a parametrization forbids path of unbounded length, then we can use Theorem 3 to show fixed-parameter tractability. For example, if we consider the vertex cover number vc ↓ of the underlying graph, then we can deduce that any path in the underlying graph and hence any restless temporal path can have length at most 2vc ↓ + 1 . Thus, by Theorem 3, we get fixedparameter tractability of Restless tempoRal path when parameterized by the vertex cover number of the underlying graph.

Observation 3 Restless tempoRal path parameterized by the vertex cover number vc ↓ of the underlying graph is fixed-parameter tractable.
From a classification standpoint, we can improve this a little further by observing that the length of a path in the underlying graph can be bounded by 2 O(td ↓ ) [53], where td ↓ is the treedepth of the underlying graph.

Observation 4 Restless tempoRal path parameterized by the treedepth td ↓ of the underlying graph is fixed-parameter tractable.
One of the few dark spots of the landscape is the feedback edge number 8 of the underlying graph which is resolved in the following way.

Theorem 7 Restless tempoRal path can be solved in
∫ is the feedback edge number of the underlying graph.
By Corollary 1 we know that Theorem 7 is asymptotically optimal, unless ETH fails. In a nutshell, our algorithm to prove Theorem 7 has the following five steps: 1. Exhaustively remove all degree-1 vertices from G ↓ (except for s and z). 2. Compute a minimum-cardinality feedback edge set F of the graph G ↓ . 3. Compute a set P of O(− ∫ ) many paths in G ↓ − F such that every path in G ↓ − F is a concatenation of some paths in P. 4. "Guess" the feedback edges in F and paths in P of an (s, z)-path in G ↓ . 5. Verify whether the "guessed" (s, z)-path is a -restless temporal (s, z)-path in G.
First, we show that we can safely remove all (except s and z) degree-one vertices from the underlying graphs G ↓ .

Reduction Rule 1 (Low Degree Rule) Let
, s, z, ) be an instance of Restless tempoRal path, G ↓ be the underlying graph of G , v ∈ V ⧵ {s, z} , and deg G ↓ (v) ≤ 1 . Then, output (G − {v}, s, z, ). s, z, ) be an instance of Restless tempoRal path, For the safeness we can observe that a vertex v ∈ V ⧵ {s, z} with deg G ↓ (v) ≤ 1 cannot be visited by any -restless temporal (s, z)-path. To apply Reduction Rule 1 exhaustively, we iterate once over the set of time edges to store for each vertex v ∈ V ⧵ {s, z} its degree in a counter c v . Afterwards, we collect all vertices of degree 0 in X and all vertices of degree 1 in V 1 . Now we iterate over each vertex v ∈ V 1 , remove v from V 1 , add v to X, decrement the counter c u of its neighbor u. If c u becomes 1 we add u to V 1 . Note that this procedure ends after O(|V|) time.

Lemma 9 Reduction Rule 1 is safe and can be applied exhaustively in O(|G|) time.
Finally, we iterate one last time over the temporal graph G to construct the temporal graph G � ∶= G − X . The instance (G � , s, z, ) of Restless tempoRal path is the resulting instance when we apply Reduction Rule 1 exhaustively on I. ◻ Next, we consider a static graph G with no degree-one or degree-zero vertices. Let F be an minimum feedback edge set of G and let V F be the endpoints of the edges in F, that is V F = {v ∈ e | e ∈ F} . Let V ≥3 be the set of all vertices with a degree greater than two in G − F . We can partition the graph G − F into a set P of V F ∪ V ≥3 -connecting paths, that are, all paths in G − F who start and end in V F ∪ V ≥3 and have no internal vertices in that set of vertices. Note that all degree-one vertices of G − F are in V F . Hence, the graph G − F can be partitioned into V F ∪ V ≥3 -connecting paths. We can show that |P| ∈ O(− ∫ ).

Lemma 10 Let G be a graph with no degree-one vertices and F be an minimum feedback edge set of G. The set P of V F ∪ V ≥3 -connecting paths of G − F has size O(|F|) and can be computed in O(|G|) time.
Proof We can compute the set P in O(|G|) time as follows. We start with P = � and pick any leaf v ∈ V(G − F) of degree one. Recall that v ∈ V F and that G − F is cycle-free. There is at most one vertex w ∈ (V ≥3 ∪ V F ) ⧵ {v} such that there is a path P between v and w which does not contain internal vertices from V ≥3 ∪ V F . Note that also P is unique. We add P to P and remove V(P) ⧵ {w} from the graph. Now we repeat this procedure with the next leaf of degree one until the graph has no edges.
It is easy to verify that the number of paths is bounded by the number of vertices in V ≥3 ∪ V F . We know that |V F | is upper-bounded by 2|F|. It remains to show that |V ≥3 | is in O(|F|).
As shown by Bentert et al. [9,Lemma 2], the number of vertices with degree greater or equal to three is bounded by 3|F| in a graph with no degree-one vertices. Hence, the number of V F ∪ V ≥3 -connecting paths is bounded by 5|F|. ◻ With Lemmas 9 and 10 we can prove Theorem 7.

Proof of Theorem 7 Let
, s, z, ) be an instance of Restless tempoRal path and G ↓ be the underlying graph of G . Without loss of generality, we can assume that all vertices in V(G ↓ ) ⧵ {s, z} have a degree greater than one. If this is initially not the case, then we safely remove all degree-one vertices of the underlying graph exhaustively in O(|G|) time by Lemma 9.
First we compute an minimum feedback edge set Lemma 10. Note that the additional vertices s and z can increase the size of P by at most four. Now, for any subset of feedback edges F ′ ⊆ F and P ′ ⊆ P , we check whether . This can be decided in O(|G ↓ |) time by a simple breadth-first search on G ↓ starting at the vertex s and using only edges in F � ∪ E(P � ) . Last, we verify whether P forms a -restless temporal (s, z)-path in G . Therefore, we consider the temporal graph G P = (V, (E i ∩ E(P)) i∈[ ] ) which has P as underlying graph. Note that we can construct G P in O(|G|) time, by iterating once over the set of time edges of G . By Lemma 1 we can decide in O(|G P |) time whether G P has a -restless temporal (s, z) -path.
It is easy to check that the algorithm described above runs in 2 O(|F|) |G| time.
Correctness. It remains to show the correctness of the algorithm.
(⇒) : If our algorithm outputs yes, then there is a -restless temporal (s, z)-path in G P . The temporal graph G P contains a subset of the time edges of G , hence the -restless temporal (s, z)-path in G P is also present in G . It follows that I is a yes-instance.
(⇐) : Assume I is a yes-instance. Then there exists a -restless temporal (s, z)path in the temporal graph G .
. If we remove the edges in F ′ from P ′ then what remains is a collection of paths where each path is a concatenation of paths in P . Hence, there exists a subset P ′ ⊆ P such that F � ∪ E(P � ) = E(P) . Thus, we will find P ′ in G ↓ and, by Lemma 1, we will correctly verify that this P ′ forms a -restless temporal (s, z)-path in G. ◻ The results from Sects. 3 to 5 provide a good picture of the parameterized complexity landscape for Restless tempoRal path, meaning that for most of the widely known (static) graph parameters we know whether the problem is in FPT or W[1]-hard or para-NP-hard, see Fig. 2.
Our understanding of the class of temporal graphs where we can solve Restless tempoRal path efficiently narrows down to the following points. We can check efficiently whether there is a -restless temporal (s, z)-path P in temporal graph G if 1. there is a bounded number of (s, z)-path in G ↓ (cf. Theorem 7 and Lemma 1), 2. there is a bound on the length of P (cf. Theorem 3 and Observations 4 and 3).
Apart from that we established with Theorems 1, 2 and Corollary 2 hardness results for temporal graphs having restricted underlying graphs, see Fig. 2.
Finally, we show that we presumably cannot expect to obtain polynomial kernels for all parameters considered so far and most structural parameters of the underlying graph.

Proposition 1 Restless tempoRal path parameterized by the number n of vertices does not admit a polynomial kernel for all ≥ 1 unless NP ⊆ coNP/poly.
We employ the OR-cross-composition framework by Bodlaender, Jansen, and Kratsch [15] to refute the existence of a polynomial kernel for a parameterized problem under the assumption that NP ⊈ coNP/poly, the negation of which would cause a collapse of the polynomial-time hierarchy to the third level. In order to formally introduce the framework, we need some definitions.
An equivalence relation R on the instances of some problem L is a polynomial equivalence relation if 1. one can decide for each two instances in time polynomial in their sizes whether they belong to the same equivalence class, and 2. for each finite set S of instances, R partitions the set into at most (max x∈S |x|) O (1) equivalence classes.
Using this, we can now define OR-cross-compositions.
Definition 4 An OR-cross-composition of a problem L ⊆ Σ * into a parameterized problem P (with respect to a polynomial equivalence relation R on the instances of L ) is an algorithm that takes n R-equivalent instances x 1 , … , x n of L and constructs in time polynomial in ∑ n i=1 �x i � an instance (x, k) of P such that 1. k is polynomially upper-bounded in max 1≤i≤n |x i | + log(n) and 2. (x, k) is a yes-instance of P if and only if there is an i ∈ [n] such that x i is a yesinstance of L.
If an NP-hard problem L OR-cross-composes into a parameterized problem P, then P does not admit a polynomial kernel, unless NP ⊆ coNP/poly [15].
Intuitively, the first instance ) essentially forms the first 1 layers of G ⋆ . Then we introduce + 1 trivial layers, that is, Then we continue in the same fashion with the second instance and so on. We have that This instance can be constructed in polynomial time and the number of vertices is the same as the vertices in the input instances, hence |V ⋆ | is polynomially upperbounded by the maximum size of an input instance. Furthermore, it is easy to check that G ⋆ contains a -restless temporal (s ⋆ , z ⋆ )-path if and only if there is an i ∈ [n] such that G i contains a -restless temporal (s i , z i )-path. This follows from the fact that all instances are separated in time by + 1 trivial layers, hence no -restless temporal (s ⋆ , z ⋆ )-path can use time edges from different original instances. Since Restless tempoRal path is NP-hard (Theorem 1) the result follows. ◻

Timed Feedback Vertex Number
In this section we introduce a new temporal version of the well-studied "feedback vertex number"-parameter. Recall that by Theorem 2 we know that Restless tempoRal path is W[1] -hard when parameterized by the feedback vertex number of the underlying graph. This motivates studying larger parameters with the goal to obtain tractability results. We propose a new parameter called timed feedback vertex number which, intuitively, quantifies the number of vertex appearances that need to be removed from a temporal graph such that its underlying graph becomes cycle-free. Note that having vertex appearances in the deletion set allows us to "guess" when we want to enter and leave the deletion set with a -restless temporal (s, z)-path in addition to guessing in which order the vertex appearances are visited.
We remark that there also have been studies of removing (time) edges from temporal graph to destroy temporal cycles [36], that is, temporal paths from a vertex back to itself. Similarly, one also could remove vertex appearances to destroy temporal cycles, resulting in a parameter that is smaller than the timed feedback vertex number and incomparable to the feedback vertex number of the underlying graph. Note that the mentioned parameters aiming at destroying temporal cycles are unbounded in our reductions. We leave the parameterized complexity of Restless tempoRal path with respect to those parameters open for future research.
Before defining timed feedback vertex number formally, we introduce notation for removing vertex appearances from a temporal graph. Intuitively, when we remove a vertex appearance from a temporal graph, we do not change its vertex set, but remove all time edges that have the removed vertex appearance as an endpoint. Let G = (V, (E i ) i∈[ ] ) be a temporal graph and X ⊆ V × [ ] a set of vertex appearances. Then we write Formally, the timed feedback vertex number is defined as follows.

Definition 5 (Timed Feedback Vertex Number) Let
The timed feedback vertex number of a temporal graph G is the minimum cardinality of a timed feedback vertex set of G.
We can observe that for any temporal graph the timed feedback vertex number is as least as large as the feedback vertex number of the underlying graph and upper-bounded by the product of the feedback vertex number of the underlying graph and the lifetime. We further remark that the timed feedback vertex number is invariant under reordering the layers. At the end of this section we show how a timed feedback vertex set can be computed efficiently.
The main result of this section is that Restless tempoRal path is fixed-parameter tractable when parameterized by the timed feedback vertex number of the input temporal graph. To this end, we show the following.

Theorem 8 Given a timed feedback vertex set X of size x for a temporal graph
The algorithm we present to show Theorem 8 solves choRDal multicoloReD inDepenDent set, where given a chordal graph 9 G = (V, E) and a vertex coloring c ∶ V → [k] , we are asked to decide whether G contains an independent set of size k that contains exactly one vertex of each color. This problem is known to be NPcomplete [13,Lemma 2] and solvable in O(3 k ⋅ |V| 2 ) time [10, Proposition 5.6]. Our algorithm for Restless tempoRal path roughly follows these computation steps: 1. "Guess" which of and in which order the vertex appearances from the timed feedback vertex set appear in the -restless temporal (s, z)-path. 2. Compute the path segments between two timed feedback vertex set vertices by solving a choRDal multicoloReD inDepenDent set instance.
We give a precise description of our algorithm in Algorithm 6.1. Here, a partition , and for all v ∈ V with (v, t i ) ∈ I and (v, t j ) ∈ O it holds that i + 1 = j and t i ≤ t j ≤ t i + . Moreover, observe that for a vertex appearance (v, t) ∈ I , the -restless temporal (s, z)-path has to depart from v not later than t + and for vertex appearance (v, t) ∈ O , it has to arrive in v not earlier than t − . To this end, we define the notion of a valid path between two consecutive vertex appearances: , then we can "glue" them together and get a (t i , t i+2 )-valid -restless (v i , v i+2 )-walk (not necessarily a path). Thus if there exist a valid -restless temporal path between all consecutive pairs in a -ordering which are pairwise vertex disjoint (except for the endpoints), then there exist a -restless temporal (s, z)-path.
The idea of Algorithm 6.1 is that a -restless temporal (s, z)-path P induces a valid partition of the timed feedback vertex set X such that (v, t) ∈ I if P arrives v at time t, (v, t) ∈ O if P leaves v at time t, or otherwise (v, t) ∈ U . Furthermore, if we order M ∶= I ∪ O ∪ ({s, z} × {⊥}) according to the traversal of P (from s to z), then this is a -ordering such that a subpath P ′ of P corresponding to consecutive The algorithm tries all possible partitions of X and all corresponding -orderings. For each of these, we store the vertices V(P i ) ∩ V(T) in the family P i , for all valid -restless temporal are two consecutive vertex appearances in the -ordering. Here, we assume without loss of generality that no vertex appearance of s, z is in X. More specifically, for each two consecutive vertex appearances (v i−1 , t), (v i , t � ) in the -ordering our algorithm iterates over all pairs of time edges leading from (v i−1 , t) into the "forest" and from the "forest" back to (v i , t � ) . Since this fixes the entry points into the forest in each iteration, any two (t i , t i+1 )-valid -restless temporal (v i , v i+1 )-paths present in the iteration use the same vertices of the underlying graph. Hence it suffices to check whether one exists. Note that, if we have |P i | ≥ 0 for all i ∈ {1, … , x + 1} , then there is a -restless (s, z)-walk in G . Hence, to find a -restless temporal (s, z)path, we have to find x + 1 pair-wise disjoint sets P (1) 1 , … , P (x+1) x+1 such that P i ∈ P i . Here, we observe that the intersection graph in Line (12) is chordal [35] and use an algorithm of Bentert et al. [10] for choRDal multicoloReD inDepenDent set as a subroutine to find such pairwise-disjoint P (1) 1 , … , P (x+1) x+1 .

Lemma 11
Note that during one iteration of the loop in Line (4) we consider an time edge of G at most two times as e 1 and two times as e 2 in Line (8). Hence, we have O(|G| 2 ) many iteration of the loop in Line (8) be a temporal graph with s, z ∈ V and let X be a timed feedback vertex set of G . We assume without loss of generality that s and z have no vertex appearance in X, that is, s, z ∉ {v | (v, t) ∈ X} . If this is not the case, then we can add a new vertex ŝ to G and for each edge {s, v} ∈ E i , we add {ŝ, s} to E i . It is clear that there exists a -restless temporal (s, z)-path P if and only if there exists a -restless temporal (ŝ, z)-path P . The set X remains a time feedback vertex set because ŝ has degree one in the underlying graph G ↓ . Hence, we can now ask for a -restless temporal (ŝ, z)-path in G . The same holds for the vertex z by a symmetric argument.
We show now that Algorithm 6.1 outputs yes if and only if there is a -restless temporal (s, z)-path in G.
(⇒) : We claim that if we find a multicolored independent set in (G, c), then there is a -restless temporal (s, z)-path in G = (V, (E i ) i∈[ ] ) . Let D = {P (1) 1 , … , P (x+1) x+1 } be such an multicolored independent set, let (v 0 , t 0 ) ≤ ⋯ ≤ (v x+1 , t x+1 ) be the respective Algorithmica (2021) (⇐) : Assume G contains a -restless temporal (s, z)-path P, then let I ⊎ O ⊎ U = X be the partition of X that is induced by P. That is, for all (v, t) ∈ I there exists a time edge (w, v, t) in P, for all (v, t) ∈ O there exists a time edge (v, w, t) in P, and for all (v, t) ∈ U there exist no time edge (v, w, t) or (w, v, t) in P. The partition I ⊎ O ⊎ U is a valid partition. Otherwise there exist two distinct vertex appearances (v, t), (v, t � ) ∈ O such that there exist two time edges (w, v, t), (u, v, t � ) in P indicating that P visits the vertex v twice. The same argument works for two vertex appearances of the same vertex in I. Let (v 1 , t 1 ) ≤ ⋯ ≤ (v x , t x ) be the vertex appearances in the order in which they are visited by P. It holds that t 1 ≤ … ≤ t x and for i < j ∈ [x] if v i = v j , then there cannot exist a vertex appearance between v i and v j (otherwise P would visit v i twice). Thus then it holds that P i is empty and P i = {�} (Line (7)). Otherwise, let P i = (e (1) (11)).
It holds that for i ≠ j ∈ [x + 1] the paths P i and P j can intersect only in their endpoints because P does not visit a vertex twice and thus Q i ∩ Q j = � . For each P i there exists a vertex P (i) i in the intersection graph G representing with c(P (i) Hence, G has a multicolored independent set D = {P (1) of size x + 1 and Algorithm 6.1 outputs yes. ◻ To conclude from Theorem 8 the fixed-parameter tractability of Restless tem-poRal path parameterized the timed feedback vertex number, we need to compute a timed feedback vertex set efficiently. This is clearly NP-hard, since it generalizes the NP-complete FeeDback VeRtex set problem [43]. However, we establish the following possibilities to compute a FeeDback VeRtex set. To prove Proposition 9, we first show that a timed feedback vertex set of a temporal graph can be computed via the following problem.
Then the 8-approximation for timed feedback vertex set follows from the 8-approximation of Even et al. [27] for WeighteD subset FeeDback set. 10 Now we see two ways in the literature to deduce a FPT-algorithm for timed feedback vertex set. One is via a reduction from sFVs-uV to the more general problem gRoup subset FeeDback VeRtex set. The other is through Cygan et al. [22] who claim that sFVs-uV is equivalent (under parameterized reductions for k) to subset FeeDback VeRtex set. The latter is sFVs-uV where V ∞ = � . While the arguments of Cygan et al. [22] only work if V ∞ ∩ T = � , we here provide the missing arguments to show that the statement itself is true and hence fill a gap in the literature.

Proof of Lemma 13
Let G = (V, E 1 , … , E ) be a temporal graph, x ∈ ℕ , and I = (G, V ∞ , T, x) be the resulting instance from Construction 1. It is easy to check that Construction 1 can be computed in O(|G| + |V| 2 ) time.
We now claim that there is a timed feedback vertex set X of size at most x in G if and only if there is a subset feedback vertex X of size at most x in G such that Hence, |Y| ≤ x and Y ∩ V ∞ = � . We claim that Y is a subset feedback vertex set for I. Assume towards a contradiction that there is a simple cycle C in G − Y which contains a vertex of T. Furthermore, we assume without loss of generality that there is no shorter cycle in G − Y which contains a vertex of T. Observe that this implies that C does not visit three distinct vertices v a , v b , v c ∈ V v , for any v ∈ V , because otherwise there is a shorter cycle using one of the edges because otherwise there is a shorter cycle using the edge {v a , v b } . Furthermore, for all edge e ∈ E we have that V e ⊆ V(C) or V e ∩ V(C) = � , because G[V e ] induces a P 3 and hence using only an endpoint of that P 3 would imply that C visits two vertices v a , v b ∈ V v without the edge {v a , v b } , for some v ∈ V . Since T only contains the middle vertex e (T) ∈ E e of the P 3 induced by G[V e ] , we can observe that C is a subdivision of a cycle in G ↓ (G − X) which contradicts that X is a timed feedback vertex set for G.
Hence, X is of size at most x. We claim that X is a timed feedback vertex set for G . Assume towards a contradiction that this is not the case and there is a cycle C in G ↓ (G − X) . We now build a cycle in G − Y containing a vertex from T. Note that for each edge e used in C none of the vertices in V e are in Y, otherwise V ∞ ∩ Y ≠ � . Hence, set V C ∶= ⋃ e∈E(C) E e , where E(C) is the edge set of C. Since any two incident edges e 1 , e 2 ∈ E(C) are in the underlying graph of G − X , we know that there are t 1 , t 2 ∈ [ ] such that (e 1 , t 1 ) and (e 2 , t 2 ) are time edges of G − X . Hence, for two incident edges e 1 , e 2 ∈ E(C) with {v} = e 1 ∩ e 2 we pick t 1 , t 2 ∈ [ ] such that (e 1 , t 1 ) and (e 2 , t 2 ) are time edges of G − X add v t 1 , v t 2 ∈ V v to V C . Observe that G[V C ] contains a cycle and that V C ∩ T ≠ � . Since we constructed V C from a cycle in the underlying graph of G − X we have V C ∩ Y = � . This is a contradiction. ◻ Now we can use the polynomial-time 8-approximation of Even et al. [27] for WeighteD subset FeeDback VeRtex set and Lemma 13 to conclude the following. 11

Corollary 4
There is a polynomial-time 8-approximation for timed feedback vertex set.
In the remainder of this section we prove the following.

Lemma 14
Given an instance I = (G, V ∞ , T, k) of sUbset Feedback VeRtex set wIth Undeletable VeRtIces we can construct in O(k 2 (|V| + |E|)) time an instance I � = (G, T � , k � ) of sUbset Feedback VeRtex set with k ′ ≤ k such that I is a yesinstance if and only if I ′ is a yes-instance.
Note that the running time of the algorithm behind Lemma 14 depends only linearly on the size of the graph. The proof of Lemma 14 is deferred to the end of this section. First, we introduce two data reductions rules and then perform the reduction behind Lemma 14 in two steps. We use these data reduction rules to get an equivalent instance where G[T ∩ V ∞ ] is an independent set. We start by detecting some no-instances.
Reduction Rule 2 Let I = (G, V ∞ , T, k) be an instance of subset FeeDback VeRtex set With unDeletable VeRtices such that there is a vertex u and a simple cycle C intersecting T where V(C) ⧵ (T ∩ V ∞ ) ⊆ {u} ⊆ V ∞ . Then output a trivial no-instance.
We now show that we can detect in linear-time whether Reduction Rule 2 is applicable and that it is safe. The latter means that the application of Reduction Rule 2 does not turn a yes-instance into a no-instance or vice versa.

Lemma 15 Reduction Rule 2 is safe and can be applied in linear time.
Proof Since C is a witness that I is a no-instance, Reduction Rule 2 is safe. We check whether there is cycle C such that V(C) ⧵ (T ∩ V ∞ ) = � by simply checking whether G[T ∩ V ∞ ] is a forest. Assume that G[T ∩ V ∞ ] is a forest, otherwise we are done and output a trivial no-instance. First, we partition V(G[T ∩ V ∞ ]) = Q 1 ⊎ ⋯ ⊎ Q c such that Q i is a maximal connected component of G[T ∩ V ∞ ] . Clearly, this can be done in linear time. For each connected component Q i of G[T ∩ V ∞ ] we first unmark all vertices in V ⧵ (T ∩ V ∞ ) . Then we iterate over all vertices v ∈ Q i and mark all vertices in N G (v) ∩ (V ∞ ⧵ T) . If we find a vertex w ∈ Q i such that there is a vertex u ∈ N G (w) ∩ (V ∞ ⧵ T) which is already marked, then the path from v to w in Q i together with u is a cycle C where V(C) ⧵ (T ∩ V ∞ ) ⊆ {u} ⊆ V ∞ . Hence, we output a trivial no-instance in this case. Moreover, if there is some simple cycle C where V(C) ⧵ (T ∩ V ∞ ) ⊆ {u} ⊆ V ∞ , then all vertices V(C) ⧵ {u} belong to the same connected component of G[T ∩ V ∞ ] . Thus, the above described procedure will find C. A simple application of the Handshaking Lemma shows that this procedure ends after linear time. ◻ The purpose of the next data reduction rule is to merge undeletable terminal vertices which do share an edge. Output

Reduction
Note that for each edge in G[T ∩ V ∞ ] , either Reduction Rule 2 or Reduction Rule 3 is applicable. While it is easy to apply Reduction Rule 3 exhaustively in polynomial time, more effort is required to do the same in linear time. To this end, we will construct in linear time an equivalent instance such that Reduction Rules 2 and 3 are not applicable.  remaining budget k ′ , we set K = � . Then, for each connected component Q i of G[T ∩ V ∞ ] , we first unmark all vertices. Second, we iterate over all vertices v ∈ Q i and mark all vertices in N G (v) ⧵ (T ∩ V ∞ ) . If we find a vertex w ∈ Q i such that a vertex u ∈ N G (w) ⧵ (T ∩ V ∞ ) which is already marked, then we add u to K, because G[Q i ∪ {u}] contains a cycle intersecting T where u is the only deletable vertex. Recall that u ∉ V ∞ , since Reduction Rule 2 was not applicable. A simple application of the Handshaking Lemma show that this procedure ends after linear time. If k < |K| , then we return a trivial no-instance, because for each vertex v ∈ K there is a simple cycle intersecting T where v is the unique vertex not in V ∞ ∩ T . Otherwise, we output I � = (G � − K, V �∞ , T � ⧵ K, k � = k − |K|) . It is easy to verify that Reduction Rule 3 is not applicable in I ′ . We now claim that I is a yes-instance if and only if I ′ is a yes-instance.

Lemma 16 Given an instance I of sUbset
(⇒) : Assume that X is a solution for I. Note that for each vertex v ∈ K , there is a simple cycle intersecting T where v is the unique vertex not in V ∞ ∩ T . Hence, K ⊆ X . Set X � ∶= X ⧵ K and observe that X � ⊆ V(G � ) . The set X ′ is a solution for I ′ , because it is of size at most k ′ and for each cycle in G � − K which intersects to T ′ ⧵ K , we can construct a cycle in G which intersects to T by replacing a vertex q j ∈ {q i | i ∈ [c]} with a path in G[Q j ].
(⇐) : Assume that X ′ is a solution for I ′ . We set X ∶= X � ∪ K and note that X is of size at most k. We may assume towards a contradiction that X is not a solution for I. Hence there is a simple cycle C in G − X which contains a vertex of T. We now construct a closed walk of C ′ in G � − T from C by replacing a subpath on vertices in Q i with q i , for all i ∈ [c] . Since we only replaced vertices from T ∩ V ∞ of I with vertices in T � ∩ V �∞ , the closed walk C ′ contains a simple cycle in G � − X � containing a vertex from T ′ -a contradiction. ◻ We now show an algorithm to dispose all vertices undeletable vertices in T such that the running time dependence only linearly on the size of the graph.

Lemma 17
Let I = (G, V ∞ , T, k) be an instance of sUbset Feedback VeRtex set wIth Undeletable VeRtIces. We can construct in O(k(|V| + |E|)) time an instance I � = (G � , V �∞ , T � , k � ) of sUbset Feedback VeRtex set wIth Undeletable VeRtIces such that

I is a yes-instance if and only if I ′ is a yes-instance.
Proof Let I = (G, V ∞ , T, k) be an instance of subset FeeDback VeRtex set With unDeletable VeRtices. Since we aim for a running time of O(k(|V| + |E|)) , we can assume that Reduction Rules 2 and 3 are not applicable on I, see Lemma 16. By using Lemmas 13 and 14 we now can compute a minimum timed feedback vertex set by any known subset FeeDback VeRtex set algorithms. Thus, Lemmas 13 and 14 and Corollary 4 together with the algorithm of Iwata et al. [42] imply Proposition 9.

Conclusion
We have analyzed the (parameterized) computational complexity of Restless tem-poRal path, a canonical variant of the problem of finding temporal paths, where the waiting time at every vertex is restricted. Unlike its non-restless counterpart or the "walk-version", this problem turns out to be computationally hard, even in quite restricted cases. On the positive side, we give an efficient algorithm to find short restless temporal paths and we could identify structural parameters of the underlying graph and of the temporal graph itself that allow for fixed-parameter algorithms.