 Research
 Open Access
 Published:
Efficient computation of optimal temporal walks under waitingtime constraints
Applied Network Science volume 5, Article number: 73 (2020)
Abstract
Node connectivity plays a central role in temporal network analysis. We provide a broad study of various concepts of walks in temporal graphs, that is, graphs with fixed vertex sets but arc sets changing over time. Taking into account the temporal aspect leads to a rich set of optimization criteria for “shortest” walks. Extending and broadening stateoftheart work of Wu et al. [IEEE TKDE 2016], we provide an algorithm for computing shortest walks that is capable to deal with various optimization criteria and any linear combination of these. It runs in O(V+ElogE) time where V is the number of vertices and E is the number of timearcs. A central distinguishing factor to Wu et al.’s work is that our model allows to, motivated by realworld applications, respect waitingtime constraints for vertices, that is, the minimum and maximum waiting time allowed in intermediate vertices of a walk. Moreover, other than Wu et al. our algorithm also allows to search for walks that pass multiple subsequent timearcs in one time step, and it can deal with a richer set of optimization criteria. Our experimental studies indicate that our richer modeling can be achieved without significantly worsening the running time when compared to Wu et al.’s algorithms.
Introduction
Computing shortest paths in networks is arguably among the most important graph algorithms. It is relevant in numerous application contexts and used as a subroutine in a highly diverse set of applications. While the respective problem has been studied for static graphs for decades, over the last years there has been an intensified interest in studying shortest path computations in temporal graphs—graphs where the vertex set remains static, but the arc set may change over time (in discrete time steps).
Two natural motivating examples for the relevance of path and walk (in the later one may visit a vertex multiple times) computations in temporal graphs are as follows. First, Wu et al. (2016) discussed applications in flight networks where every node represents an airport and each arc represents a flight connection with a departure time. Clearly, a “shortest” path may then relates to a most convenient flight connection between two cities. Second, understanding the spread of infectious diseases is a major challenge to global health. Herein, nodes represent persons and timelabeled arcs represent contacts between persons where a virus can be transmitted. “Shortest” path (walk) analysis here may help to find measures against disease spreading (Newman 2018, Chapter 17). Notably, in both examples one might need to also take into account issues such as different concepts of “shortest”—also called optimal—paths (walks) or waiting times in nodes; this will be an important aspect of our modeling.
Our main reference point is the work of Wu et al. (2016) on efficient algorithms for optimal temporal path computation. These algorithms are also implemented in the temporal graph library of Apache Flink (Lightenberg et al. 2018). We extend their model with respect to two aspects. First, we additionally consider waitingtime constraints^{Footnote 1} for the network nodes, that is, a minimum time a walk must spend in a node before continuing and a maximum time a walk can stay in a node before it has to continue. Minimum waiting times can be used to model that passengers on an airport need some time to get from an arriving flight to the terminal for their next flight and maximum waiting times can be used to model recover times of patients after which they can no longer infect other people. Importantly, maximumwaitingtime constraints can enforce cycles from one node to another; refer to Fig. 1 for a simple example. Hence, we need to take into account optimal temporal walks from one node to another (in Wu et al.’s model without waitingtime constraints there is always an (optimal) temporal path visiting no node twice because no cycles are necessary).
Actually, if one insists on paths (without repeated nodes) instead of walks, then even deciding whether there exists a path between two nodes becomes NPhard (Casteigts et al. 2019).
The second extension to Wu et al.’s work lies in an increased number of optimality criteria (different notions of optimal walks) and the fact that we do not only deal with optimizing one criterion but a linear combination of any of these, thus addressing potentially richer modeling needs in realworld applications. For example, in the abovementioned flight network a traveling person might want to use our algorithm to optimize a linear combination of cost and travel duration. Note that trying to find walks under constraints (e.g., travel duration at most tand cost at most c for given c,t∈ℕ) leads to NPhard computational problems, even in the static case (Ahuja et al. 1993).
Related Work. The theory of temporal graphs is a relatively young but active field of research (Holme 2015; Holme and Saramäki 2012; Holme and Saramäki 2013; Holme and Saramäki 2019). Many of the basic concepts of temporal graphs such as temporal connectivity (Kempe et al. 2002; Nicosia et al. 2012; Axiotis and Fotakis 2016; Mertzios et al. 2019) or szseparation (Zschoche et al. 2020; Fluschnik et al. 2020) are based on the notion of temporal paths and walks. The concept of optimal temporal walks plays a central role in the definition of temporal graph metrics such as eccentricity, diameter, betweenness and closeness centrality (Pan and Saramäki 2011; Santoro et al. 2011; Kim and Anderson 2012; Buß et al. 2020).
An early algorithm for computing optimal temporal walks is due to Xuan et al. (2003). They computed temporal walks under different optimization criteria, namely foremost, fastest, and minimum hopcount. Wu et al. (2016) followed up by introducing algorithms for computing optimal walks for the optimization criteria foremost, reverseforemost, fastest, and shortest on temporal graphs with no waitingtime constraints. Their algorithms run in linear and quasilinear time with respect to the number of timearcs, provided that transmission times on timearcs are greater than zero. Concerning timedependent multicriteria optimal path computation, there has been research in the related field of route planning (Bast et al. 2016).
The study of minimum and maximumwaitingtime constraints in vertices has not received much attention in the context of temporal walks even though they are considered as important extensions to the temporal walk model (Holme and Saramäki 2012; Pan and Saramäki 2011). One of the first papers to consider waitingtime constraints in the context of paths is due to Dean (Dean 2004). Dean showed that timedependent shortest path problems with waiting constraints can be solved in polynomial time. Dean’s setting is closely related to waitingtime constraints for optimal temporal walks. In more recent work, Modiri et al. (2019) and Kivelä et al. (2018) studied the changes in reachability when introducing maximumwaiting time constraints for temporal walks using socalled event graphs. Lastly, Casteigts et al. (2019) have very recently shown that finding optimal temporal paths under maximumwaitingtime constraints is NPhard.
In the socalled multistage setting, where multiple graphs over the same vertex set are considered without a (temporal) ordering, paths have been studied by Fluschnik et al. (2020).
Our Contributions. We analyze the running time complexity of computing optimal temporal walks under waitingtime constraints. To this end, we develop and (theoretically and empirically) analyze an algorithm for finding an optimal walk from a source vertex to each vertex in the temporal graph under waitingtime constraints. Our algorithm runs in quasilinear time in the number of timearcs. This implies that the additional consideration of waitingtime constraints on temporal walks does not increase the asymptotic computational complexity of finding optimal temporal walks. Moreover, our algorithm can compute optimal walks not only for single optimality criteria but also for any linear combination of these. In experiments on realworld social network data sets, we demonstrate that in terms of efficiency our algorithm can compete with stateoftheart algorithms by Wu et al. (2016). Their algorithms only run on temporal graphs without waitingtime constraints, which do optimize only one criterion (and not a linear combination). Additionally, our algorithm allows transmission times being zero (hence, allowing to pass multiple arcs in one time step) while the algorithms of Wu et al. request transmission times on arcs to be greater than zero.
Organization of the Paper. In “Modeling of optimal temporal walks” section, we discuss temporal graphs, temporal walks, and the various corresponding optimality criteria, starting with an extensive motivating example in the context of disease spreading. In “Formal definitions” section, we introduce definitions and notations used throughout the paper. We continue in “Transformation” section by presenting two simple lineartime transformations to eliminate transmission times and minimum waiting times in the temporal graph without loosing any modeling power. In “Algorithm” section, we design and analyze an algorithm for computing optimal walks under maximumwaitingtime for any linear combination of these. Finally, in “Experimental results” section, we demonstrate the efficiency of our algorithm on realworld data sets. We compare our running times with the running times of the algorithms of Wu et al. (2016). We further examine the impact of different maximumwaitingtime values on the existence and structure of optimal temporal walks.
Modeling of optimal temporal walks
Before we introduce our basic concepts relating to temporal graphs and walks, we start with a more extensive discussion of a motivating example from the disease spreading context.
Disease Spreading Motivating Example. Pandemic spread of an infectious disease is a great threat to global health, potentially associated with high mortality rates as well as economic fallout (Salathé et al. 2010). Understanding the dynamics of infectious disease spreading within human proximity networks could facilitate the development of mitigation strategies.
A large part of the study required to understand the dynamics of infectious diseases is the analysis of transmission routes through proximity networks (Salathé et al. 2010). Classical graph theory can be used to model the main structure of a network: Each person in the network is represented by a node and an arc between two nodes indicates the possibility of an infection from one person to the other. However, the time component plays a crucial role in the analysis of transmission routes of a potential disease as shown in the following example:
Example 1
Studying a proximity network as shown in Fig. 2a, there are several transmission routes from A to D, e.g., A→B→D and A→C→D, by which a disease could have spread. If we extend our model by the points in time of proximity contacts in Fig. 2b to d, then we reach the conclusion that a disease could not have spread from A to D. The proximity contacts \(A\overset {3}{\rightarrow } B\) and \(A \overset {3}{\rightarrow } C\) occurred on day three whereas the contacts \(B \overset {1}{\rightarrow } D\) and \(C \overset {2}{\rightarrow } D\) occurred on days one and two, respectively. Thus, A could have only infected B and C after proximity contact with D. ■
In addition to what has been said so far, the infectious period of a disease also has to be taken into account when computing potential transmission routes through the network, implying the minimum time a person has to be infected before she becomes contagious herself and the maximum time a person can be infected before she is no longer contagious:
Example 2
If person B was infected by person A on day four (\(A \overset {4}{\rightarrow } B\)) and the infectious period of the disease starts after one day and ends after the fourth day, then person B could not have infected person C she met on day ten (\(B \overset {10}{\rightarrow } C\)). Hence, person C could not have been infected by the disease via the transmission route \(A \overset {4}{\rightarrow } B \overset {10}{\rightarrow }C\). ■
Temporal Graphs. These are capable of modeling both properties elaborated in the two examples above. Temporal graphs are already a frequently used model in the prediction and control of infectious diseases (Masuda and Holme 2013; Holme 2016). Temporal graphs—also referred to as temporal networks (Nicosia et al. 2013; Holme and Saramäki 2012), evolving graphs (Xuan et al. 2003), or timevarying graphs (Santoro et al. 2011; Casteigts et al. 2012)—are graphs where the arc set changes over time; thus, they can capture the dynamics within a proximity network.
In this paper, we will consider the following temporal graph model: A temporal graph consists of a set of vertices, a set of timearcs, and a lifetime. A timearc is a (directed) arc between two vertices that is associated with a time stamp at which the contact occurs and a transmission time that indicates the amount of time to traverse the arc. Furthermore, each vertex v is assigned an individual minimum waiting time α(v) and maximum waiting time β(v).
The application areas of temporal graphs are numerous: In addition to human and animal proximity networks, they are used in communication networks, traffic networks, and distributed computing, to name a few application areas (Holme and Saramäki 2012; Holme and Saramäki 2013; Holme and Saramäki 2019).
In our running disease spreading example, we are interested in transmission routes of an infectious disease. These transmission routes can revisit a person in the proximity network due to possible reinfection (Barabási 2016). Hence, the transmission routes can contain cycles which needs to be considered in the choice of concepts representing these routes.
Temporal Walks & Optimal Temporal Walks. Within the temporal graph model, temporal walks—also called journeys (Xuan et al. 2003; Nicosia et al. 2013)—are the fundamental concept that represents the transmission routes in our running example.
A temporal walk is a sequence of timearcs which connects a sequence of vertices and which are nondecreasing in time. In our model, a temporal walk additionally ensures that it remains the minimum waiting time in each intermediate vertex and does not exceed the maximum waiting time in any intermediate vertex of the walk.
Example 3
Continuing Example 2, a valid temporal walk (transmission route) from A to D could be the following: \(A \overset {4}{\rightarrow } B \overset {8}{\rightarrow } D\). Person A could have infected B on day four. Due to the infectious period of four days, B was still contagious on day eight when she had contact with person C. This does not hold on a route \(A \overset {4}{\rightarrow } B \overset {10}{\rightarrow } C\) as discussed in Example 2. If B was infected at time step 4, then she was not contagious anymore at time step 10. ■
A temporal path is a temporal walk where all vertices are pairwise distinct. Maximumwaitingtime constraints have significant impact on temporal walks. In a temporal graph with constraints on the maximum waiting time, one can be forced to make detours because the maximum waiting time in a vertex is exceeded. As a consequence, there can be two vertices A and C such that any temporal walk from A to C is not a path, as shown in Fig. 1.
Observation 1
Let \(\mathcal {G} = (V,E,T, \beta)\) be a temporal graph with maximumwaitingtime constraints. Then there can exist two vertices s,z∈V such that no szwalk is a temporal path.
We are interested in temporal walks within our proximity network in general, but wish to place emphasis on temporal walks that optimize certain properties. A plethora of criteria can be optimized as a consequence of the time aspect. Possible criteria (with the chosen names in brackets) include: arrival time (foremost), departure time (reverseforemost), duration (fastest), transmission time (shortest), number of timearcs (minimum hopcount), timearc cost (cheapest), probability (mostlikely), and waiting time (minimum waiting time). Next, we provide examples for all properties from their respective fields of application. Foremost. A foremost walk is a temporal walk that has the earliest arrival time. Computing a foremost walk from a source vertex to all vertices in the proximity network determines the speed with which an infectious disease could spread. ReverseForemost. A reverseforemost walk is a temporal walk that exhibits the latest possible departure time. Computing a reverseforemost walk from a source vertex to all vertices in the proximity network estimates the latest possible point in time at which an infectious disease could start spreading and still permeates the entire network. Fastest. A fastest walk is a temporal walk which exhibits the minimum travel duration, that is, the minimum difference between departure and arrival times. For an appropriate motivation, we leave proximity networks and consider the field of flight networks. Airports represent vertices, timearcs represent flights from one airport to another. The time stamp of a timearc indicates the departure time of a flight, the transmission time of the arc indicates the flight duration. The minimum waiting time in the vertices signifies the minimum time required to spend in an airport to catch a connecting flight. Within flight networks, the duration is often the criterion passengers aim to minimize in order to streamline their journeys. Shortest. A shortest walk is a temporal walk that minimizes the sum of transmission times on the timearcs. In the context of flight networks, a shortest walk is a flight connection with the minimum time spent airborne. Minimum HopCount. A minimumhopcount walk is a temporal walk which minimizes the number of timearcs. Within a flight network, passengers also aim to minimize their number of connecting flights to avoid lengthy boarding procedures and the risk of missing connecting flights. Cheapest. For a given cost function on the timearcs, a cheapest walk is a temporal walk with the minimum sum of costs over all timearcs. The benefits of the minimization of this property within flight networks are obvious: Weighing long travel times and multiple connections against the cheapest fare is the oldest consideration in the book for many air travelers. MostLikely. For given probabilities on the timearcs, a mostlikely walk is a temporal walk with the highest probability. One application lies in disease spreading: For every contact there is a certain likelihood for an infectious disease to be transmitted depending on the proximity of the persons or the body contact between them. Thus, a mostlikely walk is a transmission route with the highest probability for the infectious disease to be spread under the simplifying assumption of stochastic independence. The respective probabilities of the timearcs within the walk are multiplied. Minimum Waiting Time. The minimumwaitingtime walk is a temporal walk whose total sum of waiting times over all intermediate vertices is minimum. Routing packets through a router network prioritizes minimum waiting times of packages in the routers to improve the overall performance of the network.
Formal definitions
In this section, we formally introduce the most important concepts related to temporal graphs, temporal walks, and formalize our optimality criteria. We start with some basic mathematical definitions. We refer to an interval [a,b] as a contiguous ordered set of discrete time steps: [a,b]:={n∣n∈ℕ∧a≤n≤b}, where a,b∈ℕ. Further, [a]:=[1,a]. Given a function f:A→B, we write f≡c if f(a)=c for all a∈A and c∈B.
Temporal Graphs. A temporal graph is a graph whose arc set changes over time.
Definition 1
(Temporal Graph) A temporal graph \(\mathcal {G} = (V,E,T, \alpha, \beta)\) is a fivetuple consisting of

