Complexity Gaps Between Point and Interval Temporal Graphs for Some Reachability Problems
Abstract
Temporal graphs arise when modeling interactions that evolve over time. They usually come in several flavors, depending on the number of parameters used to describe the temporal aspects of the interactions: time of appearance, duration, delay of transmission. In the point model, edges appear at specific points in time, whereas in the more general interval model, edges can be present over specific time intervals. In both models, the delay for traversing an edge can change with each edge appearance. When time is discrete, the two models are equivalent in the sense that the presence of an edge during an interval is equivalent to a sequence of point-in-time occurrences of the edge. However, this transformation can drastically change the size of the input and has implications for complexity. Indeed, we show a gap between the two models with respect to the complexity of the classical problem of computing a fastest temporal path from a source vertex to a target vertex, i.e., a path where edges can be traversed one after another in time and such that the total duration from source to target is minimized. It can be solved in near-linear time in the point model, while we show that the interval model requires quadratic time under classical assumptions of fine-grained complexity. With respect to linear time, our lower bound implies a factor of the number of vertices, while the best known algorithm has a factor of the number of underlying edges. We also show a similar complexity gap for computing a shortest temporal path, i.e., a temporal path with a minimum number of edges. Here our lower bound matches known upper bounds up to a logarithmic factor. Interestingly, we show that near-linear time for fastest temporal path computation is possible in the interval model when it is restricted to uniform delay zero, i.e., when traversing an edge is instantaneous. However, this special case is not exempt from our lower bound for shortest temporal path computation. These two results should be contrasted with the computation of a foremost temporal path, i.e., a temporal path that arrives as early as possible. It is well known that this computation can be solved in near-linear time in both models. We also show that there is no gap in testing the all-to-all temporal connectivity of a temporal graph. We demonstrate a quadratic lower bound that applies to both the interval and point models and aligns with the existing upper bounds.
Keywords and phrases:
Temporal graphs, Dynamic networks, Time-dependent networks, Temporal connectivity, Foremost, Fastest or Shortest temporal path, Fine-grained complexityCopyright and License:
2012 ACM Subject Classification:
Theory of computation Graph algorithms analysis ; Theory of computation Shortest pathsFunding:
Supported by the French ANR project ANR-22-CE48-0001 (TEMPOGRAL).Editors:
George B. Mertzios and Andréa W. RichaSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
Graphs are the standard mathematical framework for representing relationships within networks. However, in many real-world scenarios, such as transportation systems or social networks, these relationships are time-sensitive and evolve over time. Temporal graphs address this dynamic nature by modeling networks where connections change over time. Their study traces back to time-dependent networks [12] in the context of road networks. They were later re-introduced under various flavors of models, see e.g. [8, 22, 26, 28]. In the simplest model, each edge appears at specific points in time. In the most advanced model, each edge is present for entire time intervals, and the delay for traversing it is given by a time-dependent function, often assumed to be piecewise linear (and, without loss of generality, linear in each interval of appearance). We are interested in highlighting the difference in complexity between these two models, which we will call point temporal graph and interval temporal graph, respectively.
Note that the interval model obviously encompasses the point model, since a point in time corresponds to a time interval with equal bounds. In both models, each appearance of an edge can be represented by a tuple storing the two vertices of the edge with the few associated time parameters (assuming linearity in each appearance interval for the interval model), and the size of the input can be measured by the total number of such edge appearances. If we remove the time information from the list of tuples describing a temporal graph, and forget about multiplicities, we obtain what we call its underlying graph. If time is discrete, the two models may seem equivalent, since an edge appearance during an interval of length can be seen as point-by-point appearances. However, the size of the input can then grow by an exponential factor, leading to different complexities in solving a problem in one model or the other.
A recent strand of research revisits all classical graph problems in the context of temporal graphs, see e.g. [2, 9, 19, 25, 27, 29]. Most of these works focus on the point model while the interval model may have been overlooked. Interestingly, the natural notion of connectivity in temporal graphs arises from temporal paths whose computation is the subject of various works in both models (see e.g. [6, 35]). A temporal path is a path whose edges can be traversed one after another sequentially in time. When considering all temporal paths between a source vertex and a target vertex, the time aspect gives rise to several notions of shortest path: in particular, a foremost temporal path arrives at the target as early as possible, a shortest temporal path uses a minimum number of edges, and a fastest temporal path has a minimum duration, i.e. the time span between leaving the source and arriving at the target is minimal.
First, we observe discrepancies between the two models with respect to the complexity of known algorithms for computing a shortest or a fastest temporal path. They can both be found in near-linear time in the point model [35], while in the interval model the best algorithms for computing a shortest temporal path [6, 24] or a fastest temporal path [14] are slower by a factor depending on the size of the input, and respectively, if the input has vertices and the underlying graph has edges. On the other hand, foremost temporal paths can be computed in near-linear time in both models using a variant of Dijkstra’s algorithm [16, 6]. To the best of our knowledge, no non-trivial lower bounds are known. Thus, we ask whether a slowdown factor proportional to the number of vertices is necessary to compute a fastest or a shortest temporal path in the interval model.
Second, a quadratic lower bound is known for the he natural problem of temporal connectivity, i.e. the existence of a temporal path between any pair of vertices, in the directed point model [13]. Indeed, the best known approach is to perform a single-source foremost temporal path computation for each possible source vertex [4, 1], resulting in time complexity of for a temporal graph with vertices and temporal edges in both models. We ask whether the bound holds also in undirected temporal graphs where edges can be traversed in both directions.
The point model has been extensively studied without considering delays (see, e.g., [25, 28]). Temporal paths then classically come in two flavors: strict when times of appearance strictly increase along the path, and non-strict when times of appearance are non-decreasing. These two flavors can equivalently be captured by delays of one and zero respectively. Similarly, the interval model has been extensively studied without delays in the literature about social networks (see, e.g., [23, 22, 26]). Therefore, we pay special attention to the specific cases where all the delays are one and zero, respectively.
| Point TPG | Interval TPG | Undirected Interval TPG | ||
| delay zero | delay one | |||
| Foremost | [16, 6] | [16, 6] | [16, 6] | [16, 6] |
| Fastest | [35, 15] | Th.3, [14] | Th.6 | Th.4 |
| Shortest | [35] | Th.2, [6] | Th.2 | Th.2 |
| Connectivity | [13] Th.1 | [16, 6] | Th.1 | Th.1 |
Our contribution
We give strong evidence towards a positive answer to both of the above questions. Our first result is a subquadratic reduction from diameter two in graphs to temporal connectivity in point temporal graphs. The former problem consists in testing whether an undirected graph has diameter at most two. It is known to require quadratic time under the Strong Exponential Hypothesis (SETH) [31]. This reduction implies that, for any , testing temporal connectivity in point temporal graphs with vertices and edge appearances requires time unless SETH is false. Our reduction is restricted to undirected point temporal graphs with uniform delay zero, i.e. each edge can be traversed in both directions with delay zero each time it appears. A similar reduction applies to uniform delay one. Obviously, this lower bound holds also for the more general setting of interval temporal graphs. It extends to the undirected case the lower bound of obtained through a reduction from SAT in [13] for directed point temporal graphs111The authors of [13] state their lower bound for some but their reduction from -SAT allows to show it for any (using the definition of SETH, an appropriate can be chosen for a given ).. We state a lower bound of for consistency with the upper bound of . However, our reduction uses and also implies a lower bound.
Our main result is a subcubic reduction from negative triangle detection to fastest temporal path computation. The former consists in detecting whether a weighted graph has a triangle of negative total edge weight. This reduction implies that, for any , an -time algorithm for fastest temporal path in interval temporal graphs would break the state of the art for several classical problems, including e.g., all pairs shortest path (APSP), the replacement paths problem on weighted directed graphs, and verifying the correctness of a matrix product over the -semiring, among others [34]. Our reduction is restricted to undirected interval temporal graphs with constant delays, i.e. each edge can be traversed in both directions with symmetric constant delay in each time interval in which it appears.
We supplement the latter lower bound with the following refinements for uniform delays zero and one. First, we provide a deterministic “combinatorial” near-linear-time algorithm for finding a fastest temporal path in undirected interval temporal graphs with uniform delay zero. Our algorithm is a rather simple utilization of a dynamic connectivity algorithm. We indeed solve the slightly more technical profile problem which consists in computing, given a source vertex and a target vertex, a representation of the (profile) function that assigns to each possible departure time from the source, the corresponding earliest arrival time at the target. Note that the duration of a fastest temporal path can be inferred from the profile function. Second, we show that this restricted setting to undirected temporal graphs with uniform delay zero is the widest possible in which we can expect a near-linear time “combinatorial” algorithm. More precisely, we provide two subcubic reductions from triangle detection in an undirected graph to fastest temporal path computation. One lower bound applies to undirected interval graphs with uniform delay one, and the other applies to directed interval graphs with uniform delay zero. Note that triangle detection is a classical problem in fine-grained complexity which is, for example, subcubic equivalent to combinatorial Boolean matrix multiplication [34]. The notion of a “combinatorial” algorithm has no formal definition. Intuitively, it refers to an algorithm which is efficient both theoretically and practically, i.e., whose complexity has a low leading constant. Our reductions imply that a truly subcubic combinatorial algorithm for one of these restricted settings would constitute a breakthrough with respect to Boolean matrix multiplication algorithms [34].
Finally, we provide a reduction from triangle detection in undirected graphs to shortest path computation in interval temporal graphs. This leads to a lower bound of time for combinatorial algorithms. Interestingly, this reduction uses a temporal graph of diameter , as opposed to our other reductions, which are based on temporal paths of constant length. This is indeed necessary as the algorithm of [6] finds a shortest temporal path in where is the largest length of a temporal path (in terms of number of edges) and is the size of the underlying graph. Note that it uses a sorted data structure which can be pre-computed in time. Here, our reduction applies to undirected temporal graphs with uniform delay zero. A slight variant applies to those with uniform delay one. We thus do not expect a faster algorithm in these cases.
See Table 1 for a summary of our results and previously known results. Note that our lower bounds for temporal connectivity and shortest temporal path computation are tight with respect to known upper bounds.
More related work.
The difference in complexity between the interval model and the point model has already been noticed in [5] about algorithms solving the profile problem. Profile computation cannot be performed in polynomial time if the delay for traversing a temporal edge is linear [18], but a fastest temporal path can still be computed in time by combining [18] and [14]. The possibility of using dynamic connectivity for computing (instantaneous) strongly connected components is discussed in [30]. The following complexity gap between the point and interval models is shown in [11]: Finding a restless temporal path (where waiting is not allowed) in a point temporal graph is fixed-parameter tractable (FPT) when parameterized by the vertex-interval-membership-width, a temporal graph parameter introduced in [7]. However, it is NP-hard in interval temporal graphs of vertex-interval-membership-width equal to three. Testing if connectivity is maintained in an interval temporal graph with delay zero is studied in [3].
Structure of the paper
After formally introducing temporal graphs, we first prove lower bounds for temporal connectivity and shortest temporal path computation. We then study fastest temporal path computation, first proving several lower bounds and then presenting an algorithm that escapes these bounds by restricting the input to undirected edges and zero delays.
2 Preliminaries
We represent times with integers222This restriction does not weaken our lower bounds. Our upper bound algorithm easily generalizes to any representation of reals. and use Greek letters to name times. An interval of time with represents all times satisfying . For , we similarly define ( respectively) as the set of times satisfying ( respectively).
An interval temporal graph, hereafter referred to simply as a temporal graph, is a pair , where is a set of vertices and is a set of temporal edges. Each temporal edge is a quintuple , where and are vertices, , and are integers, with and that represent its beginning time, its ending time and its delay (or traveling time), respectively. Such a temporal edge represents the presence of edge during , that is, it can be traversed starting from its tail at any time to arrive in its head at time . We say that connects during interval with delay . We let , , , , and denote its tail, its head, its beginning time, its ending time, and its delay respectively. When , the interval is reduced to a point, and then we refer to the point model. We often consider undirected temporal graphs where edges can be traversed in both directions. In that case, it is assumed that is symmetric: for each , the symmetrical temporal edge is also in . In other words, is said to be undirected when is symmetric. is said to have uniform delay if all temporal edges have same delay .
The underlying graph of is the (static) directed graph with same vertex set and edge set . Note that we let denote the directed edge from to . We say that an edge of the underlying graph is present during with delay when there is a temporal edge in . When the temporal graph is undirected we also assume that the symmetrical edge is in so that is symmetric. When , we say that is present at point with delay . Note that the underlying graph is directed. In contrast, when considering a (static) undirected graph with vertex set and edge set , we consider that is a set of unordered pairs, and we let denote an undirected edge between .
When a temporal graph is clear from the context, we let denote its number of vertices, denote its number of temporal edges, and denote its number of underlying edges. It should be noticed that can be much larger than , since an edge in may correspond to many temporal edges in . For simplicity, we assume that any vertex appears at least in one temporal edge so that we have .
A temporal walk in is a sequence of pairs where, for each , is a temporal edge and is a traversal time in the presence interval of , i.e. satisfying . It is also required that for all , i.e., it induces a walk in the underlying graph , and that for all , i.e., each temporal edge is traversed one after the other in time. When and , we say that is a temporal -walk. We also say that is a temporal walk departing from at time and arriving in at time where . We let , and denote its departure time, its arrival time and its length in number of edges respectively. Its duration is defined as . is said to be a loop when . When all vertices are pairwise distinct, is said to be a temporal path, or a temporal -path if and . Note that any temporal -walk with can be transformed into a temporal -path by removing sequences of temporal edges forming loops. A fastest temporal -path is defined as a temporal -path with minimum duration. A shortest temporal -path is defined as a temporal -path with minimum length. A foremost temporal -path is defined as a temporal -path with minimum arrival time. If there is a temporal -path for every pair of vertices , is temporally connected.
A walk in the underlying graph will be given as a sequence of vertices such that is an edge for each . It is said to be temporally feasible if there exists a sequence of times such that each edge is present at time with delay at most (using ). It is said to be a path when are pairwise distinct.
3 Lower bound for temporal connectivity
Recall that an interval temporal graph is temporally connected if it has a temporal -path for every pair of vertices. Since computing the set of temporally reachable vertices from a given vertex can be done in linear time up to a logarithmic factor [16, 6], there is an -time algorithm for testing whether an interval temporal graph is temporally connected. We now state that this bound is tight under SETH, even in point temporal graphs.
Theorem 1.
Assuming SETH, for any , there is no -time algorithm for testing whether a temporal graph is temporally connected, even if the temporal graph is an undirected point temporal graph with uniform delay zero (resp. one).
Proof.
Assuming SETH, for any , there is no -time algorithm distinguishing diameter from in graphs with nodes and edges [33]. To prove our result, it thus suffices to reduce Diameter-Two to Temporal-Connectivity, where the Diameter-Two problem asks whether a (static) undirected graph has diameter at most two, and the Temporal-Connectivity problem asks whether a temporal graph is temporally connected. For that, let be an arbitrary undirected graph with nodes and edges. Without loss of generality, is connected and has no self-loop. Let be the set of ordered pairs such that (thus ). We construct from an undirected point temporal graph as follows:
-
The vertex set is where are disjoint copies of and is an additional vertex. For every ordered pair , we let denote its copies. induces an independent set in the underlying graph of and so does .
-
For every ordered pair , we add temporal edges with delay zero in so that:
-
–
edge is present at time (i.e. interval ),
-
–
edge is present at time ,
-
–
edge is present at time ,
-
–
edge is present at time ,
-
–
edges and are present at times and .
-
–
We also add the corresponding symmetrical temporal edges so that is undirected. All temporal edges of have delay zero. See also Figure 1. Note that has vertices and temporal edges as has vertices and edges.
Since induces a temporal graph, whose underlying graph is connected, and where all edges are present at time , vertices in can reach each other at time . Similarly, they can reach each other at time . Since there is a temporal edge between every vertex in and some vertex in at times and , this implies that is temporally connected if and only if every pair of vertices in can temporally reach each other.
Let be two distinct vertices of . We will prove that there is a path of length at most from to in if and only if there is a temporal path from to in . Let us first prove the direct implication. If is a path of length in , let and . Then is a path from to in the underlying graph of which is temporally feasible in by traversing edges at times , respectively.
Let us now prove the converse implication, and suppose that there is a temporal path from to in . Since any edge incident to or is only present at times , , , or , only uses times , , , and . This implies that does not use , because it is only available at times or . Since the underlying graph of is bipartite, with bipartition , and since any two edges incident to , with , have distinct time availabilities, this implies that uses at most elements of , i.e., the underlying path of is either , or , or , with and . The latter case is indeed impossible. The distinct time availabilities of and imply that is traversed at time at least. Hence, both and are traversed at time or later, implying . Edges and are thus traversed at time and , respectively, in contradiction with the two distinct time availabilities of and . By construction, the two first cases imply that either or that . Thus, there is a path of length at most between and in .
We thus conclude that has diameter at most if and only if is temporally connected.
To obtain the result with uniform delay one, we modify the above construction so that all temporal edges have delay one and edges involving also appear at times and . More precisely, we obtain from by changing all delays to one instead of zero and by adding edges at times and for all (again with delay one and adding corresponding symmetrical temporal edges so that is undirected).
Now, vertices in can reach each other at time 1 by passing through . They can also reach each other starting at time 5 and arriving at time 7. They can then reach any at time 2. Similarly, any vertex can reach some at time 2 and then any other at time 7. This implies that is temporally connected if and only if every pair of vertices in can temporally reach each other. The proof that this happens if and only if has diameter two is the same as above since the proof uses only strict temporal paths that also correspond to temporal paths in .
4 Lower bound for shortest temporal path
Theorem 2.
If, for every , there is no combinatorial -time algorithm for detecting a triangle in an undirected graph, then for every , there is no combinatorial -time algorithm for computing a shortest temporal -path in a temporal graph, even if the temporal graph is undirected and has uniform delay zero (resp. one).
Proof.
Let be an instance of Triangle Detection that is a (static) undirected graph. Triangle detection consists in finding three pairwise distinct vertices such that the three undirected edges are in . Suppose . A temporal graph is constructed as follows. Here, a permanent temporal edge between vertices and indicates that both edges and are present during the interval . All delays are zero.
-
The vertex set of consists of the vertices , , and disjoint copies of , denoted . For and , let represent vertex in .
-
In and , permanent temporal edges are defined to form a path that respects the vertex ordering. Specifically, for and , we add a permanent temporal edge between and . Additionally, permanent temporal edges are defined to connect the source vertex to and the target vertex to .
-
For each edge with , the temporal edges and (and their symmetric edges ) are both present at time . Additionally, a permanent temporal edge between and is added.
Observe that can be constructed in time, where is the number of edges of . The correctness of the reduction comes from the following claim. The theorem thus follows from its proof.
Claim 0.
There is a triangle in if and only if there exists a temporal path in from to using at most edges.
First, suppose that there is a triangle in formed by the vertices with . Using the permanent edges within , we can construct a temporal path starting at and arriving at at time . Let denote this temporal path and note that it contains edges. By the existence of the triangle, we know that the temporal edges form a temporal path in . Denote this temporal path as . Using the permanent edges within , we can construct a temporal path from to that uses edges and traverses all of them at time . The paths , , and are constructed such that they can be concatenated into a single temporal path from to . The total number of edges in this concatenated path is . See Figure 2 for an illustration of such a temporal path.
Now, suppose that there exists a temporal path from to of length at most . Let be the temporal path obtained from by removing its first and last edges (those incident to and respectively). Let be the first temporal edge of that is not within , and let be the last temporal edge of that is not within . By the structure of , connects a vertex in , say , with a vertex in , say , and it is present only at time . Similarly, is incident to vertices and , and it is present only at time . Moreover, by the definition of temporal path, appears after (or at the same time as) in (possibly in a non-strict path they appear at the same time). Thus, . Now, observe that the distance from to in the underlying graph of is , the distance from to is at least 3, and the distance from to is . This implies that uses at least temporal edges. Since the length of is at most , we get . We thus have . Now, the three temporal edges that uses between and must have the form and for some . By the way that is constructed, and are undirected edges in , i.e., forms a triangle in . This concludes the proof for delay zero.
For delay one, the proof is very similar. We include it for the sake of completeness. To obtain an interval temporal graph with uniform delay one, we modify the temporal edges of as follows. All delays are set to one. All permanent edges are present during interval instead of . For each undirected edge with , the symmetrical edges and are present at point while the symmetrical edges and are present at point . The proof similarly follows from the following claim.
Claim 0.
There is a triangle in if and only if there exists a temporal path in from to using at most edges.
If contains a triangle with , we can again form a temporal path of length in starting from at time , reaching within at time , waiting in until time following the temporal edges at times respectively, reaching at time , reaching within at time , and arriving in at time .
Conversely, suppose that is a temporal -path in of length at most . Its first temporal edge leading outside must be for some . Its last temporal edge with a vertex outside must be for some . As the minimum length of path from to is one in the underlying graph of , there is at least one temporal edge between and in . As and must be traversed at times and respectively, we get since is a temporal path and have delay one. We thus have . Again, the distance from to in the underlying graph of is , the distance from to is at least 3, and the distance from to is . This implies that has length at least . We thus have and contains the triangle . This concludes the proof for delay one.
5 Complexity of fastest temporal path
5.1 Lower bounds for fastest temporal path
Theorem 3.
If, for every , there is no -time algorithm for detecting a negative triangle in a weighted graph, then for every , there is no -time algorithm for computing a fastest temporal -path in a temporal graph, even if the temporal graph is undirected.
Proof.
The Negative Triangle Detection problem asks for the existence in an edge-weighted undirected graph of a triangle whose total weight is negative. We now present an -time reduction from Negative Triangle Detection to the problem of computing a fastest temporal path in a temporal graph. For that, let be an arbitrary edge-weighted undirected graph with nodes and edges where assigns a weight to each edge . Without loss of generality, and is loopless. Let . We construct from an undirected temporal graph as follows:
-
The vertex set is where are disjoint copies of and are two additional vertices. For every , let denote its respective copies. are independent sets.
-
The underlying edge set includes (and symmetrical edges).
-
For every , edges and their symmetrical counterparts are all present during with delay .
-
Finally, let be an enumeration of the edge set . For each , let and be the endpoints of such that . Then, the symmetrical edges are both present at point with delay , and the symmetrical edges are both present during with delay .
Note that has vertices and temporal edges (counting also symmetrical temporal edges), and the construction thus takes linear time. Figure 3 shows a schematic view of the resulting temporal graph.
We claim that there exists a temporal -path in with duration less than if and only if contains a negative triangle. For that, let us fix a temporal -path of minimum duration. By the construction of , its first temporal edge is present at time for some . Let be the endpoints of so that starts with edge , i.e. with . If the duration of is less than , then ends with the only edge with head appearing in , that is edge . Let be the number of edges of . The duration of must be at least while also being less than . We thus have . Furthermore, we must have since the distance between and is at least 4 in the underlying graph of . In this situation, there must exist a vertex such that the underlying edges of are , implying that is a triangle of . As the temporal edges connecting and have delays and respectively, the duration of is at least , which is less than if and only if the triangle is negative (see the corresponding path in Figure 3 for an illustration). Conversely, if is a negative triangle, then up to reordering we can assume that its edges are . Then, there exists a temporal -path that starts at time , has no waiting time, and has duration less than . Therefore, the claim is proved.
The following hardness result is inspired from that of Theorem 3, but it requires some adjustments (and a different complexity hypothesis) in order to cope with uniform delay one.
Theorem 4.
If, for every , there is no combinatorial -time algorithm for detecting a triangle in an undirected graph, then for every , there is no combinatorial -time algorithm for computing a fastest temporal path in a temporal graph, even if the temporal graph is undirected and has uniform delay one.
Due to space constraints, the proof can be found in the appendix of the related version. It also allows to state the following.
Theorem 5.
If, for every , there is no combinatorial -time algorithm for detecting a triangle in an undirected graph, then for every , there is no combinatorial -time algorithm for computing a fastest temporal path in a directed temporal graph with uniform delay zero.
5.2 Fastest temporal path in an undirected temporal graph with uniform delay zero
We obtain an algorithm for computing a fastest temporal path by solving the more complex profile problem. Given a temporal graph and a pair of distinct vertices and in this graph, we define the -profile as the function associating each departure time from to the earliest arrival time in ; in other words, is the minimum arrival time of any temporal path leaving at a time no earlier than . This function is non-decreasing and piece-wise linear. Furthermore, the slope of each linear piece is either zero or one. The reason is that we can define a profile function for each underlying edge . The slope is one in intervals where the edge is present: for each temporal edge , the earliest arrival time in is for . The slope is zero in intervals where it is not present, as the earliest arrival time is for if the next presence of is during interval with delay . Similarly, the profile function of a path can be obtained by composition of , resulting in a polyline whose slopes are obtained by multiplying slopes of the composing function and must be in . Finally, if denotes the set of all paths from to in the underlying graph, we have which is thus also a polyline with slopes in . See [14] for more details.
One way to represent this function is by a collection of triples , where is non-decreasing, and for every , we have where we define . The minimum collection of such triples is what we call a minimal representation of the -profile. Note that when , the profile is the identity function and requires a specific representation. For a detailed study of a general algorithm to find the profile of a pair of vertices in an interval temporal graph with arbitrary delays in time, we refer the reader to [14].
Theorem 6.
Given an undirected interval temporal graph with no isolated vertices and temporal edges having all zero delay, and two vertices and , it is possible to compute in time a fastest temporal path from to . Furthermore, a minimal representation of the -profile can be obtained with the same complexity.
To prove the above theorem, we propose a profile algorithm that, given the list of temporal edges of an interval temporal graph and two distinct vertices , computes a representation of the profile function from to . The idea of the algorithm is to perform a time scan of the beginnings and ends of all temporal edges while maintaining connected components for edges present at each time considered. We also maintain for each connected component the last departure time allowing us to reach it at time from . In other words, is the maximum time such that there exists a temporal path from to any vertex in the component that starts at time and arrives no later than time . Note that this definition does not depend on : such a temporal path to can be extended to a temporal walk that arrives at any other vertex of the component at time since all edges of the component are present at time and have zero delay. (And a temporal path can be extracted from that temporal walk by waiting instead of following any loop.)
For that purpose we consider each temporal edge as two events: a beginning event (resp. ending event) which occurs when the edge begins at time (resp. ends at time ) and which is defined as the quintuple (resp. ). As we consider an undirected temporal graph , we generate only one beginning event and one ending event for each pair of symmetrical temporal edges. We assume that the temporal graph is given as a sorted event list, ordered by the time of the events (i.e., the third coordinate). If several events share the same time, beginning events appear before ending events, breaking ties arbitrarily among events of the same type. Note that this list can easily be obtained from the list of temporal edges of in time using sorting.
To maintain connected components as we scan edge events, we could use a dynamic connectivity algorithm [21, 17] (either fully dynamic or offline). However, we note that we can rely on the simpler dynamic tree algorithm of [32] (see also the Euler tour tree data-structure from [20]). The reason is that the ending times of edges are known in advance. We can thus maintain for each connected component a spanning tree consisting of edges with greatest ending times as we now explain. More precisely, we maintain a maximum-cost spanning tree of each connected component, where the cost of an edge is defined as the ending time of the corresponding temporal edge. Indeed, the data-structure of [32] maintains a collection of dynamic trees on a fixed set of vertices where each edge of a tree is associated to a cost. In particular, it allows to retrieve in logarithmic time the edge with minimum cost along the path from a node to the root of its tree. When adding an edge , if and are already in the same tree , we can thus find the edge with smallest ending time along the cycle of and cut by deleting before linking and (if , we do nothing). If and are not in the same tree, we link the two trees according to [32]. We let denote the resulting procedure for adding an edge with ending time . We let denote the procedure that cuts the tree containing and according to [32] if one vertex is parent of the other (and does nothing otherwise). We further let denote the procedure that returns the ID of the root of the tree containing according to [32]. We use this ID (a number between 1 and ) to identify the component spanned by the tree, so that the expression allows us to test whether and are in the same connected component. All these procedures can be implemented in time [32]. Note that the simpler version in amortized time suffices for our purposes. We let denote the procedure that creates single-node trees, one for each vertex in (in linear time). Processing the event list in order, we can thus update the dynamic trees representing the connected components of the graph of edges present at the time of each event.
The update of last departure times is then rather simple. When two components merge because of the appearance of an edge at time , the last departure time of the resulting component is set to the maximum of the last departure times of the components of and before merging since a temporal path reaching one component can now be extended to reach any node in the other component. When a component splits because of the disappearance of an edge at time , the two new components get same last departure time as the component before splitting since temporal paths reaching that component arrive at time or before, and waiting is then possible. Special care has to be taken concerning the connected component of the source for which the last departure time is always the time of the current event. Obtaining the last departure time of the connected component of after an event at time basically indicates that . We will prove that when a higher value of is observed for , corresponds to the earliest arrival time when departing at and we then have . Note that is then the duration of the corresponding temporal path from to . Each time an event affects the connected component of the target , we update a list of triples accordingly so that it represents the profile up to that event. See the pseudo-code of Algorithm 1 for more details.
Proposition 7.
Given an undirected interval temporal graph with with no isolated vertices and temporal edges having all zero delay, and two vertices and , Algorithm 1 computes a representation of the -profile in time.
First note that Theorem 6 easily follows from Proposition 7 since the duration of a fastest temporal -path as well as the starting time of such a fastest temporal path can easily be obtained by scanning the -profile in time to obtain the triple minimizing . We can then find a fastest temporal -path departing at time by computing an earliest-arrival -path departing at time in time. Indeed, after an -time preprocessing for obtaining for each underlying edge the sorted list of temporal edges connecting , we can compute such a temporal path through a temporal version of Dijkstra’s algorithm [16, 6] in time. Note that the factor accounts for the time required to find with binary search the first temporal edge connecting that can be traversed at a certain time for a given neighbor (in the underlying graph) of a node reached at time . The preprocessing also includes removing the overlaps between the temporal edges corresponding to various appearances of the same edge, see [24] for more details. As we assume that there is no isolated vertex, we have and . As a final remark, a minimal representation of the profile can easily be obtained from the computed one through a linear-time post-processing scan where we merge two consecutive triples if they correspond to the same line. Due to space constraints, the proof of Proposition 7 can be found in the Appendix of the related version.
6 Conclusion
We have presented non-trivial lower bounds showing a complexity gap between point temporal graphs and interval temporal graphs. They also show a complexity gap between the computation of a foremost temporal path and that of a fastest (resp. shortest) temporal path. As far as we know, these are the first results proving these gaps. Several questions arise from this work.
First, can we close the gap between our lower bound for the computation of a fastest temporal -path and the upper bound given by the best-known algorithm [14]. Note that the gap can be large for dense underlying graphs with .
Combinatorial algorithms for computing a shortest path in a graph can usually be extended to compute one-to-all shortest paths. In the case of uniform zero delay, can we similarly hope to find an algorithm for computing one-to-all fastest durations, i.e., given a source vertex , an algorithm that computes the duration of a fastest temporal path from to each possible target vertex ? Note that we cannot hope to turn Algorithm 1 into a one-to-all profile algorithm with the same complexity, since a profile can be of size . But it can easily be turned into an -time algorithm for one-to-all profiles. Besides combinatorial algorithms, do faster algorithms for shortest temporal path or fastest temporal path with uniform delay one exist (e.g. leveraging linear algebra)?
Testing temporal connectivity might be related to the existence of a specific temporal spanner, that is a subset of temporal edges which are sufficient to preserve temporal connectivity. Note that our reduction for proving Theorem 1 produces a sparse temporal graph with temporal edges, implying that the existence of a sparse spanner is not enough to enable temporal connectivity testing in subquadratic time. We ask whether subquadratic time could be enabled by the existence of a specific well-structured temporal spanner. For example, a pivot vertex [10], which is a vertex that all vertices can reach by some time and which can reach all other vertices after , enables such a temporal spanner. We ask whether such a pivot and an appropriate time can be found in subquadratic time when they exist.
References
- [1] Eleni C. Akrida, Leszek Gasieniec, George B. Mertzios, and Paul G. Spirakis. The complexity of optimal design of temporally connected graphs. Theory Comput. Syst., 61(3):907–944, 2017. doi:10.1007/S00224-017-9757-X.
- [2] Eleni C. Akrida, George B. Mertzios, Paul G. Spirakis, and Viktor Zamaraev. Temporal vertex cover with a sliding time window. Journal of Computer and System Sciences, 107:108–123, 2020. doi:10.1016/j.jcss.2019.08.002.
- [3] Eleni C. Akrida and Paul G. Spirakis. On verifying and maintaining connectivity of interval temporal networks. Parallel Process. Lett., 29(2):1950009:1–1950009:16, 2019. doi:10.1142/S0129626419500099.
- [4] Sandeep Bhadra and Afonso Ferreira. Complexity of connected components in evolving graphs and the computation of multicast trees in dynamic networks. In Samuel Pierre, Michel Barbeau, and Evangelos Kranakis, editors, Ad-Hoc, Mobile, and Wireless Networks, Second International Conference, ADHOC-NOW 2003 Montreal, Canada, October 8-10, 2003, Proceedings, volume 2865 of Lecture Notes in Computer Science, pages 259–270. Springer, 2003. doi:10.1007/978-3-540-39611-6_23.
- [5] Filippo Brunelli, Pierluigi Crescenzi, and Laurent Viennot. On computing pareto optimal paths in weighted time-dependent networks. Inf. Process. Lett., 168:106086, 2021. doi:10.1016/J.IPL.2020.106086.
- [6] Binh-Minh Bui-Xuan, Afonso Ferreira, and Aubin Jarry. Computing shortest, fastest, and foremost journeys in dynamic networks. Int. J. Found. Comput. Sci., 14(2):267–285, 2003. doi:10.1142/S0129054103001728.
- [7] Benjamin Merlin Bumpus and Kitty Meeks. Edge Exploration of Temporal Graphs. Algorithmica, 85(3):688–716, 2022. doi:10.1007/s00453-022-01018-7.
- [8] Arnaud Casteigts, Paola Flocchini, Walter Quattrociocchi, and Nicola Santoro. Time-varying graphs and dynamic networks. Int. J. Parallel Emergent Distributed Syst., 27(5):387–408, 2012. doi:10.1080/17445760.2012.668546.
- [9] Arnaud Casteigts, Joseph G. Peters, and Jason Schoeters. Temporal cliques admit sparse spanners. In Christel Baier, Ioannis Chatzigiannakis, Paola Flocchini, and Stefano Leonardi, editors, 46th International Colloquium on Automata, Languages, and Programming, ICALP 2019, July 9-12, 2019, Patras, Greece, volume 132 of LIPIcs, pages 134:1–134:14. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2019. doi:10.4230/LIPIcs.ICALP.2019.134.
- [10] Arnaud Casteigts, Joseph G. Peters, and Jason Schoeters. Temporal cliques admit sparse spanners. J. Comput. Syst. Sci., 121:1–17, 2021. doi:10.1016/J.JCSS.2021.04.004.
- [11] Justine Cauvi and Laurent Viennot. Parameterized restless temporal path. In Artur Jez and Jan Otop, editors, Fundamentals of Computation Theory - 25th International Symposium, FCT 2025, Wrocław, Poland, September 15-17, 2025, Proceedings, volume 16106 of Lecture Notes in Computer Science, pages 82–93. Springer, 2025. doi:10.1007/978-3-032-04700-7_7.
- [12] Kenneth L. Cooke and Eric Halsey. The shortest route through a network with time-dependent internodal transit times. Journal of Mathematical Analysis and Applications, 14(3):493–498, 1966. doi:10.1016/0022-247X(66)90009-6.
- [13] Isnard Lopes Costa, Raul Lopes, Andrea Marino, and Ana Silva. On computing large temporal (unilateral) connected components. J. Comput. Syst. Sci., 144:103548, 2024. doi:10.1016/J.JCSS.2024.103548.
- [14] Frank Dehne, Masoud T. Omran, and Jörg-Rüdiger Sack. Shortest paths in time-dependent FIFO networks. Algorithmica, 62(1-2):416–435, 2012. doi:10.1007/S00453-010-9461-6.
- [15] Julian Dibbelt, Thomas Pajor, Ben Strasser, and Dorothea Wagner. Connection scan algorithm. ACM J. Exp. Algorithmics, 23, 2018. doi:10.1145/3274661.
- [16] Stuart E. Dreyfus. An appraisal of some shortest-path algorithms. Oper. Res., 17(3):395–412, 1969. doi:10.1287/OPRE.17.3.395.
- [17] David Eppstein. Offline algorithms for dynamic minimum spanning tree problems. J. Algorithms, 17(2):237–250, 1994. doi:10.1006/JAGM.1994.1033.
- [18] Luca Foschini, John Hershberger, and Subhash Suri. On the complexity of time-dependent shortest paths. Algorithmica, 68(4):1075–1097, 2014. doi:10.1007/S00453-012-9714-7.
- [19] Roman Haag, Hendrik Molter, Rolf Niedermeier, and Malte Renken. Feedback edge sets in temporal graphs. Discrete Applied Mathematics, 307:65–78, 2022. doi:10.1016/j.dam.2021.09.029.
- [20] Monika Rauch Henzinger and Valerie King. Randomized fully dynamic graph algorithms with polylogarithmic time per operation. J. ACM, 46(4):502–516, 1999. doi:10.1145/320211.320215.
- [21] Jacob Holm, Kristian de Lichtenberg, and Mikkel Thorup. Poly-logarithmic deterministic fully-dynamic algorithms for connectivity, minimum spanning tree, 2-edge, and biconnectivity. J. ACM, 48(4):723–760, 2001. doi:10.1145/502090.502095.
- [22] Petter Holme. Modern temporal network theory: A colloquium. CoRR, abs/1508.01303, 2015. arXiv:1508.01303.
- [23] Petter Holme and Jari Saramäki. Temporal networks. Physics Reports, 519(3):97–125, 2012. Temporal Networks. doi:10.1016/j.physrep.2012.03.001.
- [24] Anuj Jain and Sartaj K. Sahni. Algorithms for optimal min hop and foremost paths in interval temporal graphs. Appl. Netw. Sci., 7(1):60, 2022. doi:10.1007/S41109-022-00499-3.
- [25] David Kempe, Jon Kleinberg, and Amit Kumar. Connectivity and inference problems for temporal networks. Journal of Computer and System Sciences, 64(4):820–842, 2002. doi:10.1006/jcss.2002.1829.
- [26] Matthieu Latapy, Tiphaine Viard, and Clémence Magnien. Stream graphs and link streams for the modeling of interactions over time. Soc. Netw. Anal. Min., 8(1):61:1–61:29, 2018. doi:10.1007/S13278-018-0537-7.
- [27] George B. Mertzios, Hendrik Molter, Rolf Niedermeier, Viktor Zamaraev, and Philipp Zschoche. Computing maximum matchings in temporal graphs. J. Comput. Syst. Sci., 137:1–19, 2023. doi:10.1016/J.JCSS.2023.04.005.
- [28] Othon Michail. An introduction to temporal graphs: An algorithmic perspective. Internet Math., 12(4):239–280, 2016. doi:10.1080/15427951.2016.1177801.
- [29] Othon Michail and Paul G. Spirakis. Traveling salesman problems in temporal graphs. Theoretical Computer Science, 634:1–23, 2016. doi:10.1016/j.tcs.2016.04.006.
- [30] Léo Rannou, Clémence Magnien, and Matthieu Latapy. Strongly connected components in stream graphs: Computation and experimentations. In Rosa M. Benito, Chantal Cherifi, Hocine Cherifi, Esteban Moro, Luis Mateus Rocha, and Marta Sales-Pardo, editors, Complex Networks & Their Applications IX - Volume 1, Proceedings of the Ninth International Conference on Complex Networks and Their Applications, COMPLEX NETWORKS 2020, 1-3 December 2020, Madrid, Spain, volume 943 of Studies in Computational Intelligence, pages 568–580. Springer, 2020. doi:10.1007/978-3-030-65347-7_47.
- [31] Liam Roditty and Virginia Vassilevska Williams. Fast approximation algorithms for the diameter and radius of sparse graphs. In Dan Boneh, Tim Roughgarden, and Joan Feigenbaum, editors, Symposium on Theory of Computing Conference, STOC’13, Palo Alto, CA, USA, June 1-4, 2013, pages 515–524. ACM, 2013. doi:10.1145/2488608.2488673.
- [32] Daniel Dominic Sleator and Robert Endre Tarjan. A data structure for dynamic trees. J. Comput. Syst. Sci., 26(3):362–391, 1983. doi:10.1016/0022-0000(83)90006-5.
- [33] Virginia Vassilevska Williams. On some fine-grained questions in algorithms and complexity, pages 3447–3487. World Scientific Publishing Co Pte Ltd, 2018. doi:10.1142/9789813272880_0188.
- [34] Virginia Vassilevska Williams and R. Ryan Williams. Subcubic equivalences between path, matrix, and triangle problems. J. ACM, 65(5):27:1–27:38, 2018. doi:10.1145/3186893.
- [35] Huanhuan Wu, James Cheng, Yiping Ke, Silu Huang, Yuzhen Huang, and Hejun Wu. Efficient algorithms for temporal path computation. IEEE Trans. Knowl. Data Eng., 28(11):2927–2942, 2016. doi:10.1109/TKDE.2016.2594065.
Appendix A Lower bounds for fastest temporal path with uniform delay one or zero
Proof of Theorem 4.
Let be an arbitrary unweighted graph. Without loss of generality, and is loopless. Let be some large enough constant (say, ). The undirected temporal graph is constructed from as follows:
-
The vertex set is where are disjoint copies of . For every , let denote its copies.
-
The underlying edge set includes (and symmetrical edges).
-
For every , edges and their symmetrical counterparts are all present during .
-
For every , the symmetrical edges are both present at point , while the symmetrical edges are both present at point for each .
-
Finally, all temporal edges have delay one.
Note that we can construct from in time.
We claim that contains a triangle if and only if the shortest duration for reaching from equals . Indeed, if is a triangle of , then there exists a temporal path starting at time , going by vertices , with zero waiting time and total duration . Conversely, assume the existence of a temporal path from to , with total duration at most . As edges have delay 1, it must have 4 edges at most, which is the least it can have as are vertex separators of the underlying graph (i.e. the removal of any for disconnects from ). The underlying path of must thus be for some triple satisfying . This path has and as first and last edges respectively. Then, the starting time of must be and edge must be present at time which happens only when . Since is loopless, are pairwise distinct. Therefore, contains the triangle . This proves the claim.
Note that the above proof does not hold with delay zero. If we consider zero delays in the above reduction, then the fastest path from to has duration 3 if and only if contains an odd cycle which is an easier problem than detecting a triangle (it can be tested in linear time). However, if we construct a directed temporal graph where all underlying edges are directed from to , from to , from to and from to , then it holds that contains a temporal -path of duration 3 if and only if contains a triangle. The proof of Theorem 5 is almost identical to that of Theorem 4 and is omitted.
Appendix B Profile computation in undirected temporal graphs with uniform delay zero
Proof of Proposition 7.
Considering all events up to an event , let be the temporal graph with the same set of vertices as and all temporal edges of such that the event is not after in the event list . The temporal edges of whose ending events come after in , are called unclosed temporal edges as their ending events have not been processed yet. We let denote the time at which event occurs. We define the last departure time from to reach at or before in as the maximum time such that there exists a temporal -walk departing at time in and arriving no later than . Similarly, we use , and to refer to the values stored in , and respectively after the algorithm has processed the event . We aim at proving the following claim.
Claim 8.
For each event , we have .
We first note that this claim allows us to prove that Algorithm 1 correctly identifies a triple corresponding to a fastest temporal -path with duration . Consider a fastest temporal -path and let and denote its departure time from and arrival time in respectively. Among the suffixes of with temporal edges present at time , consider the last beginning event of one of these temporal edges and consider its time . As would lead to a faster temporal -path, we must have . As the suffix from the temporal edge associated to is present at time by the choice of and is in the connected component of the suffix when processing , the claim implies and by definitions of and . If , the triplet is added to the profile at Line 13. Otherwise, a triplet was added previously with and , implying . As is a fastest temporal path, we must have . In both cases, Algorithm 1 correctly identifies a triple corresponding to a fastest temporal -path. Additionally, Claim 8 also implies that each triple added to corresponds to a temporal path starting from at time and arriving in at time . Moreover, a triple is added to only if and are in the same connected component at time . We can thus conclude that the minimum over all triples of is the duration of a fastest temporal -path.
Proof of Claim 8. We prove Claim 8 by induction on the number of events processed. It relies mainly on the correctness of the dynamic connected component procedures which implies that uniquely identifies the connected component of in the graph induced by the edges that are present in at time and whose ending events are after in . The ordering of , with all beginning events at a given time preceding all ending events at time , implies that these temporal edges are exactly the unclosed temporal edges of . In particular, when two vertices and are in the same connected component (i.e. ), they are connected through unclosed temporal edges of . Note that this implies the existence of an instantaneous temporal -path that uses only unclosed temporal edges which are all traversed at the same time .
Initially, we consider an empty temporal graph and the claim is clearly satisfied for any vertex . Now, suppose that Claim 8 is satisfied for any vertex before scanning an event at time . Note that the algorithm first sets , so that the claim is satisfied for and all vertices in . Now consider any vertex outside of . In that case, any temporal -path uses some temporal edge ending before , implying where denotes the event preceding (we use and if is the first event). We distinguish two cases.
Ending event case. If corresponds to the disappearance of an edge , we have , implying . As we have (since is outside of ), the corresponding temporal -path exists in and we have . The updates in that case ensure that keeps the same value (after the possible change of ) so that still holds.
Beginning event case. If corresponds to the appearance of an edge , differs from by the addition of the two temporal edges and associated to . We thus have , and can only occur if any temporal -path with departure time uses or . Consider such a temporal -path departing at time and assume without loss of generality that it traverses from to , implying by definition of . As we set to in that case, we then have by induction hypothesis. Combining this with the previous inequality, we get . We also have since the induction hypothesis implies the existence of a temporal -path to a node in departing at and arriving at or before such that can be extended by an instantaneous temporal -path at time . We thus finally get in that case too. Claim 8 thus follows by induction.
We now turn to the proof of the profile computation. We denote by the -profile in up to (i.e. with support restricted to ) and let denote the maximum time for which is defined (by convention when does not contain any temporal path from to ). We aim at proving the following claim.
Claim 9.
For each event , is a representation of .
Note that applying this claim to the last event proves the correctness of Algorithm 1 as it ensures that is a representation of the -profile in . The complexity of the algorithm directly follows from the time complexities of the dynamic connected component procedures. Proposition 7 will thus follow from the proof of this claim.
We first state the following about profile inclusion.
Claim 10.
For any two events and such that precedes in , and any time , we have .
Since any temporal path in is also a temporal path in , we obtain for any time . We also have since a temporal path arriving after in uses only unclosed temporal edges after , and since these edges begin at or before we can transform the temporal path into one arriving at . This implies that we have equality of profiles for since no temporal path in can arrive before as the possible additional temporal edges of begin at or later.
We now prove Claim 9 by induction on the number of events processed. Initially, we consider an empty temporal graph (with no temporal edge). As expected, is empty reflecting that there exists no temporal walk from to in . We assume the induction hypothesis for event , i.e. is a representation of . Let us consider the next event and distinguish two cases.
Ending event case. First suppose that is an ending event . Note that we have by definition. By Claim 10, we have for so that is a valid representation of for . Moreover, if , implies and we have . The only case when differs from is thus when , that is when there exists a temporal -path composed of unclosed temporal edges. In other words, this occurs when and is true. This implies that we then have and . Moreover, is then the identity over as reflected by the addition of the triple at the end of in that case at Line 20. is thus a valid representation of .
Beginning event case. Now suppose that is a beginning event for the temporal edge of . Note that then differs from by having the two extra temporal edges and its symmetrical temporal edge . Consider the -profile in . It is the identity during interval when in correspondence with the addition of to at Line 20 in that case. Note that we then have and .
Now consider the case when is connected to or , we have and by Claim 8. If , this is in correspondence with the addition of at Line 13 as a temporal -path departing at time must use or and cannot arrive before . Note that we have when and the triple is not added in that case. Otherwise, can only occur when since we have as any temporal path in is also a temporal path in . We then have implying which justifies to not modify in that case.
Finally consider the case when is not in the connected component of neither , nor , nor . We then have since a temporal -path in cannot traverse or as they appear too late to reach after . Any temporal -path in is thus also a temporal -path in with same departure time. This is indeed reflected by the fact that is not modified in that case, yielding to . We finally obtain that is a valid representation of in all cases. This concludes our proof of Claim 9 as well as the correctness of Algorithm 1. Its time complexity directly derives from that of sorting edge events and the amortized time complexity of the dynamic tree operations that allow to maintain connected components as explained in Section 5.2. This ends the proof of Proposition 7 and its direct consequence Theorem 6.
