Abstract 1 Introduction 2 Preliminaries 3 Lower bound for temporal connectivity 4 Lower bound for shortest temporal path 5 Complexity of fastest temporal path 6 Conclusion References Appendix A Lower bounds for fastest temporal path with uniform delay one or zero Appendix B Profile computation in undirected temporal graphs with uniform delay zero

Complexity Gaps Between Point and Interval Temporal Graphs for Some Reachability Problems

Guillaume Aubian IRIF, CNRS & Université Paris Cité, France    Filippo Brunelli European Commission – Joint Research Centre (JRC), Brussels, Belgium    Feodor F. Dragan ORCID Kent State University, Department of Computer Science, Kent, Ohio, USA    Guillaume Ducoffe ORCID Faculty of Mathematics and Computer Science, University of Bucharest, Romania
National Institute for Research and Development in Informatics, Bucharest, Romania
   Michel Habib ORCID IRIF, CNRS & Université Paris Cité, France    Allen Ibiapina IRIF, CNRS & Université Paris Cité, France    Laurent Viennot ORCID Inria, DI ENS, Paris, France
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 complexity
Copyright and License:
[Uncaptioned image] © Guillaume Aubian, Filippo Brunelli, Feodor F. Dragan, Guillaume Ducoffe, Michel Habib, Allen Ibiapina, and Laurent Viennot; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Graph algorithms analysis
; Theory of computation Shortest paths
Related Version:
Full Version: https://arxiv.org/abs/2501.11380
Funding:
Supported by the French ANR project ANR-22-CE48-0001 (TEMPOGRAL).
Editors:
George B. Mertzios and Andréa W. Richa

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 M 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, n and m=O(n2) respectively, if the input has n vertices and the underlying graph has m 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 𝒪~(nM) for a temporal graph with n vertices and M 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.

