TemporalGraphs.jl
Fast temporal graph analysis Julia
Paths, centralities, components, flows, motifs, null models and generators for networks whose edges appear over time: messages between users, contacts between people, flights between airports, trades between accounts.
A temporal graph is a graph whose edges carry times. In TemporalGraphs.jl the nodes 1:n are fixed, and every temporal edge (u, v, t, tt) leaves u at time t and reaches v at time t + tt. Temporal paths must follow time direction, and this changes a lot with respect to static graphs: reachability is no longer transitive, connected components can overlap, and several problems become NP-hard.
Features
Earliest arrival, latest departure, fastest, minimum transition time and minimum hop paths, in time windows and with waiting constraints.
Closeness (exact, top-k and sampled), betweenness of walks and paths, Katz, PageRank and walk centrality.
Reachability, temporal components and their variants, dissemination times, seed selection and static expansions.
Temporal flows and cuts, disjoint paths, separators, spanning trees and spanners.
Counts of δ-temporal motifs and randomized reference models of temporal networks.
Random temporal graphs and classic constructions; parameters such as the temporality and the interval-membership widths.
SNAP and SocioPatterns networks on demand, MLDatasets.jl and GraphNeuralNetworks.jl.
Time-respecting path isomorphism, the Weisfeiler–Leman test and kernels for temporal graph classification.
All of this runs on several graph representations, with allocation-free kernels and multithreading: see the Performance tips.
The code of TemporalGraphs.jl was written by Claude Opus 5.5, with the help of a human.
Installation
TemporalGraphs.jl requires Julia 1.10 or later. It is not registered yet, so install it from GitHub:
using Pkg
Pkg.add(url="https://github.com/aurorarossi/TemporalGraphs.jl")Quick example
The temporal graph below has 4 nodes and 7 edges, departing at the times 1 to 8. The first picture labels every arrow with its (t, tt); the second one draws a timeline for every node, and every edge goes from the timeline of u at time t to the timeline of v at time t + tt:
julia> using TemporalGraphs
julia> g = OrderedEdgeList(4, [(1, 4, 1, 5), (1, 2, 2, 1), (1, 2, 5, 2), (3, 2, 6, 1),
(4, 3, 6, 2), (2, 4, 7, 2), (4, 3, 8, 1)])
OrderedEdgeList{Int32, Int64} with 4 nodes, 7 temporal edges, time interval (1, 9)
julia> earliest_arrival_times(g, 1) # when can node 1 reach the others?
4-element TemporalDistances{Int64}:
0
3
8
6
julia> minimum_durations(g, 1) # how long do the fastest trips take?
4-element TemporalDistances{Int64}:
0
1
7
4
julia> minimum_duration_path(g, 1, 4) # and which edges do they use?
2-element Vector{TemporalEdge{Int32, Int64}}:
(1 2 5 2)
(2 4 7 2)
julia> temporal_closeness(g, Fastest()) # sum of 1 / duration over reachable nodes
4-element Vector{Float64}:
1.3928571428571428
0.5
1.3333333333333333
1.0Head to Getting started for a tour of the package.
Citing
If you use TemporalGraphs.jl in your work, please cite:
@software{aurorarossi2026temporalgraphs,
author = {Aurora Rossi},
title = {TemporalGraphs.jl: Fast Temporal Graph Analysis in Julia},
year = {2026},
version = {0.1.0},
url = {https://github.com/aurorarossi/TemporalGraphs.jl}
}TemporalGraphs.jl was inspired by TGLib, the C++/Python library of Lutz Oettershagen and Petra Mutzel.