a lifetime T∈ℕ,

a vertex set V,

a timearc set E⊆V×V×{1,…,T}×{0,…,T},

a minimum waiting time α:V→{0,…,T}, and

a maximum waiting time β:V→{0,…,T}.
We remark that the central modeling aspect in our work—the minimum and maximum waiting times—is so far not commonly part of the definition of temporal graphs. A timearc (v,w,t,λ)∈E is a directed connection from v to w with time stamp t and transmission time λ, that is, a transmission from v to w starting at time step t and taking λ time steps to cross the arc. The departure time in vertex v is t; the arrival time in vertex w is then t+λ. The two waitingtime functions \(\alpha \colon V \rightarrow \mathbb{N}\) and \(\beta \colon V \rightarrow \mathbb{N}\) assign each vertex a minimum and maximum waiting time, respectively. The minimum waiting time α(v) is the minimum time a person has to stay in a vertex v before she can move on in the temporal graph. The maximum waiting time β(v) is the maximum time a person can stay in a vertex v before she is no longer allowed to move further in the graph. A temporal graph \(\mathcal {G} = (V,E,T, \alpha, \beta)\) is called instantaneous if α(v)=0 for all v∈V and λ=0 for all (v,w,t,λ)∈E. Then, for the ease of presentation, we neglect α and we write arcs as triples (v,w,t)∈E for instantaneous graphs.
In Table 1, we introduce some notation for temporal graphs.
Temporal Walk. A temporal walk is a walk in a temporal graph such that the time stamps of the visited timearcs of a temporal walk are nondecreasing in time. Additionally, the transmission time and the waitingtime constraints have to be taken into account.
Definition 2
(Temporal Walk) Given a temporal graph \(\mathcal {G} = (V,E,T, \alpha, \beta)\) and two vertices s,z∈V, a temporal walk of length k from s to z is a sequence \(\left (\left (v_{i1},v_{i},t_{i},\lambda _{i} \right)\right)_{i=1}^{k}\) of timearcs such that s=v_{0}, z=v_{k}, and t_{i}+λ_{i}+α(v_{i})≤t_{i+1}≤t_{i}+λ_{i}+β(v_{i}) for all i∈[k−1].
A temporal path is a temporal walk where all vertices are pairwise distinct. We use the notation \(P= \left (\left (v_{i1},v_{i},t_{i},\lambda _{i} \right)\right)_{i=1}^{k}\) for a temporal walk or a temporal path, that is, a sequence of k timearcs. The value of k is the length of P and for each i∈[k] the tuple (v_{i−1},v_{i},t_{i},λ_{i}) is a timearc from v_{i−1} to v_{i} starting in time step t_{i}. The value of λ_{i} is the time needed to traverse the timearc, that is, one arrives at time step t_{i}+λ_{i} at v_{i}.
Optimal Temporal Walk. Due to the time aspect, there are several, potentially contradicting criteria that can be optimized in a temporal walk. We formally define the criteria that were already motivated in “Modeling of optimal temporal walks” section.
Definition 3
(Optimal Temporal Walk) Let \(\mathcal {G} = (V,E,T, \alpha, \beta)\) be a temporal graph, let \(c\colon E \rightarrow \mathbb{N}\) be a cost function, and let s,z∈V be two vertices. A temporal walk \(P=\left (\left (v_{i1},v_{i},t_{i},\lambda _{i} \right)\right)_{i=1}^{k}\) from s to z is called optimal if it minimizes or maximizes a certain value among all temporal walks from s to z:
Note that the mostlikely criterion can easily be transformed into cheapest. For the mostlikely criterion, the cost values of the timearcs represent probabilities, implying c(e)∈[0,1] for all e∈E. Hence, maximizing \(\prod _{i=1}^{k} c((v_{i1},v_{i},t_{i},\lambda _{i}) \) is equivalent to minimizing
Hence, we neglect considering the mostlikely criterion separately. We further call a temporal walk \(P=\left (\left (v_{i1},v_{i},t_{i},\lambda _{i} \right)\right)_{i=1}^{k}\) from s to z an optimal temporal walk with respect to a linear combination with \(\delta _{1},\ldots,\delta _{7} \in \mathbb{Q}^{+}_{0}\) if it minimizes
among all temporal walks from s to z.
Transformation
To simplify the presentation of the forthcoming algorithm in “Algorithm” section for computing optimal temporal walks, we design it to run only on instantaneous temporal graphs, that is, temporal graphs with no transmission times (λ=0 for all (v,w,t,λ)∈E) and no minimumwaitingtime constraints (α(v)=0 for all v∈V). This is no restriction since we can eliminate these with the following transformation.
Transformation 1
(Remove α and λ.) Let \(\mathcal {G} = (V,E,T, \alpha, \beta)\) be a temporal graph and let \(c\colon E \rightarrow \mathbb{N}\) be a cost function. Transform \((\mathcal {G},c)\) into \((\mathcal {G}',c',c_{\lambda },\text {ind},A)\) where

\(\mathcal {G}'\) is an instantaneous temporal graph \(\mathcal {G}'=(V',E',T,\beta ')\) with

V^{′}=V∪V^{E} with V^{E}:={v_{e}∣e∈E},

E^{′}=E^{O}∪E^{I} with E^{O}:={(v,v_{e},t)∣e=(v,u,t,λ)∈E} and E^{I}={(v_{e},u,t+λ+α(u))∣e=(v,u,t,λ)∈E},

\(\beta ' \colon V' \rightarrow \mathbb{N}\) with β^{′}(v):=β(v) for all v∈V, else β^{′}(v):=T,


\(c' \colon E' \rightarrow \mathbb{N}\) is a cost function with \(c'(e) := c(\hat e)\) for all \(e=(v,v_{\hat e},t) \in E^{O} \), else c^{′}(e):=0,

\(c_{\lambda } \colon E' \rightarrow \mathbb{N}\) is a transmissioncost function with c_{λ}(e):=ℓ for \(e=(v_{\hat e},w,t + \ell + \alpha (w)) \in E^{I}\) and \(\hat e = (v,w,t,\ell) \in E\), else c_{λ}(e):=0,

ind:V^{′}→{0,1} is a vertexindex function with ind(v):=1 if v∈V, else ind(v):=0, and

A(v):V^{′}→{0,1} is an auxiliary function with A(v):=α(v) if v∈V, else A(v):=0.
We now show that any temporal graph can be transformed by Transformation 1 into an equivalent instantaneous temporal graph in linear time such that any optimal temporal walk in the instantaneous temporal graphs directly corresponds to an optimal temporal walk in the original graph and vice versa. To this end, we have to slightly adapt the formula for the linear combination as shown in the following proposition.
Proposition 1
Let \(\mathcal {G} = (V,E,T, \alpha, \beta)\) be a temporal graph, let \(c\colon E \rightarrow \mathbb{N}\) be a cost function, and let s,z∈V. Let further \((\mathcal {G}' = (V',E',T', \beta '),c',c_{\lambda },\text {ind},A)\) be the result of applying Transformation 1 to \((\mathcal {G},c)\).
For \(\delta _{1},\ldots,\delta _{7}\in \mathbb{Q}^{+}_{0}\), there exists a temporal walk \(P :=\left (\left (v_{i1},v_{i},t_{i},\lambda _{i} \right)\right)_{i=1}^{k} =\left (e_{i}\right)_{i=1}^{k}\) from s to z in \(\mathcal {G}\) which is optimal with respect to a linear combination of δ_{1},…,δ_{7} if and only if the temporal walk
from s to z in \(\mathcal {G}'\) is optimal with respect to the new formula for a linear combination of our optimality criteria defined as follows:
Transformation 1 runs in O(V+E) time.
Proof
We will show that any temporal walk P in G corresponds to a temporal walk P^{′} in G^{′} such that lin(P)=lin^{T}(P^{′}) and vice versa. To this end, observe that each vertex v∈V^{E} has an ingoing and an outgoing arc and the vertex set V=V^{′}∖V^{E} is an independent set in G^{′}. Hence, each temporal walk in G^{′} from s to z alternately uses vertices in V and V^{E}. Since each vertex in V^{E} represents an arc in G, each temporal walk in G^{′} has a unique representation in G and vice versa. It remains to show that lin(P)=lin^{T}(P^{′})−C for any temporal walk P in G where C is a constant only depending on the last vertex in P. Observe that by construction each vertex v_{i} in P is the same vertex as \(v^{\prime }_{2i}\) in P^{′} and the arc (v_{i−1},v_{i},t_{i},λ_{i}) is represented by the vertex \(v^{\prime }_{2i}\) and the arcs \(e^{\prime }_{2i1}\) and \(e^{\prime }_{2i}\). It holds that λ_{i}=c_{λ}(e2i′)=c_{λ}(e2i−1′)+c_{λ}(e2i′) and c(e_{i})=c^{′}(e2i′)=c^{′}(e2i−1′)+c^{′}(e2i′). Finally, t_{i+1}=t2i+1′ and t_{i}+λ_{i}=t2i′−A(v2i′) (recall A(v)=α(v) if v∈V and A(v)=0 otherwise) and hence t_{i+1}−(t_{i}+λ_{i})=t2i+1′−(t2i′−A(v2i′)). Thus,
Observe that (δ_{1}+δ_{3})·A(v2k′) is independent of the temporal walk P^{′} and hence any optimal walk P in G corresponds to an optimal temporal walk P^{′} in G^{′}. Lastly, notice that Transformation 1 runs in O(V+E) time. □
The algorithm for computing optimal temporal walks that we will introduce in the forthcoming section will find temporal walks optimizing the formula lin^{T}(·) introduced in Proposition 1. For instantaneous temporal graphs, where we do not have to use Transformation 1, optimizing according to lin^{T}(·) is not a drawback as stated in the following (recall that the definitions of lin and lin^{T} depend on the parameters δ_{1},…,δ_{7}):
Observation 2
Let \(\mathcal {G} = (V,E,T, \beta)\) be an instantaneous temporal graph and let \(c\colon E \rightarrow \mathbb{N}\)be a cost function. Let further \(P:=\left (\left (v_{i1},v_{i},t_{i},\lambda _{i} \right)\right)_{i=1}^{k}=\left (e_{i}\right)_{i=1}^{k}\) be a temporal walk in \(\mathcal {G}\). For \(\delta _{1},\ldots,\delta _{7}\in \mathbb{Q}^{+}_{0}\), it holds that
for c^{′}=c, c_{λ}≡0, ind≡1, and A≡0.
Algorithm
In this section, we present a singlesource optimalwalks algorithm with respect to any linear combination of our optimality criteria. That is, given a temporal graph \(\mathcal {G} = (V,E,T, \beta)\), a cost function \(c \colon E \rightarrow \mathbb{N}\), and a source vertex s∈V, we compute optimal temporal walks with respect to any linear combination with δ_{1},…,δ_{7}∈ℚ from s to all vertices in the temporal graph (if they exist). To this end, we first apply Transformation 1 to \(\mathcal {G}\) to obtain an instantaneous temporal graph. Algorithm 1 then performs for each t∈[T] three main steps: GraphGeneration. Generate graph G which only contains the arcs present at time step t and add arcs from s to each vertex v in G that has been reached within the last β(v) time steps. ModDijkstra. Run a modified version of Dijkstra’s algorithm to compute for each v in G the optimal walk from s to v that arrives at time step t (if it exists). Update. Update a list storing information on optimal walks from s to each v∈V. More precisely, for each v∈V a list of tuples of arrival times and corresponding optimal values is updated.
Efficiently storing and accessing the value of an optimal walk from s to v that arrives at a certain time step t is the heart of the algorithm. We can maintain this information in O(E) time during a run of Algorithm 1 such that this information can be accessed in constant time, leading to the following theorem:
Theorem 1
With respect to any linear combination of the optimality criteria, optimal temporal walks from a source vertex s to each vertex in a temporal graph \(\mathcal {G} = (V,E,T, \beta)\) can be computed in O(V+E logE) time.
Algorithm Details. Let \(\mathcal {G}'\) be a temporal graph with a cost function \(c'\colon E \rightarrow \mathbb{N}\) and let s∈V be the source. We can apply Transformation 1 to \((\mathcal {G}',c')\) to obtain \((\mathcal {G} = (V,E,T, \beta),c,c_{\lambda },\text {ind},A)\) where \(\mathcal {G}\) is an instantaneous temporal graph. If \(\mathcal {G}'\) is already an instantaneous temporal graph, then we set c=c^{′}, c_{λ}≡0, ind≡1, and A≡0 as justified by Observation 2.
For given δ_{1},…,δ_{7}∈ℚ, Algorithm 1 for all v∈V now computes an optimal walk \(P=\left (\left (v_{i1},v_{i},t_{i}\right)\right)_{i=1}^{k}=\left (e_{i}\right)_{i=1}^{k}\) from s to v with respect to
We have shown in Proposition 1 that an optimal walk with respect to lin^{T}(P) in \(\mathcal {G}\) directly corresponds to an optimal walk with respect to lin(P) in the original temporal graph \(\mathcal {G}'\).
For each vertex v∈V∖{s}, Algorithm 1 stores in opt(v) the value of an optimal walk from s to v and in L(v) a list of all relevant arrival times from s to v with their optimal values. In the beginning, opt(v)=∞ and L(v) is an empty list (Line 1 in Algorithm 1). Then, for each time step t and each v∈V, Algorithm 1 computes the optimal walk from the source s to v that arrives in time step t (if it exists). Thus, Algorithm 1 performs for each t∈{1,…,T} the following steps: GraphGeneration. Generate a static graph G with GenerateGraph (Line 3 and Lines 9 to 19). This graph consists of the static graph G_{t}=(V_{t},E_{t}), that is, the static graph induced by all timearcs with time stamp t, and the source vertex s.
The weight of an arc (v,w)∈E_{t} is set to δ_{4}·c_{λ}(v,w)+δ_{5}·c(v,w)+δ_{6}. If further v=s, then we have to add (δ_{2}+δ_{3})·(T−t) to take the departure time in s into account for the criteria reverseforemost and fastest, see Line 12.
Additionally, nonexisting arcs from s to each vertex v∈V_{t} are added if there exists a temporal walk from s to v that arrived not later than β(v) time steps ago. Let opt_{a} be the optimal value among all walks that arrive within the time interval [t−β(v),t] and let a be the corresponding arrival time in v. Additionally, the minimum waiting time A(v) plus the additional waiting time (t−a) in v has to be taken into account if ind(v)=1. Hence, the weight of arc (s,v) is set to opt_{a}+δ_{7}·ind(v)·(t−a+A(v)), see Line 18. Let E_{r} be the set of these additional arcs. Then, G=(V_{t}∪{s},E_{t}∪E_{r},d_{t},d_{r}). ModDijkstra. Run a modified Dijkstra Algorithm on G with modDijkstra (Line 4 and Lines 20 to 31). Instead of computing a shortest walk (using the original Dijkstra Algorithm) in G, compute a shortest walk among all walks that end in an arc of E_{t}. This represents a temporal walk that arrives in time step t with optimal value. The function modDijkstra returns the set V^{′} of vertices that can be reached within G via an arc in E_{t} and the function \(\text {opt}_{t} \colon V' \rightarrow \mathbb{N}\) that maps each vertex v∈V^{′} to its optimal value of a walk from s to v arriving exactly at time t. Update. For each v∈V^{′}, set the optimum opt(v) to the minimum of its current value and the optimal value of a newly computed walk, that is, opt(v):= min{opt(v),δ_{1}·t+δ_{3}·(t−T)+opt_{t}(v)} (Line 6). Herein, we have to add the arrival time t that has not been taken into account in the calculation of the optimal value because it is the same for all walks found at time step t. Add the tuple (opt_{t}(v),t) to list L(v) (Line 7).
After the Update step for time step t, the list L(v) contains all tuples (opt_{ar},ar) such that there exists a walk from s to v that arrives at time ar∈[t−β(v),t] with its optimal cost value opt_{ar}. We want to have constanttime access to the optimal value of a walk that arrives in v within time interval [t−β(v),t]. This can be achieved by deleting tuples from list L(v) that are redundant, that is these tuples are not meaningful for the correct computation of optimal walks. Let
be such a list for a time step t with t−β(v)≤a_{1}<…<a_{k}≤t. A tuple (opt_{ar},ar) is redundant if there exists a tuple with an arrival time greater than ar such that its optimal value is smaller than opt_{ar} plus the additional waiting time. This is shown with the following lemma:
Lemma 1
For a time step t∈{1,…,T} and a vertex v∈V, if there are two tuples \((\text {opt}_{a_{i}},a_{i}),(\text {opt}_{a_{j}},a_{j}) \in L(v)\) with a_{i}<a_{j} and
then \((\text {opt}_{a_{i}},a_{i})\) is redundant and can be removed from L(v).
Proof
After all timearcs with time stamp t have been processed, Algorithm 1 only considers timearcs with time stamp t^{′}>t. In the generated graph G (Line 3), the algorithm adds an arc from s to \(\phantom {\dot {i}\!}v\in V_{t^{\prime }}\) if a walk from s arrives in v within [t^{′}−β(v),t^{′}]. If a_{i}∈[t^{′}−β(v),t^{′}], then a_{j}∈[t^{′}−β(v),t^{′}] because a_{i}<a_{j}<t^{′}. Furthermore, let (opt,a) be the optimal value and the arrival time of a walk from s to v that arrives within time interval [t^{′}−β(v),t^{′}] that minimizes
Then, the weight of the arc (s,v) is set to this value. Since a_{i}<a_{j}∈[t^{′}−β(v),t^{′}] and \(\text {opt}_{a_{i}} + \delta _{7} \cdot \text {ind}(v) \cdot (a_{j}a_{i}) \geq \text {opt}_{a_{j}}\), we know that
Hence, the tuple \((\text {opt}_{a_{i}},{a_{i}})\) is not needed in the list L(v) at time step t and can be removed. □
If L(v) does not contain any redundant tuples, then it also holds that
Hence, \(\phantom {\dot {i}\!}(a_{1}, \text {opt}_{a_{1}})\) contains the optimal value and arrival time of a walk that arrives within time interval [t−β(v),t] and minimizes opt+δ_{7}·ind(v)(t^{′}−a+A(v)). It follows that finding opt= min{opt_{a}∣(opt_{a},a)∈L(v)} in Line 18 takes constant time. The deletion of redundant tuples takes O(E) time during the whole run of Algorithm 1. With these considerations at hand, we can derive the following lemma.
Lemma 2
Algorithm 1 runs in O(V+E logE) time.
Proof
The initialization in Algorithm 1 can be done in O(V) time. Furthermore, the timearcs have to be sorted by time stamps which takes O(E logE) time. Then, for each time step t∈[T], Algorithm 1 generates in O(E_{t}+V_{t}) time a static directed graph G=(V_{t}∪{s},E_{t}∪E_{r}) with O(V_{t}) vertices and O(E_{t}+V_{t}) arcs.
For each generated graph G, modDijkstra is executed in O(E_{t} logE_{t}) time. The updates of opt and L afterwards run in O(V_{t}) time. Note that V_{t} is the number of vertices that have at least one ingoing or outgoing timearc at time step t. Consequently, it holds that V_{t}≤2E_{t}.
Due to the sorting of L(v), maintaining these lists in Lines 15 and 7 takes O(E) time during the whole run of the algorithm as shown Lemma 1. In the list L(v), we delete at most as many elements as there are timearcs in the temporal graph. Recall that if (opt_{a},a)∈L(v), then there exists a timearc (w,v,a)∈E.
We can analyze the running time by
Hence, Algorithm 1 runs in O(V+E logE) time. □
Next, we show the correctness of Algorithm 1. We prove that for every time step t and for every vertex v, Algorithm 1 computes an optimal walk from s to v that arrives at time step t (if it exists).
Lemma 3
For a time step t∈[T] and a vertex v∈V, Algorithm 1 computes the optimal value of a temporal walk from s to v that arrives exactly in time step t.
Proof
The proof is by induction on the time step t∈{1,…,T}.
In the beginning, L(v) is empty. For t=1, the algorithm generates a graph G=(V_{1}∪{s},E_{1}). For all arcs (s,w)∈E_{1}, the weights are set to
for the other arcs (v,w)∈E_{1} the weights are set to
Note that if there is an optimal temporal walk arriving in time step 1, then there also exists an optimal temporal walk arriving at time step 1. Now if there is an optimal walk \(P=\left (\left (v_{i1},v_{i},1\right)\right)^{k}_{i=1}=\left (e_{i}\right)^{k}_{i=1}\) from s to a vertex v∈V that arrives exactly in time step 1, then there exists a path \(P'=\left (\left (v_{i1},v_{i}\right)\right)^{k}_{i=1}=\left (a_{i}\right)^{k}_{i=1}\) from s to v in G with value
Algorithm 1 finds in modDijkstra the path P^{′}, adds (opt_{1}(v),1) to L(v) and sets
Note that A(v_{i})=0 for i∈[k−1] by Transformation 1 in time step 1. If there exists an optimal path P^{∗} in G, then this directly translates to the existence of a temporal path P^{′} that arrives also in time step 1 with a smaller optimal value than P, contradicting the assumption that P is optimal.
Now, let us assume that for all time steps t^{′}∈{1,…,t} Algorithm 1 computed the optimal value opt of a walk from s to v∈V that arrives exactly in time step t^{′} and added (opt−δ_{1}·t^{′}+δ_{2}·T−δ_{3}·(t^{′}−T),t^{′}) to L(v). If for time step t+1 a vertex v∈V has no ingoing timearc with time step t+1, then there cannot exist a temporal walk from s to v that arrives exactly in time step t+1. Thus, only vertices in V_{t+1} are candidates for a temporal walk that arrives exactly in time step t+1.
Let v∈V_{t+1} be a vertex such that there is a temporal walk from s to v that arrives exactly in time step t+1. Let \(P=\left (\left (v_{i1},v_{i},1\right)\right)^{k}_{i=1}=\left (e_{i}\right)^{k}_{i=1}\) be an optimal walk from s to v that arrives exactly in time step t+1 with the optimal value
Assume towards a contradiction that Algorithm 1 does not find a walk from s to v with optimal value lin^{T}(P).
First consider the case that t_{i}=t+1 for all i∈[k], that is, all timearcs of the temporal walk P have time stamp t+1. Then, we can assume that P is a temporal path. Hence there exists a path \(P'=\left (\left (v_{i1},v_{i}\right)\right)^{k}_{i=1}=\left (a_{i}\right)^{k}_{i=1}\) from s to v in G_{t+1} and therefore in G with optimal value
Algorithm 1 finds in modDijkstra the path P^{′}, adds (opt_{t+1}(v),t+1) to L(v), and updates opt(v) to the minimum of opt(v) and
Note again that A(v_{i})=0 for i∈[k−1] if t_{i−1}=t_{i} by Transformation 1. Hence, we find a walk from s to v at time step t+1 with optimal value lin^{T}(P), contradicting our assumption.
Now assume for P that there exists an ℓ∈{1,…,k−1} such that for j∈[ℓ] it holds that t_{j}<t+1 and for j^{′}∈{i+1,…,k} it holds that \(\phantom {\dot {i}\!}t_{j^{\prime }} = t+1\). The temporal walk \(P_{\ell }= \left (\left (v_{i1},v_{i},t_{i}\right)\right)^{\ell }_{i=1}=\left (e_{i}\right)^{k}_{i=1}\) is an optimal subwalk from s to v_{ℓ} that arrives exactly in time step t_{ℓ}, otherwise P is not optimal because it could be improved by replacing P_{ℓ}. The subwalk P_{ℓ} has an optimal value
Then
By our induction hypothesis, the tuple \((\text {opt}_{t_{\ell }}(v_{\ell }),t_{\ell })\) was added to L(v_{ℓ}). If the tuple \((\text {opt}_{t_{\ell }}(v_{\ell }),t_{\ell })\) is not in L(v_{ℓ}) in time step t+1, then due to Lemma 1 there must be another tuple \((\text {opt}_{\hat t}(v_{\ell }),\hat t)\) in L(v_{ℓ}) with \(t_{\ell } < \hat t < t+1 < t_{\ell } + \beta (v_{\ell }) \leq \hat t + \beta (v_{\ell })\) and
Otherwise P is not optimal because it could be improved by replacing P_{ℓ} by the temporal walk represented by \((\text {opt}_{\hat t}(v_{\ell }),\hat t)\).
Now consider the generated graph G=(V_{t+1}∪{s},E_{t+1}∪E_{r}). The arc sequence \(P_{t+1}=\left (\left (v_{i1},v_{i}\right)\right)^{k}_{i=\ell +1}=\left (a_{i}\right)^{k}_{i=\ell +1}\) is a path in G_{t+1}=(V_{t+1},E_{t+1}) and, thus, contained in G. The arc a_{ℓ}=(s,v_{ℓ}) is contained in E_{r} with weight
Thus, there is a walk from s to v in G and modDijkstra on G returns the vertex v because a_{k}∈E_{t+1} with the optimal value
Note that by Transformation 1A(v_{i})=0 for i∈[ℓ+1,k−1] if t_{i−1}=t_{i}. Consequently, the tuple (opt_{t+1}(v),t+1) is added to L(v) and opt(v) is set to the minimum of its current value and
This is a contradiction to our assumption.
Lastly, observe that the algorithm only computes temporal walks that are contained in G as it only uses arcs from G_{t} which all correspond to temporal walks in G (single arcs or longer walks starting in s). Thus, for t∈{1,…,T}, Algorithm 1 computes an optimal temporal walk from s to v∈V that arrives exactly in time step t. □
Based on this statement, we can finally prove the correctness of Algorithm 1. This concludes the proof of Theorem 1.
Lemma 4
Algorithm 1 computes optimal walks from a given source vertex s to all vertices.
Proof
Let \(P=\left (\left (v_{i1},v_{i},1\right)\right)^{k}_{i=1}=\left (e_{i}\right)^{k}_{i=1}\) be a walk with minimum lin^{T}(P) among all temporal walks from s to a vertex v. The walk P is also an optimal walk from s to v that arrives exactly in time step t_{k}. This is computed by Algorithm 1 in time step t_{k} as shown in Lemma 3. □
Experimental results
We implemented Algorithm 1 and performed experimental studies including comparisons to existing stateoftheart algorithms by Wu et al. (2016). Note that the algorithms by Wu et al. (and our algorithm as well) are Dijkstralike algorithms adjusted to the specific temporal setting. A notable difference is that our algorithm stops the graph exploration if no more vertex can be visited, whereas the algorithms by Wu et al. (2016) always iterate over all timearcs. We show that our algorithm—while being able to solve a more general problem—can compete with these algorithms on realworld instances for the special case of computing temporal walks with no maximumwaitingtime constraints. We further examine the influence of different maximumwaitingtime values on the existence and structure (e.g., the number of cycles) of optimal temporal walks and on the running time of Algorithm 1.
Setup and statics
We implemented Algorithm 1 in C++ (v11) and performed our experiments on an Intel Xeon E51620 c omputer with 64 GB of RAM and four cores clocked at 3.6 GHz each. The operating system was Debian GNU/Linux 7.0 where we compiled the program with GCC v7.3.0 on optimization level O3. We compare Algorithm 1 to the algorithms of Wu et al. (2016) using their C++ code and testing it on the same hardware and with the same compiler. We tested our algorithm on the same freely available data sets as Wu et al. (2016) from the wellestablished KONECT library (KONECT 2017). The graphs are listed in Table 2 with some relevant statistics.
For each optimization criterion, each β≡c,c∈{1,2,4,8,…,2^{⌈logT⌉}}, and each data set, Algorithm 1 ran for 100 fixed source vertices of the data set chosen independently and uniformly at random. Our open source code is freely available at https://fpt.akt.tuberlin.de/temporalwalks.
Findings
In the following, we first compare Algorithm 1 to the algorithm by Wu et al. (2016) in terms of running times in our experiments. In the second part, we analyze the effects of different maximumwaitingtime values β on Algorithm 1.
Comparison
When comparing with the algorithms by Wu et al. (2016), we only use the runs with no maximumwaitingtime constraints (β≡T) and we tested all algorithms on the same set of randomly chosen starting vertices. In the experiments, we could only measure a very small effect of the optimization criteria on the running time. This even holds for linear combinations. The only exception was the computation of foremost which was a bit faster in comparison to the computation of the other criteria. For this reason we only include two examples here. We chose foremost and shortest as these are the two criteria where Algorithm 1 performed the best and the worst compared to the algorithms by Wu et al. (2016), respectively. The respective findings are illustrated in the box plots in Fig. 3.
As one can observe in Fig. 3, Algorithm 1 has a larger variance and, therefore, is more dependent on the choice of starting vertices. The reason is that even for β≡T, that is, no maximum waiting time constraints, not all vertices can reach all other vertices by temporal walks in the considered graphs: Algorithm 1 only considers arcs that start in vertices that were already visited and, hence, if many verices are not reached then the algorithm stops. In contrast, the algorithm by Wu et al. (2016) always considers the whole sorted timearc list and, therefore, has almost no variance in the running time.
The high variance is also the reason why our algorithm has a higher average running time but a comparable median running time: On average, the algorithm by Wu et al. (2016) is 16.4 times faster for computing the foremost walk and 7.6 times slower for shortest walks. Considering the median running times, however, our algorithm is 5.8 times faster for the foremost walk but the algorithm by Wu et al. (2016) is 1.2 times faster for shortest walks. The higher average running time is a clear weakness of our algorithm. We believe, however, that the algorithm is still a valuable contribution as it solves more general problems: it can easily combine multiple optimization criteria and it can cope with maximum waiting times and instantaneous arcs, that is, arcs with λ=0.
When looking at the time to read the data we can observe that our algorithm takes roughly twice to thrice the time for preprocessing compared to the algorithms by Wu et al. This is due to the fact that for each arc in the input graph Transformation 1 constructs a new vertex and a new arc and so the resulting graph is almost thrice the size. The time to read in the data is much larger than the time of the actual algorithm and so Algorithm 1 takes roughly thrice the time of the algorithms by Wu et al. (2016) if preprocessing is taken into account.
Finally, we compared the running time of Algorithm 1 with a single optimization criterion against the same algorithm with a linear combination of all criteria considered. Figure 4 displays the average and median running time for β≡T on all considered data sets.
As expected, the linear combination of optimization criteria does not change the running time compared to a single criterion.
Effect of different maximum waitingtime values β
We next analyze the impact that the maximumwaitingtime constraint β has on Algorithm 1. Decreasing β can have two different effects: First, it can make temporal walks invalid as the maximum allowed waiting time in a vertex is exceeded. Thus, with small βvalues certain vertices can only reach few vertices by temporal walks. The second effect is that a temporal walk is invalidated but can be fixed by a detour that starts and ends in the vertex in which the maximal waiting time was exceeded.
We first investigate the second effect. To this end, we partition the optimization criteria into two categories: The first category contains all optimization criteria for which a detour has no negative effect on the solution. These are foremost, reverseforemost, fastest, and minimum waiting time. Since the solution for, e. g., fastest is only depending on the first and last timearc of the temporal walk, adding a cycle somewhere in between does not change the solution. Minimum waiting time plays a special role here as this value can decrease when adding intermediate cycles. The second category contains all other optimization criteria, that is, those for which a detour has a negative effect on the solution. These are minimum hop count, cheapest, and shortest. Since we could not measure significant differences for the different optimization criteria within a category, we only display one figure for each category in Fig. 5.^{Footnote 2}
We remark that in the first category we implemented the algorithm such that irrelevant cycles (cycles which do not change the optimality value) are kept in the solution. Hence Fig. 5 (top left plot) displays values close to the upper bound on the number of cycles in an optimal solution.
Figure 5 (two bottom plots) show that the different categories behave very similarly when it comes to the runningtime dependence on the value of β. It seems to be more likely that the first effect we described in the beginning of this subsection (that decreasing βvalues can make temporal walks invalid as the maximum allowed waiting time in a vertex is exceeded) is more important for explaining the running times. With very small βvalues, a vertex can only reach few other vertices and hence only few timearcs are considered by Algorithm 1. With increasing βvalues, there seems to be a critical value (around 0.1%−10% of the lifetime of the temporal graph) where suddenly much more connections appear and hence the running time increases drastically. This observation is affirmed by Fig. 6, which shows that (almost) independently of the input graph, the running time is linearly depending on the number of vertices that are visited.
We believe that the difference for small βvalues comes from the initialization which is again more depending on the input graph compared to the algorithms by Wu et al. This would explain, why our algorithms have a higher running time variance.
Conclusion
Building on and widening previous work of Wu et al. (2016), we provided a theoretical and experimental study of computing optimal temporal walks under waitingtime constraints. The performed experiments indicate the practical relevance of our approach. As to future challenges, recall that moving from walks to paths would yield NPhard optimization problems (Casteigts et al. 2015). Hence, for the path scenario the study of approximation, fixedparameter, or heuristic algorithms is a natural next step. For the scenario considered in this work, note that we did not study the natural extension to Paretooptimal walks (under several optimization criteria). Moreover, for (temporal) network centrality measures based on shortest paths and walks, counting or even listing all optimal temporal walks or paths would be of interest. First results in this direction indicate that for several optimization criteria counting temporal paths is computationally hard even without waiting time constraints; in contrast, counting temporal walks seems easier (Rad et al. 2017; Buß et al. 2020).
Availability of data and materials
The data sets used and analyzed during the current study are available in the KONECT library, http://konect.cc/networks/(KONECT 2017). The open source code of the algorithm is freely available at https://fpt.akt.tuberlin.de/temporalwalks.
Notes
 1.
Waitingtime constraints play a particularly important role in standard spreading models of infectious diseases such as the SISmodel (SusceptibleInfectedSusceptible) (Newman 2018, Chapter 17).
 2.
We omitted the data sets facebookwosnlinks, flickrgrowth, cacitHepPh, and youtubeugrowth in Fig. 5 to keep the figure clear. There is no information gain in displaying these data sets.
References
Ahuja, RK, Magnanti TL, Orlin JB (1993) Network Flows: Theory, Algorithms, and Applications. Prentice Hall, Upper Saddle River.
Axiotis, K, Fotakis D (2016) On the size and the approximability of minimum temporally connected subgraphs In: Proceedings of the 43rd International Colloquium on Automata, Languages, and Programming (ICALP ’16), 149–114914.. Schloss Dagstuhl–LeibnizZentrum fuer Informatik, Saarbrücken.
Barabási, AL (2016) Network Science. Cambridge University Press, Cambridge.
Bast, H, Delling D, Goldberg A, MüllerHannemann M, Pajor T, Sanders P, Wagner D, Werneck RF (2016) Route planning in transportation networks In: Algorithm Engineering  Selected Results and Surveys. Lecture Notes in Computer Science, 19–80.. Springer.
Buß, S, Molter H, Niedermeier R, Rymar M (2020) Algorithmic aspects of temporal betweenness In: Proceedings of the 26th SIGKDD Conference on Knowledge Discovery and Data Mining (KDD ’20), 2084–2092.. ACM.
Casteigts, A, Flocchini P, Godard E, Santoro N, Yamashita M (2015) On the expressivity of timevarying graphs. Theor Comput Sci 590:27–37.
Casteigts, A, Flocchini P, Quattrociocchi W, Santoro N (2012) Timevarying graphs and dynamic networks. Int J Parallel Emergent Distrib Syst 27(5):387–408.
Casteigts, A, Himmel AS, Molter H, Zschoche P (2019) The computational complexity of finding temporal paths under waiting time constraints. arXiv preprint arXiv:1909.06437. To appear at ISAAC ’20.
Dean, BC (2004) Algorithms for minimumcost paths in timedependent networks with waiting policies. Networks 44:41–46.
Fluschnik, T, Molter H, Niedermeier R, Renken M, Zschoche P (2020) Temporal graph classes: A view through temporal separators. Theor Comput Sci 806:197–218.
Fluschnik, T, Niedermeier R, Schubert C, Zschoche P (2020) Multistage st path: Confronting similarity with dissimilarity. arXiv preprint arXiv:2002.07569. To appear at ISAAC ’20.
Himmel, A, Bentert M, Nichterlein A, Niedermeier R (2019) Efficient computation of optimal temporal walks under waitingtime constraints In: Proceedings of the 8th International Conference on Complex Networks and Their Applications (COMPLEX NETWORKS ’19). Studies in Computational Intelligence, 494–506.. Springer, New York.
Holme, P (2015) Modern temporal network theory: a colloquium. Eur Phys J B 88(9):234.
Holme, P (2016) Temporal network structures controlling disease spreading. Phys Rev E 94(2):022305.
Holme, P, Saramäki J (2012) Temporal networks. Physics Reports 519(3):97–125.
Holme, P, Saramäki J (2013) Temporal networks as a modeling framework. In: Holme P Saramäki J (eds)Temporal Networks, 1–14.. Springer, New York.
Holme, P, Saramäki J (2019) Temporal Network Theory. Springer, New York.
Kempe, D, Kleinberg J, Kumar A (2002) Connectivity and inference problems for temporal networks. J Comput Syst Sci 64(4):820–842.
Kim, H, Anderson R (2012) Temporal node centrality in complex networks. Phys Rev E 85(2):026107.
Kivelä, M, Cambe J, Saramäki J, Karsai M (2018) Mapping temporalnetwork percolation to weighted, static event graphs. Sci Rep 8(1):12357.
KONECT (2017) DNC emails network dataset. Inst Web Sci Technol. http://konect.unikoblenz.de/networks/dnctemporalGraph. Accessed 2017.
Lightenberg, W, Pei Y, Fletcher G, Pechenizkiy M (2018) Tink: A temporal graph analytics library for Apache Flink In: Proc. of WWW ’18, 71–72.. ACM, New York.
Masuda, N, Holme P (2013) Predicting and controlling infectious disease epidemics using temporal networks. F1000prime Rep 5.
Mertzios, GB, Michail O, Spirakis PG (2019) Temporal network optimization subject to connectivity constraints. Algorithmica 81(4):1416–1449.
Modiri, AB, Karsai M, Kivelä M (2019) Efficient limited time reachability estimation in temporal networks. arXiv preprint arXiv:1908.11831.
Newman, MEJ (2018) Networks. Oxford University Press, Oxford.
Nicosia, V, Tang J, Mascolo C, Musolesi M, Russo G, Latora V (2013) Graph metrics for temporal networks In: Temporal Networks, 15–40.. Springer, New York.
Nicosia, V, Tang J, Musolesi M, Russo G, Mascolo C, Latora V (2012) Components in timevarying graphs. Chaos Interdisc J Nonlinear Sci 22(2):023101.
Pan, RK, Saramäki J (2011) Path lengths, correlations, and centrality in temporal networks. Phys Rev E 84(1):016105.
Rad, AA, Flocchini P, Gaudet J (2017) Computation and analysis of temporal betweenness in a knowledge mobilization network. Comput Soc Netw 4(1):5.
Salathé, M, Kazandjieva M, Lee JW, Levis P, Feldman MW, Jones JH (2010) A highresolution human contact network for infectious disease transmission. Proc Natl Acad Sci 107(51):22020–22025.
Santoro, N, Quattrociocchi W, Flocchini P, Casteigts A, Amblard F2011. Timevarying graphs and social network analysis: Temporal indicators and metrics.
Wu, H, Cheng J, Ke Y, Huang S, Huang Y, Wu H (2016) Efficient algorithms for temporal path computation. IEEE Trans Knowl Data Eng 28(11):2927–2942.
Xuan, BB, Ferreira A, Jarry A (2003) Computing shortest, fastest, and foremost journeys in dynamic networks. Int J Found Comput Sci 14(02):267–285.
Zschoche, P, Fluschnik T, Molter H, Niedermeier R (2020) The complexity of finding small separators in temporal graphs. J Comput Syst Sci 107:72–92.
Acknowledgements
We thank Lilian Jacobs (TU Berlin) for her programming work helping to enable our experimental studies and the anonymous reviewers of COMPLEX NETWORKS 2019 and Applied Network Science for their constructive feedback.
Funding
ASH was supported by the DFG, project FPTinP (NI 369/16). Open access funding provided by Projekt DEAL.
Author information
Affiliations
Contributions
Parts of this work originated from the master thesis of ASH. Overall, all authors have contributed equally to the paper. All authors read and approved the final manuscript.
Corresponding author
Ethics declarations
Competing interests
The authors declare that they have no competing interests.
Additional information
Publisher’s Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
AnneSophie Himmel is supported by the DFG, project FPTinP (NI~369/16).
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Bentert, M., Himmel, AS., Nichterlein, A. et al. Efficient computation of optimal temporal walks under waitingtime constraints. Appl Netw Sci 5, 73 (2020). https://doi.org/10.1007/s41109020003110
Received:
Accepted:
Published:
Keywords
 Temporal networks
 Temporal paths
 Shortest path computation
 Waiting policies
 Infectious disease spreading