Table 1: Summary of known results on the complexity of computing a foremost, fastest or shortest temporal path or testing temporal connectivity in a temporal graph with n vertices and M temporal edges. In the column structure the abbreviation “TPG” means “temporal graph”. The lower-bounds are given for any ϵ>0 under standard fine-grained complexity assumptions. Symbols Ω,Ω×,Ω+ all stand for Ω under the following respective assumptions: Ω holds under SETH; Ω× holds under the assumption that there is no algorithm that can solve all pairs shortest path (APSP) in truly subcubic time; and Ω+ applies to combinatorial algorithms assuming that no such algorithm can solve triangle detection in truly subcubic time.
Problem Model Point TPG Interval TPG Undirected Interval TPG
delay zero delay one
Foremost 𝒪~(M) [16, 6] 𝒪~(M) [16, 6] 𝒪~(M) [16, 6] 𝒪~(M) [16, 6]
Fastest 𝒪~(M) [35, 15] Ω×((nM)1ε) Th.3, 𝒪~(n2M) [14] 𝒪~(M) Th.6 Ω+((nM)1ϵ) Th.4
Shortest 𝒪~(M) [35] Ω+((nM)1ε) Th.2, 𝒪~(nM) [6] Ω+((nM)1ϵ) Th.2 Ω+((nM)1ϵ) Th.2
Connectivity Ω((nM)1ϵ) [13] Th.1 𝒪~(nM) [16, 6] Ω((nM)1ϵ) Th.1 Ω((nM)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 ϵ>0, testing temporal connectivity in point temporal graphs with n vertices and M edge appearances requires Ω((nM)1ϵ) 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 Ω(M2ϵ) 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 k-SAT allows to show it for any ϵ>0 (using the definition of SETH, an appropriate k can be chosen for a given ϵ>0).. We state a lower bound of Ω((nM)1ϵ) for consistency with the upper bound of 𝒪~(nM). However, our reduction uses M=Θ(n) and also implies a Ω(M2ϵ) 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 ϵ>0, an O((nM)1ϵ)-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 (min,+)-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 Ω((nM)1ϵ) time for combinatorial algorithms. Interestingly, this reduction uses a temporal graph of diameter Θ(n), 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 𝒪~(Dm) where Dn is the largest length of a temporal path (in terms of number of edges) and m is the size of the underlying graph. Note that it uses a sorted data structure which can be pre-computed in 𝒪~(M) 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 𝒪~(mM) 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 [τ1,τ2] with τ1τ2 represents all times τ satisfying τ1ττ2. For τ1<τ2, we similarly define (τ1,τ2] ([τ1,τ2) respectively) as the set of times τ satisfying τ1<ττ2 (τ1τ<τ2 respectively).

An interval temporal graph, hereafter referred to simply as a temporal graph, is a pair 𝒢=(V,), where V is a set of vertices and is a set of temporal edges. Each temporal edge is a quintuple e=(u,v,τ1,τ2,δ), where u and v are vertices, τ1, τ2 and δ are integers, with τ1τ2 and δ0 that represent its beginning time, its ending time and its delay (or traveling time), respectively. Such a temporal edge represents the presence of edge uv during [τ1,τ2], that is, it can be traversed starting from its tail u at any time τ[τ1,τ2] to arrive in its head v at time τ+δ. We say that e connects uv during interval [τ1,τ2] with delay δ. We let tail(e)=u, head(e)=v, begin(e)=τ1, end(e)=τ2, and delay(e)=δ denote its tail, its head, its beginning time, its ending time, and its delay respectively. When τ1=τ2, 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 (u,v,τ1,τ2,δ), the symmetrical temporal edge (v,u,τ1,τ2,δ) 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 G=(V,E) with same vertex set V and edge set E={uv:(u,v,τ1,τ2,δ)}. Note that we let uv denote the directed edge from u to v. We say that an edge uv of the underlying graph is present during [τ1,τ2] with delay δ when there is a temporal edge (u,v,τ1,τ2,δ) in . When the temporal graph is undirected we also assume that the symmetrical edge is in so that is symmetric. When τ1=τ2, we say that uv is present at point τ1 with delay δ. Note that the underlying graph G is directed. In contrast, when considering a (static) undirected graph (V,E) with vertex set V and edge set E, we consider that E(V2) is a set of unordered pairs, and we let {u,v} denote an undirected edge between u,vV.

When a temporal graph is clear from the context, we let n=|V| denote its number of vertices, M=|| denote its number of temporal edges, and m=|E| denote its number of underlying edges. It should be noticed that M can be much larger than m, since an edge in E 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 n=O(m).

A temporal walk in 𝒢 is a sequence of pairs Q=(e1,τ1),,(ek,τk) where, for each i[k]={1,,k}, ei is a temporal edge and τi is a traversal time in the presence interval of ei, i.e. satisfying begin(ei)τiend(ei). It is also required that head(ei)=tail(ei+1) for all i[k1], i.e., it induces a walk in the underlying graph G, and that τi+delay(ei)τi+1 for all i[k1], i.e., each temporal edge is traversed one after the other in time. When s=tail(e1) and head(ek)=t, we say that Q is a temporal st-walk. We also say that Q is a temporal walk departing from s at time τ1 and arriving in t at time τk+δk where δk=delay(ek). We let dep(Q)=τ1, arr(Q)=τk+δk and len(Q)=k denote its departure time, its arrival time and its length in number of edges respectively. Its duration is defined as dur(Q)=arr(Q)dep(Q)=τk+δkτ1. Q is said to be a loop when tail(e1)=head(ek). When all vertices tail(e1),head(e1),,head(ek) are pairwise distinct, Q is said to be a temporal path, or a temporal st-path if s=tail(e1) and head(ek)=t. Note that any temporal st-walk with st can be transformed into a temporal st-path by removing sequences of temporal edges forming loops. A fastest temporal st-path is defined as a temporal st-path with minimum duration. A shortest temporal st-path is defined as a temporal st-path with minimum length. A foremost temporal st-path is defined as a temporal st-path with minimum arrival time. If there is a temporal st-path for every pair of vertices s,t, 𝒢 is temporally connected.

A walk W in the underlying graph G will be given as a sequence v0,,vk of vertices such that vi1vi is an edge for each i[k]. It is said to be temporally feasible if there exists a sequence of times τ1τk such that each edge vi1vi is present at time τi with delay at most τi+1τi (using τk+1=). It is said to be a path when v0,,vk are pairwise distinct.

3 Lower bound for temporal connectivity

Recall that an interval temporal graph is temporally connected if it has a temporal st-path for every pair s,t 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 𝒪~(nM)-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 ε>0, there is no 𝒪((nM)1ε)-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 ϵ>0, there is no O(n2ϵ)-time algorithm distinguishing diameter 2 from 3 in graphs with O(n) nodes and O(n) 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 G=(V,E) be an arbitrary undirected graph with O(n) nodes and O(n) edges. Without loss of generality, G is connected and has no self-loop. Let F be the set of ordered pairs (u,v)V2 such that {u,v}E (thus |F|=2|E|). We construct from G an undirected point temporal graph G as follows:

  • The vertex set is {s}VF1F2 where F1,F2 are disjoint copies of F and s is an additional vertex. For every ordered pair f=(u,v)F, we let f1F1,f2F2 denote its copies. F1F2 induces an independent set in the underlying graph of G and so does {s}V.

  • For every ordered pair f=(u,v)F, we add temporal edges with delay zero in G so that:

    • edge uf1 is present at time 1 (i.e. interval [1,1]),

    • edge f1v is present at time 2,

    • edge uf2 is present at time 3,

    • edge f2v is present at time 4,

    • edges sf1 and sf2 are present at times 0 and 5.

We also add the corresponding symmetrical temporal edges so that G is undirected. All temporal edges of G have delay zero. See also Figure 1. Note that G has O(n) vertices and M=O(n) temporal edges as G has O(n) vertices and O(n) edges.

Figure 1: Part of the point temporal graph G induced by nodes s,u,v,f1,f2 for an ordered pair f=(u,v) such that G contains the undirected edge {u,v}. Each undirected edge {x,y} with label τ in this Figure represents two point temporal edges with delay zero: (x,y,τ,τ,0) and (y,x,τ,τ,0). Note that G contains a similar structure with two other vertices f1F1 and f2F2 for the pair (v,u).

Since {s}F1F2 induces a temporal graph, whose underlying graph is connected, and where all edges are present at time 0, vertices in {s}F1F2 can reach each other at time 0. Similarly, they can reach each other at time 5. Since there is a temporal edge between every vertex in V and some vertex in {s}F1F2 at times 1 and 4, this implies that G is temporally connected if and only if every pair of vertices in V can temporally reach each other.

Let u,v be two distinct vertices of V. We will prove that there is a path of length at most 2 from u to v in G if and only if there is a temporal path from u to v in G. Let us first prove the direct implication. If u,w,v is a path of length 2 in G, let f=(u,w) and g=(w,v). Then u,f1,w,g2,v is a path from u to v in the underlying graph of G which is temporally feasible in G by traversing edges uf1,f1w,wg2,g2v at times 1,2,3,4, respectively.

Let us now prove the converse implication, and suppose that there is a temporal path P from u to v in G. Since any edge incident to u or v is only present at times 1, 2, 3, or 4, P only uses times 1, 2, 3, and 4. This implies that P does not use s, because it is only available at times 0 or 5. Since the underlying graph of G is bipartite, with bipartition (V{s},F1F2), and since any two edges xf,fy incident to fF1F2, with xy, have distinct time availabilities, this implies that P uses at most 3 elements of F1F2, i.e., the underlying path of P is either u,f,v, or u,f,w,f,v, or u,f,w,f,x,f′′,v, with w,xV and f,f,f′′F1F2. The latter case is indeed impossible. The distinct time availabilities of uf and fw imply that fw is traversed at time 2 at least. Hence, both wf and fx are traversed at time 2 or later, implying fF2. Edges wf and fx are thus traversed at time 3 and 4, respectively, in contradiction with the two distinct time availabilities of xf′′ and f′′v. By construction, the two first cases imply that either {u,v}E or that {u,w},{w,v}E. Thus, there is a path of length at most 2 between u and v in G.

We thus conclude that G has diameter at most 2 if and only if G 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 s also appear at times 1 and 6. More precisely, we obtain G from G by changing all delays to one instead of zero and by adding edges sf at times 1 and 6 for all fF1F2 (again with delay one and adding corresponding symmetrical temporal edges so that G is undirected).

Now, vertices in {s}F1F2 can reach each other at time 1 by passing through s. They can also reach each other starting at time 5 and arriving at time 7. They can then reach any vV at time 2. Similarly, any vertex v can reach some fF1F2 at time 2 and then any other f{s}F1F2 at time 7. This implies that G is temporally connected if and only if every pair of vertices in V can temporally reach each other. The proof that this happens if and only if G has diameter two is the same as above since the proof uses only strict temporal paths that also correspond to temporal paths in G.

4 Lower bound for shortest temporal path

Theorem 2.

If, for every ε>0, there is no combinatorial 𝒪(n3ε)-time algorithm for detecting a triangle in an undirected graph, then for every ϵ>0, there is no combinatorial 𝒪((nM)1ϵ)-time algorithm for computing a shortest temporal st-path in a temporal graph, even if the temporal graph is undirected and has uniform delay zero (resp. one).

Proof.

Let G=(V,E) be an instance of Triangle Detection that is a (static) undirected graph. Triangle detection consists in finding three pairwise distinct vertices u,v,w such that the three undirected edges {u,v},{v,w},{w,u} are in E. Suppose V={v1,,vn}. A temporal graph G is constructed as follows. Here, a permanent temporal edge between vertices u and v indicates that both edges uv and vu are present during the interval [1,n]. All delays are zero.

  • The vertex set of G consists of the vertices s, t, and 4 disjoint copies of V, denoted V1,,V4. For j{1,2,3,4} and i{1,,n}, let vij represent vertex vi in Vj.

  • In V1 and V4, permanent temporal edges are defined to form a path that respects the vertex ordering. Specifically, for j{1,4} and i{1,,n1}, we add a permanent temporal edge between vij and vi+1j. Additionally, permanent temporal edges are defined to connect the source vertex s to vn1 and the target vertex t to v14.

  • For each edge {vi,vj}E with i<j, the temporal edges vi1vj2 and vj3vi4 (and their symmetric edges vj2vi1,vi4vj3) are both present at time i. Additionally, a permanent temporal edge between vi2 and vj3 is added.

Observe that G can be constructed in 𝒪(n+m) time, where m is the number of edges of G. The correctness of the reduction comes from the following claim. The theorem thus follows from its proof.

Claim 0.

There is a triangle in G if and only if there exists a temporal path in G from s to t using at most n+4 edges.

First, suppose that there is a triangle in G formed by the vertices vi1,vi2,vi3 with i1<i2<i3. Using the permanent edges within V1, we can construct a temporal path starting at s and arriving at vi11 at time 1i1. Let P1 denote this temporal path and note that it contains n+1i1 edges. By the existence of the triangle, we know that the temporal edges e1=(vi11,vi22,i1,i1,0),e2=(vi22,vi33,1,n,0),e3=(vi33,vi14,i1,i1,0) form a temporal path (e1,i1),(e2,i1),(e3,i1) in G. Denote this temporal path as P2. Using the permanent edges within V4, we can construct a temporal path P3 from vi14 to t that uses i1 edges and traverses all of them at time ni1. The paths P1, P2, and P3 are constructed such that they can be concatenated into a single temporal path from s to t. The total number of edges in this concatenated path is n+4. See Figure 2 for an illustration of such a temporal path.

Figure 2: A temporal path in G corresponding to a triangle vi1,vi2,vi3 in G, assuming that G has n=5 vertices with i1=2,i2=3,i3=4. Labels indicate when edges are traversed. Plain blue edges correspond to permanent temporal edges, i.e., they are present during interval [1,n], while dashed red edges are present only at point i1.

Now, suppose that there exists a temporal path P from s to t of length at most n+4. Let P be the temporal path obtained from P by removing its first and last edges (those incident to s and t respectively). Let e be the first temporal edge of P that is not within V1, and let g be the last temporal edge of P that is not within V4. By the structure of G, e connects a vertex in V1, say vi11, with a vertex in V2, say vi22, and it is present only at time i1. Similarly, g is incident to vertices vi33 and vi44, and it is present only at time i4. Moreover, by the definition of temporal path, g appears after (or at the same time as) e in P (possibly in a non-strict path they appear at the same time). Thus, i1i4. Now, observe that the distance from s to vi11 in the underlying graph of G is ni1+1, the distance from vi11 to vi44 is at least 3, and the distance from vi44 to t is i4. This implies that P uses at least n+4+(i4i1) temporal edges. Since the length of P is at most n+4, we get i4i1. We thus have i1=i4. Now, the three temporal edges that P uses between vi11 and vi44=vi14 must have the form vi11vi22,vi22vi33 and vi33vi14 for some i2,i3[n]. By the way that G is constructed, {vi1,vi2},{vi2vi3} and {vi3,vi1} are undirected edges in G, i.e., vi1,vi2,vi3 forms a triangle in G. 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 G with uniform delay one, we modify the temporal edges of G as follows. All delays are set to one. All permanent edges are present during interval [1,3n+3] instead of [1,n]. For each undirected edge {vi,vj}E with i<j, the symmetrical edges vi1vj2 and vj2vi1 are present at point n+i while the symmetrical edges vj3vi4 and vi4vj3 are present at point n+i+2. The proof similarly follows from the following claim.

Claim 0.

There is a triangle in G if and only if there exists a temporal path in G from s to t using at most n+4 edges.

If G contains a triangle vi1,vi2,vi3 with i1<i2<i3, we can again form a temporal path of length n+4 in G starting from s at time 0, reaching vi11 within V1 at time ni1+1, waiting in vi11 until time n+i1 following the temporal edges e1=(vi11,vi22,n+i1,n+i1+1,1),e2=(vi22,vi33,n+i1+1,n+i1+2,1),e3=(vi33,vi14,n+i1+2,n+i1+3,1) at times n+i1,n+i1+1,n+i1+2 respectively, reaching vi14 at time n+i1+3, reaching v14 within V4 at time n+2i1+2, and arriving in t at time n+2i1+3.

Conversely, suppose that P is a temporal st-path in G of length at most n+4. Its first temporal edge leading outside V1{s} must be e=(vi11,vi22,n+i1,n+i1,1) for some i1[n]. Its last temporal edge with a vertex outside V4{t} must be g=(vi33,vi44,n+i4+2,i1,1) for some i4[n]. As the minimum length of path from V2 to V3 is one in the underlying graph of G, there is at least one temporal edge f between e and g in P. As e and g must be traversed at times n+i1 and n+i4+2 respectively, we get n+i1+2n+i4+2 since P is a temporal path and e,f have delay one. We thus have i1i4. Again, the distance from s to vi11 in the underlying graph of G is ni1+1, the distance from vi11 to vi44 is at least 3, and the distance from vi4 to t is i4. This implies that P has length at least n+4+(i4i1)n+4. We thus have i1=i4 and G contains the triangle vi1,vi2,vi3. 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 ε>0, there is no 𝒪(n3ε)-time algorithm for detecting a negative triangle in a weighted graph, then for every ϵ>0, there is no 𝒪((nM)1ϵ)-time algorithm for computing a fastest temporal st-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 𝒪(n+m)-time reduction from Negative Triangle Detection to the problem of computing a fastest temporal path in a temporal graph. For that, let G=(V,E,w) be an arbitrary edge-weighted undirected graph with n nodes and m edges where w:E assigns a weight we to each edge eE. Without loss of generality, V={0,1,2,,n1} and G is loopless. Let T=2nmaxeE|we|. We construct from G an undirected temporal graph G as follows:

  • The vertex set is {s,t}V1V2V3 where V1,V2,V3 are disjoint copies of V and s,t are two additional vertices. For every vV, let v1V1,v2V2,v3V3 denote its respective copies. V1,V2,V3 are independent sets.

  • The underlying edge set includes {sv1,v3t:vV}{u1v2,v1u2,u2v3,v2u3:{u,v}E} (and symmetrical edges).

  • For every {u,v}E, edges u1v2,v1u2,u2v3,v2u3 and their symmetrical counterparts v2u1,u2v1,v3u2,u3v2 are all present during [0,2mT] with delay T/2+w{u,v}.

  • Finally, let E={e1,e2,,em} be an enumeration of the edge set E. For each i[m], let u and v be the endpoints of ei such that u<v. Then, the symmetrical edges su1,u1s are both present at point 2(i1)T with delay T/2+wei, and the symmetrical edges v3t,tv3 are both present during [2(i1)T,2iT] with delay T/2.

Figure 3: Part of the underlying graph of G corresponding to a triangle u,v,x contained in G assuming that the undirected edge eiE is {u,v} with u<v. Recall that each undirected edge {y,z} of the figure corresponds to two symmetric edges yz and zy of G. Here, the given labels indicate the delays of the corresponding temporal edges appearing during interval [2(i1)T,2iT). Plain blue edges are present during interval [0,2mT]. Dashed edges are more restricted: in particular, edges su1 and u1s are present at point 2(i1)T, while edges v3t and tv3 are present during interval [2(i1)T,2iT]. Note that these edges can have other appearances depending on other neighbors of u and v in G.

Note that G has 3n+2 vertices and M=12m 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 st-path in G with duration less than 2T if and only if G contains a negative triangle. For that, let us fix a temporal st-path P of minimum duration. By the construction of G, its first temporal edge is present at time 2(i1)T for some i[m]. Let u,v be the endpoints of ei so that P starts with edge su1, i.e. ei={u,v} with u<v. If the duration of P is less than 2T, then P ends with the only edge with head t appearing in [2(i1)T,2iT), that is edge v3t. Let k<n be the number of edges of P. The duration of P must be at least k(T/2maxeE|we|)=(kk/n)T/2>(k1)T/2 while also being less than 2T. We thus have k4. Furthermore, we must have k=4 since the distance between s and t is at least 4 in the underlying graph of G. In this situation, there must exist a vertex x such that the underlying edges of P are su1,u1x2,x2v3,v3t, implying that u,x,v is a triangle of G. As the temporal edges connecting su1 and v3t have delays T/2+wei and T/2 respectively, the duration of P is at least 2T+wei+w{u,x}+w{x,v}, which is less than 2T if and only if the triangle u,x,v is negative (see the corresponding path in Figure 3 for an illustration). Conversely, if u,x,v is a negative triangle, then up to reordering we can assume that its edges are e1,e2,e3. Then, there exists a temporal st-path that starts at time 0, has no waiting time, and has duration less than 2T. 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 ε>0, there is no combinatorial 𝒪(n3ε)-time algorithm for detecting a triangle in an undirected graph, then for every ϵ>0, there is no combinatorial 𝒪((nM)1ϵ)-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 ε>0, there is no combinatorial 𝒪(n3ε)-time algorithm for detecting a triangle in an undirected graph, then for every ε>0, there is no combinatorial 𝒪((nM)1ε)-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 s and t in this graph, we define the st-profile PFst as the function PFst(τ) associating each departure time τ from s to the earliest arrival time in t; in other words, PFst(τ) is the minimum arrival time of any temporal path leaving s 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 Euv for each underlying edge uv. The slope is one in intervals where the edge is present: for each temporal edge (u,v,τ1,τ2,δ), the earliest arrival time in v is τ+δ for τ[τ1,τ2]. The slope is zero in intervals where it is not present, as the earliest arrival time is τ1+δ for τ<τ1 if the next presence of uv is during interval [τ1,τ2] with delay δ. Similarly, the profile function fP of a path P=v1,,vk can be obtained by composition of Ev1v2,,Evk1vk, resulting in a polyline whose slopes are obtained by multiplying slopes of the composing function and must be in {0,1}. Finally, if 𝒫 denotes the set of all paths from s to t in the underlying graph, we have PFst=minP𝒫fP which is thus also a polyline with slopes in {0,1}. See [14] for more details.

One way to represent this function is by a collection of triples {(αi,βi,si)}i=1k, where (αi)i=1k is non-decreasing, βi=PFst(αi) and for every τ(αi1,αi], we have PFst(τ)=βi+si(ταi) where we define α0=. The minimum collection of such triples is what we call a minimal representation of the st-profile. Note that when s=t, 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 O((nlogn+m)M) time, we refer the reader to [14].

Theorem 6.

Given an undirected interval temporal graph 𝒢 with no isolated vertices and M temporal edges having all zero delay, and two vertices s and t, it is possible to compute in 𝒪~(M) time a fastest temporal path from s to t. Furthermore, a minimal representation of the st-profile PFst 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 𝒢=(V,) and two distinct vertices s,tV, computes a representation of the profile function PFst from s to t. 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 c the last departure time LDT[c] allowing us to reach it at time τ from s. In other words, LDT[c] is the maximum time λ such that there exists a temporal path from s to any vertex w in the component that starts at time λ and arrives no later than time τ. Note that this definition does not depend on w: such a temporal path to w 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 (u,v,τ1,τ2,0) as two events: a beginning event (resp. ending event) which occurs when the edge begins at time τ1 (resp. ends at time τ2) and which is defined as the quintuple (u,v,τ1,begin,τ2) (resp. (u,v,τ2,end,τ2)). 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 O(MlogM) 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 V 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 {u,v}, if u and v are already in the same tree T, we can thus find the edge {u,v} with smallest ending time along the cycle of T{u,v} and cut T by deleting {u,v} before linking u and v (if {u,v}={u,v}, we do nothing). If u and v are not in the same tree, we link the two trees according to [32]. We let CC_AddEdge({u,v},τ2) denote the resulting procedure for adding an edge {u,v} with ending time τ2. We let CC_RemoveEdge({u,v}) denote the procedure that cuts the tree containing u and v according to [32] if one vertex is parent of the other (and does nothing otherwise). We further let CC(u) denote the procedure that returns the ID of the root of the tree containing u according to [32]. We use this ID (a number between 1 and n) to identify the component spanned by the tree, so that the expression CC(u)=CC(v) allows us to test whether u and v are in the same connected component. All these procedures can be implemented in O(logn) time [32]. Note that the simpler version in amortized O(logn) time suffices for our purposes. We let CC_Init(V) denote the procedure that creates n single-node trees, one for each vertex in V (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.

Algorithm 1 One-to-one profile.

The update of last departure times is then rather simple. When two components merge because of the appearance of an edge uv at time τ, the last departure time LDT[c] of the resulting component c is set to the maximum of the last departure times of the components of u and v 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 uv 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 s for which the last departure time is always the time τ of the current event. Obtaining the last departure time λ of the connected component of t after an event at time τ basically indicates that PFst(λ)τ. We will prove that when a higher value of λ is observed for t, τ corresponds to the earliest arrival time when departing at λ and we then have PFst(λ)=τ. Note that τλ is then the duration of the corresponding temporal path from s to t. Each time an event affects the connected component of the target t, we update a list Prof of triples accordingly so that it represents the profile PFst up to that event. See the pseudo-code of Algorithm 1 for more details.

Proposition 7.

Given an undirected interval temporal graph G with with no isolated vertices and M temporal edges having all zero delay, and two vertices s and t, Algorithm 1 computes a representation of the st-profile in O(MlogM) time.

First note that Theorem 6 easily follows from Proposition 7 since the duration of a fastest temporal st-path as well as the starting time λ of such a fastest temporal path can easily be obtained by scanning the st-profile in O(M) time to obtain the triple (λ,τ,s) minimizing τλ. We can then find a fastest temporal st-path departing at time λ by computing an earliest-arrival st-path departing at time λ in O(MlogM) time. Indeed, after an O(MlogM)-time preprocessing for obtaining for each underlying edge uv the sorted list of temporal edges connecting uv, we can compute such a temporal path through a temporal version of Dijkstra’s algorithm [16, 6] in O(mlogM+nlogn) time. Note that the logM factor accounts for the time required to find with binary search the first temporal edge connecting uv that can be traversed at a certain time τ for a given neighbor v (in the underlying graph) of a node u 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 n=O(m)=O(M) and logn=O(logM). 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 Ω(nM) lower bound for the computation of a fastest temporal st-path and the 𝒪~(mM)=𝒪~(n2M) upper bound given by the best-known algorithm [14]. Note that the gap can be large for dense underlying graphs with m=Θ(n2).

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 𝒪~(M) algorithm for computing one-to-all fastest durations, i.e., given a source vertex s, an algorithm that computes the duration of a fastest temporal path from s to each possible target vertex t? 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 Ω(M). But it can easily be turned into an 𝒪~(nM)-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 O(n) 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 G=(V,E) be an arbitrary unweighted graph. Without loss of generality, V={0,1,2,,n1} and G is loopless. Let N be some large enough constant (say, N=10). The undirected temporal graph 𝒢 is constructed from G as follows:

  • The vertex set is {s,t}V1V2V3 where V1,V2,V3 are disjoint copies of V. For every vV, let v1V1,v2V2,v3V3 denote its copies.

  • The underlying edge set includes {sv1,v3t:vV}{u1v2,u2v3:{u,v}E} (and symmetrical edges).

  • For every {u,v}E, edges u1v2,u2v3 and their symmetrical counterparts v2u1,v3u2 are all present during [0,nN+3].

  • For every vV, the symmetrical edges sv1,v1s are both present at point vN, while the symmetrical edges v3t,tv3 are both present at point uN+3 for each uN(v).

  • Finally, all temporal edges have delay one.

Note that we can construct 𝒢 from G in 𝒪(n+m) time.

We claim that G contains a triangle if and only if the shortest duration for reaching t from s equals 4. Indeed, if u,v,w is a triangle of G, then there exists a temporal path starting at time uN, going by vertices s,u1,v2,w3,t, with zero waiting time and total duration 4. Conversely, assume the existence of a temporal path P from s to t, with total duration at most 4. As edges have delay 1, it must have 4 edges at most, which is the least it can have as V1,V2,V3 are vertex separators of the underlying graph (i.e. the removal of any Vi for i[3] disconnects s from t). The underlying path of P must thus be s,u1,v2,w3,t for some triple u,v,wV satisfying {u,v},{v,w}E. This path has su1 and w3t as first and last edges respectively. Then, the starting time of P must be uN and edge w3t must be present at time uN+3 which happens only when uN(w). Since G is loopless, u,v,w are pairwise distinct. Therefore, G contains the triangle u,v,w. 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 s to t has duration 3 if and only if G 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 s to V1, from V1 to V2, from V2 to V3 and from V3 to t, then it holds that contains a temporal st-path of duration 3 if and only if G 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 e, let be the temporal graph with the same set of vertices as 𝒢 and all temporal edges (u,v,τ1,τ2) of 𝒢 such that the event (u,v,τ1,begin,τ2) is not after e in the event list . The temporal edges of 𝒢e whose ending events come after e in , are called unclosed temporal edges as their ending events have not been processed yet. We let τe denote the time at which event e occurs. We define the last departure time λe(w) from s to reach w at e or before in Ge as the maximum time λ such that there exists a temporal sw-walk departing at time λ in Ge and arriving no later than τe. Similarly, we use CCe, LDTe and Profe to refer to the values stored in CC, LDT and Prof respectively after the algorithm has processed the event e. We aim at proving the following claim.

Claim 8.

For each event e, we have LDTe[CCe(w)]=λe(w).

We first note that this claim allows us to prove that Algorithm 1 correctly identifies a triple (λ,τ,s) corresponding to a fastest temporal st-path with duration τλ. Consider a fastest temporal st-path P and let λ and τ denote its departure time from s and arrival time in t respectively. Among the suffixes of P with temporal edges present at time τ, consider the last beginning event e of one of these temporal edges and consider its time τeτ. As τe<τ would lead to a faster temporal st-path, we must have τe=τ. As the suffix from the temporal edge associated to e is present at time τe by the choice of e and t is in the connected component of the suffix when processing e, the claim implies LDTe[CCe(t)]=λe(t) and λe(t)=λ by definitions of λe(t) and P. If λ>λt, the triplet (λ,τ,0) is added to the profile at Line 13. Otherwise, a triplet (λt,τ,s) was added previously with λλt and ττ, implying τλtτλ. As P is a fastest temporal path, we must have τλt=τλ. In both cases, Algorithm 1 correctly identifies a triple (λ,τ,s) corresponding to a fastest temporal st-path. Additionally, Claim 8 also implies that each triple (λ,τ,0) added to Prof corresponds to a temporal path starting from s at time λ and arriving in t at time τ. Moreover, a triple (τ,τ,1) is added to Prof only if s and t are in the same connected component at time τ. We can thus conclude that the minimum τλ over all triples (λ,τ,s) of Prof is the duration of a fastest temporal st-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 CCe(w)[n] uniquely identifies the connected component of w in the graph induced by the edges that are present in 𝒢 at time τe and whose ending events are after e 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 𝒢e. In particular, when two vertices u and v are in the same connected component (i.e. CCe(u)=CCe(v)), they are connected through unclosed temporal edges of 𝒢e. Note that this implies the existence of an instantaneous temporal uv-path that uses only unclosed temporal edges which are all traversed at the same time τe.

Initially, we consider an empty temporal graph 𝒢0 and the claim is clearly satisfied for any vertex ws. Now, suppose that Claim 8 is satisfied for any vertex ws before scanning an event f at time τ=τf. Note that the algorithm first sets LDT[CC(s)]:=τ, so that the claim LDTf[CCf(w)]=λf(w) is satisfied for w=s and all vertices w in CCf(s). Now consider any vertex w outside of CCf(s). In that case, any temporal sw-path uses some temporal edge ending before τf, implying λf(w)τe where e denotes the event preceding f (we use e=0 and τe= if f is the first event). We distinguish two cases.

Ending event case. If f corresponds to the disappearance of an edge uv, we have 𝒢f=𝒢e, implying λf(w)λe(w). As we have λf(w)τe (since w is outside of CCf(s)), the corresponding temporal sw-path exists in Ge and we have λf(w)=λe(w). The updates in that case ensure that LDT[CC(w)] keeps the same value (after the possible change of CC(w)) so that LDTf[CCf(w)]=λe(w)=λf(w) still holds.

Beginning event case. If f corresponds to the appearance of an edge uv, 𝒢f differs from 𝒢e by the addition of the two temporal edges f=(u,v,τf,τ2) and f′′=(v,u,τf,τ2) associated to f. We thus have λf(w)λe(w), and λf(w)>λe(w) can only occur if any temporal sw-path with departure time λf(w) uses f or f′′. Consider such a temporal sw-path departing at time λf(w) and assume without loss of generality that it traverses f from u to v, implying λf(w)λe(u) by definition of λe(u). As we set LDT[CC(w)] to max{LDT[CC(u)],LDT[CC(v)]} in that case, we then have LDTf[CCf(w)]LDTe[CCe(u)]=λe(w) by induction hypothesis. Combining this with the previous inequality, we get LDTf[CCf(w)]λf(w). We also have λf(w)LDTf[CCf(w)] since the induction hypothesis implies the existence of a temporal sx-path P to a node x in {u,v} departing at max{LDTe[CCe(u)],LDTe[CCe(v)]}=LDTf[CCf(w)] and arriving at τe or before such that P can be extended by an instantaneous temporal xw-path at time τfτe. We thus finally get LDTf[CCf(w)]=λf(w) in that case too. Claim 8 thus follows by induction.

We now turn to the proof of the profile computation. We denote by PFste the st-profile in 𝒢e up to τe (i.e. with support restricted to (,τe]) and let last(PFste) denote the maximum time ττe for which PFste(τ) is defined (by convention last(PFste)= when 𝒢e does not contain any temporal path from s to t). We aim at proving the following claim.

Claim 9.

For each event e, Profe is a representation of PFste.

Note that applying this claim to the last event l proves the correctness of Algorithm 1 as it ensures that Profl is a representation of the st-profile in 𝒢=𝒢l. 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 e and f such that e precedes f in , and any time λlast(PFste), we have PFstf(λ)=PFste(λ).

Since any temporal path in 𝒢e is also a temporal path in 𝒢f, we obtain PFstf(λ)PFste(λ) for any time λlast(PFste). We also have PFste(λ)τe since a temporal path arriving after τe in 𝒢e uses only unclosed temporal edges after τe, and since these edges begin at τe or before we can transform the temporal path into one arriving at τe. This implies that we have equality of profiles for λlast(PFste) since no temporal path in 𝒢f can arrive before PFste(λ)τe as the possible additional temporal edges of 𝒢f begin at τe or later.

We now prove Claim 9 by induction on the number of events processed. Initially, we consider an empty temporal graph 𝒢0=(V,) (with no temporal edge). As expected, Prof is empty reflecting that there exists no temporal walk from s to t in 𝒢0. We assume the induction hypothesis for event e, i.e. Profe is a representation of PFste. Let us consider the next event f and distinguish two cases.

Ending event case. First suppose that f is an ending event (u,v,τf,end,τf). Note that we have 𝒢f=𝒢e by definition. By Claim 10, we have PFstf(λ)=PFste(λ) for λlast(PFste) so that Profe is a valid representation of PFstf(λ) for λτe. Moreover, if λf(t)τe, Ge=Gf implies λf(t)=λe(t)last(PFste) and we have PFstf=PFste. The only case when PFstf differs from PFste is thus when λf(t)>τe, that is when there exists a temporal st-path composed of unclosed temporal edges. In other words, this occurs when CCe(t)=CCe(s) and st_connected is true. This implies that we then have last(PFste)=τe and PFste(τe)=τe. Moreover, PFstf is then the identity over [τe,τf] as reflected by the addition of the triple (τf,τf,1) at the end of Prof in that case at Line 20. Proff is thus a valid representation of PFstf.

Beginning event case. Now suppose that f is a beginning event (u,v,τf,begin,τ2) for the temporal edge f=(u,v,τf,τ2) of G. Note that 𝒢f then differs from 𝒢e by having the two extra temporal edges f and its symmetrical temporal edge f′′=(v,u,τf,τ2). Consider the st-profile PFstf in Gf. It is the identity during interval [τe,τf] when CCe(s)=CCe(t) in correspondence with the addition of (τf,τf,1) to Prof at Line 20 in that case. Note that we then have last(PFste)=τe and PFste(τe)=τe.

Now consider the case when t is connected to u or v, we have λt=LDTe[CCe(t)]=λe(t) and λf(t)=LDTf[CCf(u)]=λ by Claim 8. If λ>λt, this is in correspondence with the addition of (λ,τf,0) at Line 13 as a temporal st-path departing at time λ must use f or f′′ and cannot arrive before τf. Note that we have λ=τf=λt when CCe(s)=CCe(t) and the triple is not added in that case. Otherwise, λλt can only occur when λ=λt=λf(t)=λe(t) since we have λf(t)λe(t) as any temporal path in 𝒢e is also a temporal path in 𝒢f. We then have λf(t)=last(PFste) implying PFstf=PFste which justifies to not modify Prof in that case.

Finally consider the case when t is not in the connected component of neither s, nor u, nor v. We then have PFstf=PFste since a temporal st-path in 𝒢f cannot traverse f or f′′ as they appear too late to reach t after τf. Any temporal st-path in Gf is thus also a temporal st-path in 𝒢e with same departure time. This is indeed reflected by the fact that Prof is not modified in that case, yielding to Proff=Profe. We finally obtain that Proff is a valid representation of PFstf 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 O(logn)=O(logM) 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.