ArticlePDF Available

Comparing temporal graphs using dynamic time warping

Authors:

Abstract and Figures

Within many real-world networks, the links between pairs of nodes change over time. Thus, there has been a recent boom in studying temporal graphs. Recognizing patterns in temporal graphs requires a proximity measure to compare different temporal graphs. To this end, we propose to study dynamic time warping on temporal graphs. We define the dynamic temporal graph warping (dtgw) distance to determine the dissimilarity of two temporal graphs. Our novel measure is flexible and can be applied in various application domains. We show that computing the dtgw-distance is a challenging (in general) NP-hard optimization problem and identify some polynomial-time solvable special cases. Moreover, we develop a quadratic programming formulation and an efficient heuristic. In experiments on real-world data, we show that the heuristic performs very well and that our dtgw-distance performs favorably in de-anonymizing networks compared to other approaches.
Example of the dtgw-distance between two temporal graphs G\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathcal{G}}$$\end{document} and H\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathcal{H}}$$\end{document} on four vertices with lifetimes six and five. The vertex coloring indicates an optimal vertex mapping M. The connections between the boxes indicate an optimal warping path p={(1,1),(2,1),(3,2),(3,3),(4,4),(5,5),(6,5)}\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$p=\{(1,1),(2,1), (3,2), (3,3), (4,4), (5,5), (6,5)\}$$\end{document}. Their labels correspond to the costs C(Gi,Hj,M)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$C(G_i,H_j,M)$$\end{document} where the vertex signatures are the degrees and the metric is the absolute value of the difference. For example, the cost of warping G1\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$G_1$$\end{document} to H1\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$H_1$$\end{document} is 2, as the green and yellow vertex each have degree two in G1\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$G_1$$\end{document} but only degree one in H1\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$H_1$$\end{document}. The resulting dtgw-distance is dtgw(G,H)=2+0+0+2+2+2+4=12\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${{\,\rm{dtgw}\,}}({\mathcal{G}},{\mathcal{H}}) = 2+0+0+2+2+2+4=12$$\end{document}
… 
This content is subject to copyright. Terms and conditions apply.
Vol.:(0123456789)
1 3
Social Network Analysis and Mining (2020) 10:50
https://doi.org/10.1007/s13278-020-00664-5
ORIGINAL ARTICLE
Comparing temporal graphs using dynamic time warping
VincentFroese1· BrijneshJain2· RolfNiedermeier1· MalteRenken1
Received: 27 February 2020 / Revised: 30 May 2020 / Accepted: 4 June 2020 / Published online: 29 June 2020
© The Author(s) 2020
Abstract
Within many real-world networks, the links between pairs of nodes change over time. Thus, there has been a recent boom
in studying temporal graphs. Recognizing patterns in temporal graphs requires a proximity measure to compare different
temporal graphs. To this end, we propose to study dynamic time warping on temporal graphs. We define the dynamic tem-
poral graph warping (dtgw) distance to determine the dissimilarity of two temporal graphs. Our novel measure is flexible
and can be applied in various application domains. We show that computing the dtgw-distance is a challenging (in general)
NP-hard optimization problem and identify some polynomial-time solvable special cases. Moreover, we develop a quadratic
programming formulation and an efficient heuristic. In experiments on real-world data, we show that the heuristic performs
very well and that our dtgw-distance performs favorably in de-anonymizing networks compared to other approaches.
Keywords Temporal graph matching· Vertex signatures· Heuristic optimization· Quadratic programming· Parameterized
algorithms
1 Introduction
A fundamental concept for pattern recognition is the notion
of proximity (i.e., (dis)similarity) between objects. For
objects that are represented by numerical feature vectors,
there exist a lot of well-known proximity measures such as
p-norms or positive semi-definite kernels. In structural pat-
tern recognition, objects are often more naturally represented
by complex (discrete) data structures such as graphs, strings,
or time series. For these representations, one can often not
simply use vector-based proximity measures. Instead, one
needs to define suitable domain-specific proximity measures
such as the edit distance on graphs or strings or the dynamic
time warping distance1 on time series.
The majority of graph proximity measures focus on static
graphs. This includes the graph edit distance (Riesen 2015),
graph kernels (Kriege etal. 2020), and geometric graph dis-
tances (Jain 2016). However, many complex systems are not
static as the links between entities dynamically change over
time. Thus, there is a steadily growing research interest in ana-
lyzing temporal graphs (we also use the term temporal network
interchangeably) (Rozenshtein and Gionis 2019; Holme and
Saramäki 2013, 2019). Such temporal graphs can be repre-
sented by a series of temporal edges between a fixed set of
vertices. Examples are social contact networks, disease spread-
ing networks, traffic networks, attack networks in computer
security, or protein–protein interaction networks in biology
(Kostakos 2009; Holme and Saramäki 2013, 2019; Li etal.
2017; Vijayan etal. 2017). Examples of data mining problems
on temporal social networks include community detection
(Dakiche etal. 2019), epidemics analysis (Rozenshtein etal.
2016), and influence spreading (Gayraud etal. 2015).
An extended abstract of this article appeared in the Proceedings of
the 8th International Conference on Complex Networks and their
Applications, Springer, SCI, vol 882, pp. 469–480, 2019 (Froese
etal. 2019). This article contains all proofs in full detail and
presents extended experimental results.
* Malte Renken
m.renken@tu-berlin.de
Vincent Froese
vincent.froese@tu-berlin.de
Brijnesh Jain
brijnesh.jain@dai-labor.de
Rolf Niedermeier
rolf.niedermeier@tu-berlin.de
1 Faculty IV, Algorithmics andComputational Complexity,
Technische Universität Berlin, Berlin, Germany
2 Faculty IV, Distributed Artificial Intelligence Laboratory,
Technische Universität Berlin, Berlin, Germany
1 Note that a distance function is not required to obey the triangle
inequality, in contrast to a metric.
Content courtesy of Springer Nature, terms of use apply. Rights reserved.
Social Network Analysis and Mining (2020) 10:50
1 3
50 Page 2 of 16
Many processes described by temporal graphs naturally
vary in duration and temporal dynamics (for example, chem-
ical reactions or the spread of a disease might proceed at
different speeds), which makes data mining tasks such as
classification challenging. Hence, one needs to find suitable
proximity measures, which has seemingly not been done
so far.
Our paper proposes such a measure. We introduce a novel
proximity measure on temporal graphs based on vertex sig-
nature graph distance and dynamic time warping, called
dynamic temporal graph warping (dtgw). Dynamic time
warping allows to cope with variations in temporal dynam-
ics. Thus, by combining established methods from graph-
based pattern recognition and time series data mining in a
nontrivial way, we obtain a suitable tool to analyze temporal
network data. We study the computational complexity of the
dtgw-distance, develop efficient algorithms and study their
behavior on real-world data, the latter indicating the strong
potential for future applications.
Related Work. Graph distance based on vertex mappings
using local vertex signatures was introduced byJouili and
Tabbone (2009). The idea of using vertex mappings can also
be found in optimal assignment kernels (Fröhlich etal. 2005;
Kriege etal. 2016; Bento and Ioannidis 2018).
Regarding proximity measures on temporal graphs, seem-
ingly little work has been done so far. In fact, we are not
aware of other approaches for numerically measuring the
proximity of two temporal graphs. Related concepts, how-
ever, have been investigated for temporal graphs. For exam-
ple, one approach is based on network embeddings where
nodes are mapped onto certain feature spaces incorporat-
ing the temporal behavior (Ahmed and Karypis 2015; Zuo
etal. 2018; Nguyen etal. 2018). Another approach is based
on network alignments (Vijayan etal. 2017; Elhesha etal.
2019) where a vertex mapping that optimizes some criteria
is computed. However, dynamic time warping has not been
used in this context so far.
Dynamic time warping (Sakoe and Chiba 1978) is an
established measure for mining time series data (Rakthan-
manon etal. 2012; Wang etal. 2013) which is specifically
designed to cope with temporal distortion in the data via
nonlinear alignment of time series. It can be applied to time
series of different lengths (in contrast to the Euclidean dis-
tance for example) which is a relevant aspect in time series
averaging. We lift this approved concept to the domain of
temporal graphs.
Our Contributions. We define the dynamic temporal
graph warping (dtgw) distance as a twofold discrete minimi-
zation problem involving computation of an optimal vertex
mapping and an optimal “warping path” (see Sect.3). As
a by-product, our approach does not only yield a distance
measure but also yields an interpretable mapping between
vertices of the two temporal graphs which can, for example,
be used for de-anonymization of individuals in social
networks.
We show that the dtgw-distance is NP-hard to compute
in general(Theorem1). In contrast, we point out several
polynomial-time solvable special cases. This includes the
case when either a vertex mapping or a temporal alignment
is fixed (Observation 1), the case of deciding whether the
dtgw-distance is zero (Theorem2), and the case when the
lifetimes of the two temporal graphs differ only by a constant
and the warping path length is restricted (Proposition 3).
Moreover, we give a quadratic programming formulation
(Sect.5.2) and propose an efficient and effective heuristic
approach (Sect.5.3).
We empirically evaluate the heuristic2 in preliminary
experiments on real-world temporal social networks (face-
to-face contact and spatial proximity networks) against the
quadratic program and some simple baseline methods to
show its efficiency and solution quality. Moreover, we dem-
onstrate that our concept can successfully be used for de-
anonymization of real-world temporal social networks and is
faster than other existing methods such as DynaMAGNA++
(Vijayan etal. 2017) or HTNE (Zuo etal. 2018) (Sect.6).
Compared to the conference version (Froese etal. 2019),
this version contains the NP-hardness proof of Theorem1,
the proof ofProposition 3, and the quadratic programming
formulation (Sect.5.2). Moreover, we present additional
experimental results including a comparison of the heuris-
tic with the quadratic program (Sect.6.2) and a clustering
experiment to demonstrate robustness with respect to noisy
data (Sect.6.3).
Organization. Section2 contains basic definitions. Sec-
tion3 presents our main definition of the dtgw-distance fol-
lowed by NP-hardness results in Sect.4 and positive algo-
rithmic results in Sect.5. Section6 presents experimental
results on some real-world data. We conclude in Sect.7 with
an outlook on future applications and challenges.
2 Preliminaries
For
T
, we define
[T] ∶= {1, 2, ,T}
.
Temporal Graphs. A temporal graph
G=(V,E1,E2,,ET)
consists of a vertex setV and a
sequence of
T1
edge sets
Ei
, each being a set of unor-
dered vertex pairs. By
Gi=(V,Ei)
, we denote the
ith
layer
of
and we callT the lifetime of
. The underlying graph
of
is the graph
(
V,
T
i=1
E
i)
. We remark that all definitions
and results in this work can easily be extended to labeled
temporal graphs (with vertex and/or edge labels).
2 An implementation is freely available at www.akt.tu-berli n.de/
menue /softw are.
Content courtesy of Springer Nature, terms of use apply. Rights reserved.
Social Network Analysis and Mining (2020) 10:50
1 3
Page 3 of 16 50
Vertex Mapping. A vertex mapping between two vertex
sets V and W is a set
MV×W
containing
min(|V|,|W|)
tuples such that each
xVW
is contained in at most
one tuple ofM. We denote the set of all vertex mappings
betweenV andW by
M(V,W)
. Let
VMV
be the subset of
vertices inV that are contained in some tuple ofM (
WMW
is defined analogously). Note that
VM=V
or
WM=W
holds
since
|M|=min(|V|,|W|)
.
Assign ment Proble m
. Computing optimal vertex map-
pings between two temporal graphs can be solved via the
Assignment Problem
which is a fundamental problem in
combinatorial optimization. Given two setsA andB of equal
size and a cost function
cA×B
, the goal is to find a
bijection
𝜋AB
such that
aA
c
(
a,𝜋
(
a
))
is minimized.
It is well known that the
Assignment Prob lem
is solvable
in
O(|A|3)
time (Ahuja etal. 1993,Theorem12.2).
Dynamic Time Warping. The dynamic time warping dis-
tance (Sakoe and Chiba 1978) is a distance between time
series. It is based on the concept of a warping path. A warp-
ing path of order
n×m
is a set
p={p1,,pL}
of
L1
pairs
p𝓁=(i𝓁,j𝓁)
such that
p1=(1, 1)
and
pL=(n,m)
, and
p
𝓁
+1∈ {(i
𝓁
+1, j
𝓁
+1),(i
𝓁
,j
𝓁
+1),(i
𝓁
+1, j
𝓁
)}
f o r
all
1𝓁<L
.
We denote the set of all warping paths of order
n×m
by
Pn,m
. For two temporal graphs
G=(V,E1,,ET)
,
H=(W,F1,,FU)
, every order-
(T×U)
warping pathp
defines a warping between
and
H
, that is, a pair
(i,j)∈p
warps layer
Gi
to layer
Hj
.
Parameterized Complexity. We assume the reader to be
familiar with basic concepts of computational complexity
theory such as NP-completeness (Garey and Johnson 1979).
In parameterized complexity theory (Downey and Fellows
2013; Cygan etal. 2015), one considers running times with
respect to two dimensions. One dimension is the size of the
input instancex, and the other dimension is a parameterk
(usually a numerical value). An instance of a parameterized
problem is a pair(x,k). The class XP contains all param-
eterized problems that can be solved in polynomial time for
every constant parameter value, that is, in
|x|f(k)
time for
some functionf only depending onk.
3 Dynamic temporal graph warping (DTGW)
In this section, we define our temporal graph distance
based on dynamic time warping using a vertex-signature-
based graph distance as cost function. We choose this graph
distance for the following reasons. First, in contrast to the
NP-hard edit distance, it is polynomial-time computable.
Second, it is based on a mapping between the two vertex
sets which allows to enforce a consistency over time. This
consistency assumption is useful in many temporal network
applications where the vertices in both networks correspond
to the same set of objects over time. This implicitly allows
to identify vertices within the two networks. Third, vertex
signatures allow for a high flexibility since they can be cho-
sen arbitrarily in order to incorporate essential information
(local or global) for the application at hand (e.g., one might
use feature vectors obtained via network embedding).
Graph Distance Based on Vertex Signatures.
The following approach is due to Jouili and Tabbone
(2009). For a (static) graph
G=(V,E)
, a vertex signature
function f
G
V
k
encodes arbitrary information about
a vertex. Let
dk×k
be a metric.
For two (static) graphs
G=(V,E)
and
H=(W,F)
with
vertex signatures
fGV
k
and
fHW
k
and a
given vertex mappingM betweenV andW, we define the
cost ofM as
where
𝛥G(v)∈
is the (predefined) cost of “deleting” ver-
texv fromG since it is not mapped byM to any vertex in the
other vertex set. The value
𝛥G(v)
might, for example, depend
on the vertex signature ofv. Note that “deleting” a vertex
does not affect the signatures of other vertices. Note also
that one of the last two sums on the right-hand side above
is always zero.
The vertex-signature-based distance betweenG andH is
then defined as
Depending on the application, one might normalize the
distanceD by some appropriate factor (typically depending
on|V| and|W|; e.g., Jouili and Tabbone (2009) normalized
by
min(|V|,|W|)1
).
Throughout this work, we assume that vertex signature
functions
fG
are computable in polynomial time in the size
ofG and we assume all metrics
d
to be polynomial-time
computable. In the rest of the paper, we neglect the run-
ning times for computing the values of
fG
and
d
because we
assume that all vertex signatures are precomputed once in
polynomial time.
Dynamic Time Warping Distance for Temporal Graphs.
We transfer the concept of dynamic time warping to tem-
poral graphs in the following way. Let
G=(V,E1,,ET)
and
H=(W,F1,,FU)
be two temporal graphs, and let
f
G1
,,f
GT
V
k
and f
H1
,,f
HU
W
k
be the cor-
responding vertex signature functions.
We then define the vertex-signature-based dynamic tem-
poral graph warping distance (dtgw-distance) between
and
H
as
C
(G,H,M) ∶=
(u,v)∈M
d
(
fG(u),fH(v)
)
+
vVV
M
𝛥G(v)+
vWW
M
𝛥H(v)
,
D(G,H) ∶= min
MM(V,W)
C(G,H,M).
Content courtesy of Springer Nature, terms of use apply. Rights reserved.
Social Network Analysis and Mining (2020) 10:50
1 3
50 Page 4 of 16
Figure1 depicts an example illustrating the dtgw-
distance of two temporal graphs. Intuitively, the vertex
mapping identifies vertices with similar behavior over
time and the warping path identifies the time layers with
similar vertex behavior. Note that (for
T=U)
if one fixes
p= {(1, 1),(2, 2),,(T,T)}
, then we get a temporal graph
distance without time warping (similar to the Euclidean
distance).
The following results are easily observed and play a
central role for our subsequent algorithms.
Observation 1 Let
G=(V,E1,,ET)
and
H=(W,F1,,FU)
be two temporal graphs with
|V||W|=∶ n
.
1. For a fixed vertex mapping
MM(V,W)
, a warping
path
pPT,U
which minimizes
(i,j)∈p
C
(
Gi,Hj,M
)
can
be computed in
O(TUn)
time.
2. For a fixed warping path
pPT,U
, a vertex map-
ping
MM(V,W)
which minimizes
(i,j)∈p
C(G
i
,H
j
,M
)
can be computed in
O(n2
|p|+n3)
time.
Proof i)For a given vertex mappingM, an optimal warp-
ing path can be computed by a well-known dynamic pro-
gram for dynamic time warping in
O(T
U
n)
time (Sakoe
and Chiba 1978). Here,
O(n)
is the time for computing the
costs
C(Gi,Hj,M)
. Note that faster dynamic time warping
algorithms for special cases are known (Abboud etal. 2015;
Gold and Sharir 2018; Kuszmaul 2019; Froese etal. 2020).
dtgw
(G,H) ∶= min
MM(V,W)min
pPT,U
(i,j)∈p
C(Gi,Hj,M)
.
ii) Let
V∶= VQ
, where Q is a set of
|W||V|
dummy vertices (that is,
|V|=n
) with
QV=�
. For
every
(u,v)∈V×W
, let
Then, we need to find a vertex mapping
M
M
(V
,W)
that minimizes
(u,v)∈M
𝜎
(
u,v
)
. Note thatM defines a bijec-
tion between
V
andW. Hence, computingM is an
Assign
-
ment Problem
instance solvable in
O(n3)
time (Ahuja etal.
1993,Theorem12.2). Computing all
𝜎(u,v)
values can be
done in
O(n2
|p|)
time.
Note that Observation 1i) implies that if we already know
the vertex mapping up to a constant number of vertices, then
dtgw
can be computed in polynomial time (since we can
try out all polynomially many possible vertex mappings).
Furthermore, Observation 1ii) implies that
dtgw
is poly-
nomial-time computable if the optimal temporal alignment
between
and
H
is known beforehand. In particular,
dtgw
can be computed in polynomial time if one temporal graph
has a constant lifetime or a constant number of vertices since
there are only polynomially many possible warping paths or
polynomially many vertex mappings.
Corollary 1 The dtgw-distance between two temporal
graphs can be computed in polynomial time if at least one
of the following applies:
1. The vertex mapping is known up to a constant number
of vertices.
2. The warping path is known.
𝜎
(u,v) ∶=
(i,j)∈pd
fGi(u),fHj(v)
,uV
(i,j)∈p𝛥Hj(v),uQ
.
G
1
G
2
G
3
G
5
G
6
H1H2H3H4
200224
H5
2
G
4
G
H
Fig. 1 Example of the dtgw-distance between two tempo-
ral graphs
G
and
H
on four vertices with lifetimes six and five.
The vertex coloring indicates an optimal vertex mapping M.
The connections between the boxes indicate an optimal warp-
ing path
p= {(1, 1),(2, 1),(3, 2),(3, 3),(4, 4),(5, 5),(6, 5)}
.
Their labels correspond to the costs
C(Gi,Hj,M)
where the ver-
tex signatures are the degrees and the metric is the absolute
value of the difference. For example, the cost of warping
G1
to
H1
is 2, as the green and yellow vertex each have degree two
in
G1
but only degree one in
H1
. The resulting dtgw-distance is
dtgw (G,H)=2+0+0+2+2+2+4=12
Content courtesy of Springer Nature, terms of use apply. Rights reserved.
Social Network Analysis and Mining (2020) 10:50
1 3
Page 5 of 16 50
3. At least one of the temporal graphs has a constant life-
time or a constant number of vertices.
For given vertex signature function and metric, we refer
to the decision problem of testing whether two temporal
graphs have dynamic temporal graph warping distance at
most some given valuec by DtgW .
4 Computational hardness
Even though the dynamic time warping distance and the
vertex-signature-based graph distance are both computable
in polynomial time, their combined application to temporal
graphs yields a distance measure that is generally NP-hard
to compute. Intuitively, this is due to the fact that the vertex
mapping has to be consistent for all layers. This introduces
non-trivial dependencies between the time warping and the
vertex mapping which render the problem computationally
hard. Indeed, this is not a singular case for temporal graph
problems where for many cases the temporal counterparts
of problems solvable in polynomial time turn NP-hard;
examples include the computation of matchings in graphs
(Heeger etal. 2019; Baste etal. 2020; Mertzios etal. 2020),
short path computations (Casteigts etal. 2019; Fluschnik
etal. 2020), or the computation of separators (Zschoche
etal. 2020).
Theorem1 DtgW is NP -complete for every metric when
the vertex signatures are vertex degrees.
Proof DtgW is clearly contained in NP since for a given
vertex mapping and warping path (both having polynomial
size), one can check in polynomial time whether the
dtgw
-distance is at mostc (also see Observation 1).
To show NP-hardness, we give a polynomial-time many-
one reduction from the NP-complete
3
-sAt problem. Let
d×
be any metric, and let
𝜙=C1∧…∧Cm
be
an instance of
3
-sAt over the variables
x1,,xn
. Each
clause
Cj
is then a disjunction of three literals
C
j=∶ 𝓁
1
j
𝓁
2
j
𝓁
3
j
, and there is a function
𝜈∶[m]×[3]
[n]
such that
𝓁i
j
∈{x𝜈(j,i)},x
𝜈(j,i)
holds for all
𝓁i
j
.
Without loss of generality, we assume
m>8
.
The idea is to represent each literal by a vertex which
can be mapped to either
(true) or
(false). We then
build, for each clause, a clause box gadget consisting of three
consecutive layers. The choice of a warping path will then,
for each clause, implicitly select one of its literals, and the
D
YNAMIC
T
EMPORAL
G
RAPH
W
ARPING
(DTGW)
𝐈𝐧𝐩𝐮𝐭 Two temporal graphs Gand H,c
.
𝐐𝐮𝐞𝐬𝐭𝐢𝐨𝐧 Is dtgw (
G
,
H
)c?
costs caused by each clause box will attain their minimum
value if and only if that particular literal is mapped to
.
Now, a detailed description of the reduction follows. Let
D and
D
be two copies of the graph
22m
i=1
K
2
(consisting
of 22m disjoint edges), where for each vertex
vV(D)
we
denote its copy in
V(D)
by
v
. We construct two temporal
graphs
and
H
. Their vertex sets each contain
2n+47m+8
vertices as follows:
Both temporal graphs have
2n+26m
layers defined as fol-
lows. For each
i∈[n]
, we set
For
j∈[m]
, we set
and
Finally, for
j∈[22m]
, we set
We call the layers containing
|E(D)|
edges separation lay-
ers. Furthermore, for each
j∈[m]
we say that the layers
2n+4j3
,
2n+4j2
, and
2n+4j1
form the clause
block corresponding to
Cj
(see Fig.2 for an example). Let
c∶= 42md(0, 1)
.
We claim that
dtgw (G,H)c
if and only if
𝜙
has a sat-
isfying truth assignment.
”: Given a satisfying assignment
𝛽∶{
x
1,,
x
n}
{
𝚝𝚛𝚞𝚎
,
𝚏𝚊𝚕𝚜𝚎
}
of
𝜙
, we define the fol-
lowing vertex mapping:
V(G) ∶= {xi,xi;i∈[n]}∪{C
1
j,C
2
j,C
3
jj∈[m]} ∪ {Xi,Yi;i∈[4]}
V(D),
V
(H) ∶= {i,ii∈[n]} ∪ {C1
j,C2
j,C3
jj∈[m]} ∪ {X
i,Y
ii∈[4
]}
V(D
).
E(G
2i1
) ∶= {{x
i
,x
i
}},E(H
2i1
) ∶= {{
i
,
i
}},
E(G2i) ∶= E(D),E(H2i) ∶= E(D
).
E(G
2n+4j3
) ∶= {{X
i
,Y
i
};i∈[4]},
E
(G2n+4j2) ∶= {{Ci
j,𝓁i
j};i∈[3]}
,
E
(G2n+4j1) ∶= {{Xi,Yi};i∈[4]}
,
E(G
2n+4j
) ∶= E(D),
E
(H2n+4j3) ∶= {{C
1
j,𝜈(j,1)},{𝜈(j,2),𝜈(j,2)},{𝜈(j,3),𝜈(j,3)},{C
2
j,C
3
j}}
,
E
(H2n+4j2) ∶= {{C2
j,𝜈(j,2)},{𝜈(j,1),𝜈(j,1)},{𝜈(j,3),𝜈(j,3)},{C1
j,C3
j}}
∪ {{X
i,Y
i};i∈[4]},
E
(H2n+4j1) ∶= {{C3
j,𝜈(j,3)},{𝜈(j,1),𝜈(j,1)},{𝜈(j,2),𝜈(j,2)},{C1
j,C2
j}}
,
E(H2
n+
4
j
)∶=E(D).
E(G
2n+4m+j
) ∶= {{X
k
,Y
k
}∶k∈[4]},
E
(H
2n+4m+j
) ∶= {{X
k
,Y
k
}∶k∈[4]}
.
Content courtesy of Springer Nature, terms of use apply. Rights reserved.
Social Network Analysis and Mining (2020) 10:50
1 3
50 Page 6 of 16
Fig. 2 Clause block for
Cj=x𝛼x𝛽x𝛾
. Only relevant
vertices are shown in each layer
X1Y1
G2n+4j3
G2n+4j2
G2n+4j1
H2n+4j3
H2n+4j2
H2n+4j1
X2Y2
X3Y3
X4Y4
C1
j
C2
j
C3
j
xα
xβ
xγ
X
1Y
1
X
2Y
2
X
3Y
3
X
4Y
4
C1
j
C2
j
C3
j
α
β
γ
α
β
γ
X1Y1
X2Y2
X3Y3
X4Y4
C1
j
C2
j
C3
j
xα
xβ
xγ
X1Y1
X2Y2
X3Y3
X4Y4
C1
j
C2
j
C3
j
xα
xβ
xγ
C1
j
C2
j
C3
j
α
β
γ
α
β
γ
C1
j
C2
j
C3
j
α
β
γ
α
β
γ
X
1Y
1
X
2Y
2
X
3Y
3
X
4Y
4
X
1Y
1
X
2Y
2
X
3Y
3
X
4Y
4
G2n+4j3
G2n+4j2
G2n+4j1
H2n+4j3
H2n+4j2
H2n+4j1
16 ·d(0,1)
16 ·d(0,1)
8·d(0,1)
2·d(0,1)
(
a
)
G2n+4j3
G2n+4j2
G2n+4j1
H2n+4j3
H2n+4j2
H2n+4j1
16 ·d(0,1)
16 ·d(0,1)
10 ·d(0,1)
(
b
)
G2n+4j3
G2n+4j2
G2n+4j1
H2n+4j3
H2n+4j2
H2n+4j1
16 ·d(0,1)
16 ·d(0,1)
8·d(0,1)
2·d(0,1)
(
c
)
Fig. 3 The three possible warpings between layers of a clause block. Each edge is labeled with the minimal cost it causes under the assumption
that the set
{Xi,Yi;i∈[4]}
is mapped to
{
X
i
,Y
i
;i∈[4
]}
Content courtesy of Springer Nature, terms of use apply. Rights reserved.
Social Network Analysis and Mining (2020) 10:50
1 3
Page 7 of 16 50
To construct a warping path, we begin by defining, for
each
j∈[m]
, the following three sub-paths (see also Fig.3):
For each clause
C
j=𝓁
1
j𝓁
2
j𝓁
3
j , pick
kj∈[3]
such that
𝓁kj
j
is true. We then build the warping pathp as the union of all
𝜋
kj
j
, using the trivial warping path for all remaining layers:
It is then not difficult to calculate that each clause block adds
cost of exactly
42 d(0, 1)
and there are no other costs. Thus,
dtgw (G,H)42md(0, 1)=c
.
”: Now suppose that
dtgw (G,H)c
and let (M,p)
be a pair of vertex mappingM and warping pathp with cost
(i,j)∈p
C(Gi,Hj,M)= dtgw (G,H
)
. Note that any non-sep-
aration layer contains at most eight edges. So if p warps any
separation layer to any non-separation layer, then the result-
ing cost would be at least
(44m16)d(0, 1)>c
. Thus, we
may assume that every separation layeri of
G
is only warped
to layeri of
H
and vice versa. Since the last 22m layers of
each temporal graph are all identical and M andp are chosen
to have minimal cost, we can conclude that
If M maps some vertex from
{Xk,Yk;k∈[4]}
to some
vertex that is not in
{
X
k
,Y
k
;k
∈[
4
]}
, then the 22m layers
2n+4m+1, ,2n+4m+22m
each would cause cost of
at least
2d(0, 1)
, thus exceedingc in total. Hence, Mhas to
contain a bijection from
{Xk,Yk;k∈[4]}
to
{X
k,Y
k;k∈[4]}
.
Now, consider the clause block corresponding to
C
j=𝓁
1
j
𝓁
2
j
𝓁
3
j
. From the arguments above, it follows that
G2n+4j3
and
G2n+4j1
are warped to
H2n+4j3
and
H2n+4j1
,
respectively. This already costs
32 d(0, 1)
. We distinguish
three cases (corresponding to
𝜋1
j
through
𝜋3
j
above):
1.
G2n+4j2
is warped to
H2n+4j3
. This causes costs of
at least
2d(0, 1)
. Then,
H2n+4j2
must be warped to
G2n+4j1
or p would not have minimal cost. Thus, there
are additional costs of at least
8d(0, 1)
. This is the situ-
ation illustrated in Fig.3a.
M∶= {(x
i
,
i
),(x
i
,
i
)∶𝛽(x
i
)=
𝚝𝚛𝚞𝚎
}
∪ {(xi,i),(xi,i)∶𝛽(xi)=𝚏𝚊𝚕𝚜𝚎}
∪ {(Ci
j,Ci
j)∶i∈[3],j∈[m]}
∪ {(Xi,X
i),(Yi,Y
i)∶i∈[4]}
∪ {(v,v
)∶vV(D)}.
𝜋1
j∶=
{
(2n+4j2, 2n+4j3),(2n+4j1, 2n+4j2)
},
𝜋
2
j∶= {(2n+4j2, 2n+4j2)},
𝜋
3
j
∶=
{
(2n+4j3, 2n+4j2),(2n+4j2, 2n+4j1)
}.
p
∶= {(i,i)∶i∈[2n+4m+22m]{2n+4j2;j∈[m]}} ∪
j∈[m]
𝜋
k
j
j
.
p{(i,i);i∈[2n+4m+22m]{2n+4j2;j∈[m]}}.
2.
G2n+4j2
is warped to
H2n+4j2
. This causes costs of
at least
10 d(0, 1)
. This is the situation illustrated in
Fig.3b.
3.
G2n+4j2
is warped to
H2n+4j1
. This case is symmetric
to (1) and also causes costs of at least
10 d(0, 1)
. This
is the situation illustrated in Fig.3c.
In summary, the costs contributed by each clause block are
at least
42 d(0, 1)
. Hence, to meet the bound of c, all layers
outside of clause blocks must not cause any additional cost.
For each
i∈[n]
, since
G2i1
is warped to
H2i1
, this implies
that either
{(i,xi),(i,xi)} M
or
{(i,xi),(i,xi)} M
.
Furthermore, for each
j∈[m]
, the clause block corre-
sponding to
Cj
must have cost of exactly
42 d(0, 1)
. If we
are in Case(1) as above, then this is only possible ifM maps
each degree-1 vertex of
G2n+4j2
to some degree-1 vertex
of
H2n+4j3
. Thus,
(
𝓁2
j,𝜈(j,2)
)
M . Otherwise, if we are in
Case(2), respectively, Case(3), then analogous arguments
yield that
(
𝓁1
j,𝜈(j,1)
)
M
, respectively,
(
𝓁3
j,𝜈(j,3)
)
M .
Hence, in any case there is some
i∈[3]
for which
(
𝓁i
j,𝜈(j,i)
)
M
.
Consequently,
is a satisfying assignment for
𝜙
.
Let us take a closer look at the reduction in the proof
of Theorem1. Note that the corresponding optimal warp-
ing path is always close to the diagonal (that is,
|ij|1
holds for every pair(i,j)). Hence, it lies within the so-called
Sakoe–Chiba band (Sakoe and Chiba 1978) of widthone.
Moreover, the maximum degree in each layer is one. Finally,
the number of vertices and the number of layers of both
temporal graphs and the target costc are all upper-bounded
linearly in the size of the
3
- sAt formula, which allows to
conclude a running time lower bound based on the Expo-
nential Time Hypothesis3 Impagliazzo and Paturi (2001)
[together with the Sparsification Lemma (Impagliazzo etal.
2001)]. These observations are summarized in the following
corollary. (Recall that V, W are the vertex sets and T, U are
the lifetimes of
,
H
.)
Corollary 2 DtgW is NP -complete for every metric and
vertex degrees as vertex signatures even when the maxi-
mum degree of each layer is one and the warping path is
𝛽
(xi) ∶=
{
𝚝𝚛𝚞𝚎, if (xi,i)∈M
𝚏𝚊𝚕𝚜𝚎, if (x
i
,
i
)∈M
3 The Exponential Time Hypothesis asserts that
3
-sAt cannot be
solved in subexponential time, that is, there is no
2o(n)
poly(m)
-time
algorithm, where nis the number of variables andm is the number of
clauses of the input formula.
Content courtesy of Springer Nature, terms of use apply. Rights reserved.
Social Network Analysis and Mining (2020) 10:50
1 3
50 Page 8 of 16
restricted to the Sakoe–Chiba band of width one. Moreo-
ver, even this very restricted variant cannot be solved in
2o(|V|+|W|+T+U+c)
poly(|
G
|+|
H
|)
time unless the Exponen-
tial Time Hypothesis fails.
Furthermore, if the dtgw-distance is normalized (e.g.,
divided by the number of vertices), then we obtain NP-
hardness for a constant value ofc (by the reduction in the
proof of Theorem1).
Corollary 3 DtgW with normalized vertex-signature-
based distance is NP-complete for a constant value ofc.
Due to the proven worst-case hardness of DtgW , there is
little hope to solve the problem efficiently in general. Nev-
ertheless, in the next section we provide some methods to
cope with this intractability.
5 Algorithms
In this section, we first point out polynomial-time solvable
special cases. Then, we develop a mathematical program-
ming formulation as well as a heuristic approach to approxi-
mate the
dtgw
-distance in practice.
5.1 Exact polynomial‑time algorithms forspecial
cases
Our first algorithmic result is to show that one can determine
in polynomial time whether two temporal graphs with the
same number of vertices have
dtgw
-distance zero. This basic
case occurs when checking for duplicates within a data set.
In contrast, determining whether two (static) graphs have
graph edit distance zero is not known to be polynomial-time
solvable (as this is equivalent to the famous
grAPh isomor
-
Phism
problem).
Theorem2 Let
G=(V,E1,,ET)
and
H=(W,F1,,FU)
be two temporal graphs with
|V|=|W|=n
. For all vertex
signatures and all metrics, deciding whether
dtgw (G,H)=0
holds is possible in
O(n2
(T+U)+n3)
time.
Proof We will show that for distance zero, an optimal warp-
ing path can easily be determined. Polynomial-time solv-
ability then follows from Observation 1.
Let
G=(V,E1,,ET)
and
H=(W,F1,,FU)
be two
temporal graphs with
V=∶ {v1,,vn}
and
W=∶ {w1,,wn}
. For each
i∈[T]
, we define the
ith
layer signature of
G
as f(G
i
) ∶=
(
f
Gi
(v
1
),,f
Gi
(v
n
)
)
(analo-
gously, f(Hj) ∶=
(
fH
j
(w1),,fH
j
(wn)
)
for
j∈[U]
). Assum-
ing
dtgw (G,H)=0
, it follows that there exists a vertex map-
ping
MV×W
and a warping path
pPT,U
such that
holds for every
(i,j)∈p
. Since
d
is a metric, this implies
that
f
G
i(u)=f
H
j(v)
holds for every
(u,v)∈M
. That is,
f(Hj)
is a permutation (determined by M) of
f(Gi)
. Let
1i1<i2<iq<T
be the indices such that
and let
1
j1<j2<<jr<U
be the indices such that
Clearly, if
f(Gi)
f(Gi
)
and layeri is warped to layerj and
layer
i
is warped to layer
j
, then
f(Hj)f(Hj
)
since other-
wise the cost will not be zero. By the definition of a warp-
ing path, it follows that the layers
1, ,i1
of
can only be
warped to layers
1, ,j1
of
H
and the layers
i1+1, ,i2
of
can only be warped to layers
j1+1, ,j2
of
H
and
so on. Note that this is only possible if
q=r
. If this is the
case, then we can assume that the warping pathp has the
following form:
By Observation 1, we can now check whether there exists
a vertex mapping that yields distance zero for the warping
pathp in
O(n2
(T+U)+n3)
time. Computingp can be
done in
O(n(T+U))
time.
We remark that if the vertex signatures and the metric sat-
isfy the property that every pair of different vertex signatures
has distance at least
𝛿
for some constant
𝛿>0
, then DtgW
parameterized by the resulting costc is in XP . For exam-
ple, this is the case when the vertex signatures contain only
integers and
d
is any
𝓁p
-norm (for
p1
). Then, every pair
of different signatures has distance at least
𝛿=1
. The idea
of the algorithm is to “guess” the tuples of a warping path
which cause nonzero cost (at most
c𝛿
many) and to check
whether it is possible to complete the warping path with-
out further costs. The latter can be done in polynomial time
using similar arguments as for the case
c=0
(Theorem2).
Corollary 4 DtgW is in XP with respect toc if the vertex
signatures have a constant minimum pairwise distance
𝛿>0
.
(u,v)∈M
d
(
fGi(u),fHj(v)
)
=
0
f(Gi)f(Gi+1)i∈{ik;k∈[q]},
f(Hj)f(Hj+1)j∈{jk;k∈[r]} .
p
=
{
(1, 1),(1, 2),,(1, j1),(2, j1),…(i1,j1),
(i1+1, j1+1),,(i1+1, j2),…(i2,j2),
,
(i
q
+1, j
q
+1),,(i
q
+1, U),,(T,U)
}.
Content courtesy of Springer Nature, terms of use apply. Rights reserved.
Social Network Analysis and Mining (2020) 10:50
1 3
Page 9 of 16 50
In contrast, if the dtgw-distance is normalized, then
the differences between vertex signatures can be arbitrar-
ily small, in which case DtgW is NP-hard for constantc
(Corollary 3).
To overcome this hardness, in the following, we consider
special cases based on parameters regarding the warping
path length. We assume that the lifetimes of the inputs dif-
fer by at most a constant, that is,
T=U+t
for some
t0
(which might often be the case in practice). Note that, by
definition, every warping path of order
T×U
has length
at leastT. We define the parameter
𝜆
to be the difference
between the warping path length and the lower boundT, that
is, we consider only order-
(T×U)
warping paths of length at
most
T+𝜆
. (In practice, overly long warping paths might be
considered unnatural.) We prove that DtgW is in XP with
respect to the combined parameter
(𝜆,t)
.
Theorem3 For all vertex signatures and all metrics,
DtgW is solvable in
time if
n=max(|V|,|W|)
,
T=U+t
, and the warping paths
have length at most
T+𝜆
.
Proof Let
G=(V,E1,,ET)
and
H=(W,F1,,FT)
be
two temporal graphs, and
let
p={p1=(i1,j1),,pL=(iL,jL)} ∈ PT,U
be a warping
path. The warping path p contains
L1
steps
p𝓁+1p𝓁=(i𝓁+1i𝓁,j𝓁+1j𝓁)∈{(1, 0),(0, 1),(1, 1)}
for
1𝓁<L
. We call a step
𝓁
horizontal if
p𝓁+1p𝓁=(1, 0)
,
and we call it vertical if
p𝓁+1p𝓁=(0, 1)
, and otherwise
we call it diagonal. Let
𝜈U1
denote the number of ver-
tical steps inp. Then, pcontains also
𝜈+t
horizontal and
U1𝜈
diagonal steps, that is,
L1=𝜈+𝜈+t+U𝜈1
, which implies that
𝜈=LtU
. Clearly, there are
(
L1
𝜈
)
possible positions
for the vertical steps. For each of these possible choices,
there are again
(
L1𝜈
𝜈+t
)
possible positions for horizon-
tal steps. (The remaining steps are diagonal.) Therefore, the
overall number of warping paths of length at most
T+𝜆
is
For each of these possible warping paths, we can compute
dtgw (G,H)
in
time by Observation 1.
O(
(T+𝜆)
𝜆
T
𝜆+t(
n
2
(T+𝜆)+n
3))
𝜆
l=0
T+l1
l

T1
l+t
O
(T+𝜆)𝜆
T𝜆+t
.
O(max(|V|,|W|)2
(T+
𝜆
)+max(|V|,|W|)3)
Note that Proposition 3 implies polynomial-time solv-
ability of DtgW ift and
𝜆
are constants. For unboundedt,
however, we conjecture that DtgW is NP-hard even if the
warping paths are restricted to have length
max(T,U)
, which
is the minimum possible length (that is,
𝜆=0
).
5.2 Quadratic programming
We give a formalization of DtgW as a quadratic minimiza-
tion problem with linear constraints(QP). This is NP-hard
to solve in general but can be used to solve small instances
exactly with the state-of-the-art QP-solvers such as Gurobi4.
Let
G=(V,E1,,ET)
and
H=(W,F1,,FU)
be two
temporal graphs. Denote the vertices inV by
u1,,u|V|
and
the vertices inW by
v1,,v|W|
. To model “vertex deletion,
we add two artificial vertices
u|V|+1,v|W|+1
.
We use the following variables:
For every
(i,j)∈[|V|+1]×[|W|+1]
, we have a vertex
mapping variable
mi,j∈{0, 1}
, where
mi,j=1
if and only
if vertex
ui
is mapped to vertex
vj
.
For every
(s,t)∈[T]×[U]
, we have a warping vari-
able
ws,t∈{0, 1}
, where
ws,t=1
if and only if
Gs
is
warped to
Ht
.
Moreover, for every
(s,t,i,j)∈[T]×[U]×[|V|+1]×[|W|+1]
, let
denote the cost of matching vertex i in layer s to vertex j in
layer t.
Computing
dtgw (G,H)
is the following quadratic5 mini-
mization problem.
d
s,t,i,j∶=
d
fGs(vi),fHt(wj)
,i∈[V],j∈[W]
𝛥Gs(vi),i∈[V],j=W+1
𝛥Ht(wj),i=
V
+1, j∈[
W
]
0, i=
V
+1, j=
W
+
1
(1)
minimize
s∈[T]
t∈[U]
i∈[|V|+1]
j∈[|W|+1]
ds,t,i,jws,tmi,
j
(1a)
subject to
(1b)
j∈[|W|+1]
mi,j=1i∈[
|
V
|]
4 www.gurob i.com
5 It is also possible to convert our formulation into a linear problem
by introducing further variables and constraints for replacing the
product
ws,t
mi,j
in the objective function. However, in our experi-
ments we found that the quadratic formulation can be solved faster.
Content courtesy of Springer Nature, terms of use apply. Rights reserved.
Social Network Analysis and Mining (2020) 10:50
1 3
50 Page 10 of 16
The constraints1b and 1c ensure that the vertex map-
ping variables define a correct vertex mapping, that is, every
vertex is mapped to exactly one other vertex (or is deleted).
Constraints1d to1g ensure that the warping variables
define a valid warping path. Here, the constraints1e to1g
imply that if the warping path contains a pair(s,t), then it
also contains at least one of the pairs
(s+1, t)
,
(s,t+1)
, or
(s+1, t+1).
(Since the objective is minimized, any solution
will actually select only one of these pairs.)
The number of variables is in
O(|V|
|W|+T
U)
, and
the number of constraints is in
O(|V|+|W|+TU)
.
5.3 Heuristic approaches
In this section, we present a heuristic to compute the dtgw-
distance, which typically yields good (not necessarily opti-
mal) solutions in practice.
The approach is to simply start with an arbitrary initial
vertex mapping (or warping path) and to compute an optimal
warping path (vertex mapping) based on Observation 1 in
polynomial time. This process is then repeated by alternating
between optimal warping path and optimal vertex mapping
computation until the solution converges to a local minimum
(or some other criterion is reached).
Note that it is a convenient feature of our heuristic to be
able to stop the process after any number of iterations to
obtain some approximate solution (a so-called anytime algo-
rithm). It is further possible to incorporate prior knowledge,
for example, by fixing the mapping for some vertices. Note
also that convergence is guaranteed since we decrease the
objective in each alternation and the search space is finite.
We propose several initialization options.
Initial Warping Path. A first idea for initialization is to
choose a shortest warping path (that is, of length
max(T,U)
).
Note that for
TU
several such paths exist. Without further
(1c)
i∈[|V|+1]
mi,j=1j∈[
|
W
|]
(1d)
w1,1 =1
(1e)
ws,tws+1,t+1+ws,t+1+ws+1,t∀(s,t)∈[T1]×[U1]
(1f)
wT,twT,t+1t∈[U1]
(1g)
ws,Uws+1,Us∈[T1].
knowledge about the instances, choosing a path within the
Sakoe–Chiba band of small width is a reasonable default.
This initialization is very simple and only requires
O(T+U)
time.
Another idea is to compute a warping path using
D(Gi,Hj)
as a cost for warping layeri to layerj. This is of course an
optimistic estimate since it allows to use a different vertex
mapping for each pair of layers. Then, a vertex mapping
can be computed by Observation 1. This initialization takes
O(T
U
n3)
time where
n∶= max(|V|,|W|)
.
Initial Vertex Mapping. The idea is to compute a vertex
mapping by solving an Assignment Problem instance for
approximate costs. Let
𝜎(u,v)
be some approximate cost for
mapping vertex
uV
to
vW
. For example, one could use
the following estimations:
The first option
𝜎
estimates the cost of mappingu tov over
all possible warpings between any two layers. (This is usu-
ally more than any warping path will incur.) The definition
of
𝜎opt
only considers for each layer of the first temporal
graph the minimal cost over all layers of the other tempo-
ral graph. (This estimate might be too low.) Both of these
options require
O(T
U
|V|
|W|)
time.
Based on the estimated costs, one computes a vertex map-
ping by solving an
Assignment Problem
instance and then
computes an optimal warping path for this vertex mapping
based onObservation 1.
The running time of one iteration (that is, comput-
ing a vertex mapping and an optimal warping path) is
O(
(T+U)n2+n3+TUn
)
. While the number of itera-
tions might depend on the choice of initialization, in our
experiments the heuristic always converged after very few
iterations. Regarding the solution quality, while it is pos-
sible to construct adversarial examples where the heuristic
performs poorly, our experiments in Sect.6.2 indicate that
it performs well in practice.
6 Experiments
We conducted several experiments6 to demonstrate the merit
of our dtgw-distance in applications and to evaluate the per-
formance of the alternating minimization heuristic(Am) we
described in Sect.5.3. For computations, we used a 4.0GHz
i7-6700K processor (single-threaded).
𝜎
(u,v) ∶=
i∈[T]
j∈[U]
d
(
fGi(u),fHj(v)
),
𝜎
opt(u,v) ∶=
i∈[T]
min
j∈[U]d
(
fGi(u),fHj(v)
).
6 Source code available at www.akt.tu-berli n.de/menue /softw are.
Content courtesy of Springer Nature, terms of use apply. Rights reserved.
Social Network Analysis and Mining (2020) 10:50
1 3
Page 11 of 16 50
6.1 Data sets
We used three data sets from the SocioPatterns project
(Génois and Barrat 2018). Each of these consists of two
temporal social networks, both recorded simultaneously with
the same individuals as vertices. The first network is a face-
to-face contact network, whereas the second one is a co-
presence network where edges represent spatial proximity.
All six networks have a temporal resolution of 20 seconds.
For our experiments, only the first day of each network was
used and vertices without any edges were discarded. The
three different data sets were recorded at a primary school
(“LyonSchool,” 237 vertices, 1700 layers), a scientific con-
ference (“SFHH,” 403 vertices, 2300 layers), and a work-
place (“InVS15,” 180 vertices, 2100 layers).
6.2 Comparison ofheuristic andexact solutions
We compared the solutions of our Am heuristic under dif-
ferent initialization schemes against the optimal solutions
obtained from the QP formulation.
Due to long running times of the QP-solver, we were
restricted to very small temporal networks. We randomly
selected10 children from class1A of the primary school
face-to-face network and extracted225 consecutive layers
(during a high contact period) which we split into 15 tem-
poral subnetworks with15 consecutive layers each. We used
vertex degrees as signatures (with absolute value metric)
and computed all pairwise dtgw-distances between these 15
networks with the following algorithms:
QP: exact QP-solver (Gurobi 8.0.1),
Am
𝜎
: Am with
𝜎
initialization,
Am
𝜎opt
: Am with
𝜎opt
initialization,
Am
swp
: Am with shortest warping path initialization,
Am
owp
: Am with optimistic warping path initialization.
We implemented the Am heuristic in Python, using a C++
implementation7 of the Jonker–Volgenant algorithm (Jonker
and Volgenant 1987) to solve the Assignment Problem.
Figure4 shows for each initialization variant the esti-
mated cumulative distribution function (ecdf) of the error
percentage
𝜀=100 (dAM dQP)∕dQP ,
where
dAM
is the
approximate dtgw-distance obtained by an Am heuristic and
dQP
is the exact dtgw-distance obtained by the QP-solver.
A point
(𝜀,P)
on an ecdf-curve of an Am heuristic means
that the error percentage of Am is at most
𝜀
with estimated
probability P.
All Am variants found the correct solution for a majority of
samples(
P0>0.5
). The average error percentages are rather
small and vary between 3.0 by Am
owp
and 5.5 by Am
𝜎opt
. The
Am
owp
heuristic performed the best, having
P00.71
and
maximum error percentage
max 36.4
. These findings indi-
cate that for small instances the approximations of the four
heuristics are close to the optimal solution on average but may
fail considerably in some cases with up to a maximum error
of
63.6%
. We remark that based on our experimental experience
the relative error becomes smaller on larger instances.
Regarding running times, the Am heuristic took less than
0.01 seconds per instance, usually converging after at most
three iterations (independently of the chosen initialization).
In comparison, the QP was slower by a factor of more than
10000, requiring 8 minutes on average (median 2 minutes)
with some instances approaching 2 hours.
6.3 Sensitivity ofDTGW tonoise
The goal of this experiment was to assess how sensitive the
dtgw-distance is to noise, that is, how well can original data
be reconstructed from noisy data. We compared our dtgw-
distance approach to the following two baseline methods.
Fig. 4 The plot (left) shows the
estimated cumulative distribu-
tion functions of the four Am
variants. The table (right)
presents the average error
percentage(avg), the standard
deviation(std), the fraction of
optimally solved instances(
P0
),
and the maximum error percent-
age(max) of every Am variant
heuristic avg std P0max
AMσ4.59.1 0.59 63.6
AMσopt 5.510.50.58 55.6
AMswp4.810.00.61 63.6
AMowp3.06.2 0.71 36.4
7 This code is available as a Python module at githu b.com/src-d/lapjv .
Content courtesy of Springer Nature, terms of use apply. Rights reserved.
Social Network Analysis and Mining (2020) 10:50
1 3
50 Page 12 of 16
Non-consistent: Instead of using one consistent vertex
mapping for all layers, one can allow a different mapping
for each pair of layers. Note that the resulting distance
can be computed in
O(T
U
n3)
time, thus being faster
than an exact computation of the dtgw-distance but much
slower than a single iteration of the Am heuristic.
Non-temporal: A naive approach is to ignore the time
information and solely compute an optimal vertex map-
ping between the underlying graphs. This requires
O(n3)
time plus the (usually linear) time to build the underlying
graphs.
We used the primary school face-to-face network from which
we extracted five reference temporal networks representing
the contacts between children of the same grade, each con-
taining 45–50 vertices and 3100 layers.
For each of the five reference networks, we generated nine
noisy copies as follows:
1. For every
i∈[T]
,
Ei
is deleted with probability
p∈{0.1, 0.2, 0.3}
, and if not, then each edge
eEi
is
deleted with probability p.
2. For every
i∈[T]
, each edge
eEi
was rewired with
probability
p∈{0.1, 0.2, 0.3}
.
3. Each edge of the underlying graph was rewired with
probability
p∈{0.1, 0.2, 0.3}
.
Rewiring an edge
e={u,v}∈Ei
of a tempo-
ral graph is defined as randomly picking a tuple
Fig. 5 Sensitivity of dtgw to noise. Shown are the dendrograms
obtained by agglomerative clustering using complete linkage. Differ-
ent colors represent different grades; the light gray edges connect ele-
ments of different grades. The top left dendrogram shows the result
obtained by the dtgw-distance. The top right dendrogram shows the
result obtained by the non-consistent benchmark. The bottom dendro-
gram shows the result obtained by using the non-temporal benchmark
Content courtesy of Springer Nature, terms of use apply. Rights reserved.
Social Network Analysis and Mining (2020) 10:50
1 3
Page 13 of 16 50
(
e={u,v},t)∈
T
s=1
(E
s
×{s
})
and then replacing e in
Ei
by
{u,v}
and
e
in
Et
by
{u
,v}
.8 Rewiring of underlying
edges is done analogously (see Holme and Saramäki 2012
for details).
We used the Am heuristic to approximate the pairwise
dtgw-distances (using degrees as vertex signatures) between
all reference and noisy temporal networks. In all of these
instances, shortest warping path initialization (which is fast-
est) was used since preliminary tests showed that the other
initializations produce very similar results.
Figure5 shows the dendrogram obtained by hierarchical
clustering using complete linkage of the approximated pair-
wise dtgw-distances. Both the dtgw-distance and the non-
consistent baseline were able to partition the instances into
five clusters, each of which consists of a reference network
and its nine noisy copies. Hence, they successfully recovered
the original reference networks from noise. However, the
clusters produced by the dtgw-distance are more compact
than the ones of the non-consistent baseline. In contrast, the
non-temporal baseline was not able to separate the graphs
of different grades.
In all instances, the heuristic converged within at most
six iterations, taking less than 15 seconds. In comparison,
the non-consistent baseline required 4 minutes on average
for each instance, while the non-temporal baseline was the
fastest (below 1 second).
6.4 De‑anonymization
Besides measuring a distance between temporal graphs, the
dtgw-distance additionally provides a mapping between the
vertex sets which implicitly allows to identify vertices. This
allows the de-anonymization (Narayanan and Shmatikov
2009) of temporal social networks. Since the data sets used
contain the original mapping between the vertex sets, we
can employ this as an easy benchmark for the accuracy of
the dtgw-distance.
We used the Am heuristic (with shortest warping path
initialization) to compute the dtgw-distance (with degrees
as vertex signatures9) on the three data sets mentioned in
Sect.6.1. We counted how many vertices were correctly re-
identified (that is, mapped to their copies) in the resulting
vertex mapping. We compared our results to the following
alternative algorithms found in the literature:
DynaMAGNA++ (Vijayan etal. 2017): A search-based
evolutionary algorithm computing a vertex mapping that
maximizes edge conservation and node conservation over
time.
Temporal network embedding (Zuo etal. 2018): Hawkes
process-based temporal network embedding (HTNE)
computes a low-dimensional embedding of the vertices
of a temporal network. From this, we computed a vertex
mapping minimizing the Euclidean distances between the
vertex feature vectors.
Fixed dtgw: Note that our dtgw-distance allows to fix the
warping path beforehand (Observation 1ii)). Since in our
Table 1 Percentages
(rounded) of vertices that were
re-identified by the tested
methods
Also, average running times (in seconds) over the three versions of each data set are given (fixed dtgw is
not applicable for shifted and randomized data sets)
Data set dtgw Fixed dtgw DynaMAGNA++ HTNE
School Original 2% 1% 1% 1%
Shifted 1% – 0% 1%
Randomized 1% – 1% 0%
Average running time 95s 65s 15,070s 250s
Conference Original 86% 90% 80% 0%
Shifted 86% – 27% 0%
Randomized 65% – 30% 1%
Average running time 200s 125s 20,320s 90s
Workplace Original 38% 43% 51% 1%
Shifted 38% – 19% 0%
Randomized 10% – 8% 1%
Average running time 45s 20s 1600s 50s
8 Since edges are undirected, it is understood that the choice of
which vertex to call u, respectively, v is to be made randomly. (The
same holds for
u
and
v
.)
9 We also tested other signatures such as size of the connected com-
ponent or betweenness centrality. However, the performance was
(slightly) worse.
Content courtesy of Springer Nature, terms of use apply. Rights reserved.
Social Network Analysis and Mining (2020) 10:50
1 3
50 Page 14 of 16
case each pair of temporal graphs was recorded using
synchronized clocks, it is natural to use a fixed warping
path that aligns layeri of the first graph with layeri of
the second graph.
To simulate a situation in which the temporal graphs repre-
sent processes which do not run synchronously in time, we
created two modified versions of each of the data sets. In the
first one, called “shifted,” all events of the first graph were
delayed by three minutes. In the second version, called “ran-
domized,” each layer of each of the graphs was randomly
and independently replaced by X layers where
X∈{1, 2, …}
is a random variable with
(Xx)=x3
. Since we pre-
tend that the nature of these modifications is unknown to
the tested algorithms, dtgw with fixed warping path is not
applicable to these variants.
For DynaMAGNA++, we used a population of
size15000 and a maximum of 10000 generations. With
HTNE, we computed 128-dimensional vertex embeddings
using a batch of size 10000, a learning rate of 0.1, a his-
tory length of 2, and 5 negative samples. Unlike dtgw, both
methods utilized all four processor cores.
The results and running times are listed in Table1. Most
notably, the re-identification rate of HTNE was poor on all
data sets, suggesting that these embeddings are ill-suited for
comparing vertices taken from different networks. Further-
more, all methods failed to re-identify any significant num-
ber of vertices on the primary school data set. This might be
explained by the fact that the co-presence network is very
different from the face-to-face contacts due to a low spatial
resolution (as was also noted by Génois and Barrat (2018)).
The overall performance was much better on the other
two data sets, especially on the conference data where up
to 90% of participants could be re-identified, whereas on
the workplace data set the best result was 51%. Unsurpris-
ingly, fixing the correct layer alignment on the unmodified
graphs sped up the dtgw computation significantly while
also yielding slightly better results. On these instances, dtgw
performed comparably to DynaMAGNA++, being better in
one case and worse in the other, although requiring much
less computational effort. In contrast, on the shifted and ran-
domized data sets dtgw always achieved the best results.
(Notably, the re-identification performance using dtgw did
not decrease on shifted data.)
In all cases, the Am heuristic converged after at most
six iterations and DynaMAGNA++ converged within 2000
generations.
7 Conclusion
We introduced a new proximity measure for comparing tem-
poral graphs by transferring dynamic time warping from
time series to temporal graphs. This yields a challenging
computational problem for which we proposed exact algo-
rithms and a heuristic approach to solve it. While exact solu-
tions can only be computed for very small instances, we
empirically showed that our heuristic runs fast in practice
and yields good approximations of optimal solutions. In our
experiments, it was also capable of de-anonymizing social
networks.
Our work opens several directions for future research.
We believe that the dtgw-distance is a promising tool,
for example, in biology and chemistry. Processes like
epidemic disease spreading or chemical reactions can
naturally be viewed as temporal graphs where the verti-
ces represent individuals or (macro) molecules. [Unfor-
tunately, we could not test this, as there is still a lack of
openly available temporal molecular data (Vijayan etal.
2017).] Since the exact timescales of these processes often
vary, the ability of dynamic time warping to compensate
for such differences would be especially helpful in this
context. One might also use the dtgw-distance to under-
stand the learning process of neural networks. The train-
ing phases of neural networks yield temporal networks
which can be analyzed to gain insight into how different
conditions influence the learning process. Another poten-
tial application is analyzing team sports data via temporal
graphs to reveal similar strategies or roles of individual
players. Depending on the application domain, there is a
wide range of possibilities to test the performance when
using different vertex signatures or even other graph
distances.
Besides experimenting with various application domains
and further definition variants, already the proven compu-
tational worst-case hardness of DtgW may trigger further
algorithmic research. A concrete open question is whether
DtgW is in XP (or even fixed-parameter tractable) with
respect to
𝜆
, when the warping path length is restricted to
be at most
max(T,U)+𝜆
where T, U are the respective life-
times. It is also interesting to further study the influence of
graph-specific parameters in the spirit of a multivariate com-
plexity analysis (Niedermeier 2010; Fellows etal. 2013).
Acknowledgement Open Access funding provided by Projekt DEAL.
Funding BJ: Supported by the DFG project JA2109/4-2, MR: Sup-
ported by the DFG project NI369/17-1.
Open Access This article is licensed under a Creative Commons Attri-
bution 4.0 International License, which permits use, sharing, adapta-
tion, distribution and reproduction in any medium or format, as long
as you give appropriate credit to the original author(s) and the source,
Content courtesy of Springer Nature, terms of use apply. Rights reserved.
Social Network Analysis and Mining (2020) 10:50
1 3
Page 15 of 16 50
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://creat iveco mmons .org/licen ses/by/4.0/.
References
Abboud A, Backurs A, Williams VV (2015) Tight hardness results
for LCS and other sequence similarity measures. In: 2015 IEEE
56th annual symposium on foundations of computer science
(FOCS’15), pp 59–78. https ://doi.org/10.1109/FOCS.2015.14
Ahmed R, Karypis G (2015) Algorithms for mining the coevolving
relational motifs in dynamic networks. ACM Trans Knowl Discov
Data 10(1):4:1–4:31. https ://doi.org/10.1145/27333 80
Ahuja RK, Magnanti TL, Orlin JB (1993) Network flows: theory, algo-
rithms, and applications. Prentice-Hall, Upper Saddle River
Baste J, Bui-Xuan BM, Roux A (2020) Temporal matching.
Theor Comput Sci 806:184–196. https ://doi.org/10.1016/j.
tcs.2019.03.026
Bento J, Ioannidis S (2018) A family of tractable graph distances.
In: Proceedings of the 2018 SIAM international conference
on data mining (SDM’18). SIAM, pp 333–341. https ://doi.
org/10.1137/1.97816 11975 321.38
Casteigts A, Himmel A, Molter H, Zschoche P (2019) The computa-
tional complexity of finding temporal paths under waiting time
constraints. In: CoRR. arXiv :abs/1909.06437
Cygan M, Fomin FV, Kowalik L, Lokshtanov D, Marx D, Pilipczuk
M, Pilipczuk M, Saurabh S (2015) Parameterized algorithms.
Springer, New York. https ://doi.org/10.1007/978-3-319-21275
-3
Dakiche N, Tayeb FBS, Slimani Y, Benatchba K (2019) Tracking com-
munity evolution in social networks: a survey. Inf Process Manag
56(3):1084–1102. https ://doi.org/10.1016/j.ipm.2018.03.005
Downey R, Fellows MR (2013) Fundamentals of param-
eterized complexity. Springer, New York. https ://doi.
org/10.1007/978-1-4471-5559-1
Elhesha R, Sarkar A, Cinaglia P, Boucher C, Kahveci T (2019) Co-
evolving patterns in temporal networks of varying evolution.
In: Proceedings of the 10th ACM international conference on
bioinformatics, computational biology and health informatics
(BCB’19). ACM, pp 494–503. https ://doi.org/10.1145/33073
39.33421 52
Fellows MR, Jansen BMP, Rosamond F (2013) Towards fully multi-
variate algorithmics: parameter ecology and the deconstruction of
computational complexity. Eur J Combin 34(3):541–566. https ://
doi.org/10.1016/j.ejc.2012.04.008
Fluschnik T, Niedermeier R, Schubert C, Zschoche P (2020) Multi-
stage
s
-
t
path: confronting similarity with dissimilarity. In: CoRR.
arXiv :abs/2002.07569
Froese V, Jain B, Niedermeier R, Renken M (2019) Comparing tem-
poral graphs using dynamic time warping. In: Proceedings of
the 8th international conference on complex networks and their
applications, SCI, vol 882. Springer, pp 469–480. https ://doi.
org/10.1007/978-3-030-36683 -4_38
Froese V, Jain BJ, Rymar M (2020) Fast exact dynamic time warping on
run-length encoded time series. In: CoRR. arXiv :abs/1903.03003
Fröhlich H, Wegner JK, Sieker F, Zell A (2005) Optimal assignment
kernels for attributed molecular graphs. In: Proceedings of the
22nd international conference on machine learning (ICML’05).
ACM, pp 225–232. https ://doi.org/10.1145/11023 51.11023 80
Garey MR, Johnson DS (1979) Computers and intractability: a guide
to the theory of NP-completeness. W. H. Freeman and Company,
New York
Gayraud NT, Pitoura E, Tsaparas P (2015) Diffusion maximization
in evolving social networks. In: Proceedings of the 2015 ACM
conference on online social networks (COSN’15). ACM, pp
125–135. https ://doi.org/10.1145/28179 46
Génois M, Barrat A (2018) Can co-location be used as a proxy for face-
to-face contacts? EPJ Data Sci 7(1):11. https ://doi.org/10.1140/
epjds /s1368 8-018-0140-1
Gold O, Sharir M (2018) Dynamic time warping and geometric edit
distance: breaking the quadratic barrier. ACM Trans Algorithms
14(4):50:1–50:17. https ://doi.org/10.1145/32307 34
Heeger K, Himmel A, Kammer F, Niedermeier R, Renken M, Sajenko
A (2019) Multistage problems on a global budget. In: CoRR.
arXiv :abs/1912.04392
Holme P, Saramäki J (2012) Temporal networks. Phys Rep 519(3):97–
125. https ://doi.org/10.1016/j.physr ep.2012.03.001
Holme P, Saramäki J (2013) Temporal networks. Springer, New York.
https ://doi.org/10.1007/978-3-642-36461 -7
Holme P, Saramäki J (2019) Temporal network theory. Springer, New
York. https ://doi.org/10.1007/978-3-030-23495 -9
Impagliazzo R, Paturi R (2001) On the complexity of
k
-SAT. J Comput
Syst Sci 62(2):367–375. https ://doi.org/10.1006/jcss.2000.1727
Impagliazzo R, Paturi R, Zane F (2001) Which problems have strongly
exponential complexity? J Comput Syst Sci 63(4):512–530. https
://doi.org/10.1006/jcss.2001.1774
Jain BJ (2016) On the geometry of graph spaces. Discrete Appl Math
214:126–144. https ://doi.org/10.1016/j.dam.2016.06.027
Jonker R, Volgenant A (1987) A shortest augmenting path algorithm
for dense and sparse linear assignment problems. Computing
38(4):325–340. https ://doi.org/10.1007/BF022 78710
Jouili S, Tabbone S (2009) Graph matching based on node signatures.
In: Proceedings of the 7th IAPR-TC-15 international workshop
on graph-based representations in pattern recognition. LNCS, vol
5534. Springer, pp 154–163. https ://doi.org/10.1007/978-3-642-
02124 -4_16
Kostakos V (2009) Temporal graphs. Physica A 388(6):1007–1023.
https ://doi.org/10.1016/j.physa .2008.11.021
Kriege NM, Giscard PL, Wilson R (2016) On valid optimal assignment
kernels and applications to graph classification. In: Advances
in neural information processing systems 29 (NIPS’16). Cur-
ran Associates, Inc., pp 1623–1631. http://paper s.nips.cc/paper
/6166-on-valid -optim al-assig nment -kerne ls-and-appli catio ns-to-
graph -class ifica tion
Kriege NM, Johansson FD, Morris C (2020) A survey on graph kernels.
Appl Netw Sci 5(1):6. https ://doi.org/10.1007/s4110 9-019-0195-3
Kuszmaul W (2019) Dynamic time warping in strongly subquadratic
time: algorithms for the low-distance regime and approximate
evaluation. In: Proceedings of the 46th international colloquium
on automata, languages, and programming (ICALP’19), Schloss
Dagstuhl - Leibniz-Zentrum für Informatik, LIPIcs, vol 132, pp
80:1–80:15. https ://doi.org/10.4230/LIPIc s.ICALP .2019.80
Li A, Cornelius SP, Liu YY, Wang L, Barabási AL (2017) The
fundamental advantages of temporal networks. Science
358(6366):1042–1046. https ://doi.org/10.1126/scien ce.aai74 88
Mertzios GB, Molter H, Niedermeier R, Zamaraev V, Zschoche P
(2020) Computing maximum matchings in temporal graphs. In:
Proceedings of the 37th international symposium on theoretical
aspects of computer science (STACS’20), Schloss Dagstuhl -
Leibniz-Zentrum für Informatik, LIPIcs, pp 27:1–27:14. https ://
doi.org/10.4230/LIPIc s.STACS .2020.27
Content courtesy of Springer Nature, terms of use apply. Rights reserved.
Social Network Analysis and Mining (2020) 10:50
1 3
50 Page 16 of 16
Narayanan A, Shmatikov V (2009) De-anonymizing social networks.
In: Proceedings of the 30th IEEE symposium on security and
privacy, pp 173–187. https ://doi.org/10.1109/SP.2009.22
Nguyen GH, Lee JB, Rossi RA, Ahmed NK, Koh E, Kim S (2018)
Continuous-time dynamic network embeddings. In: Companion
proceedings of the web conference 2018(WWW ’18), Interna-
tional World Wide Web Conferences Steering Committee, pp
969–976. https ://doi.org/10.1145/31845 58.31915 26
Niedermeier R (2010) Reflections on multivariate algorithmics and
problem parameterization. In: Proceedings of the 27th interna-
tional symposium on theoretical aspects of computer science
(STACS’10), Schloss Dagstuhl–Leibniz-Zentrum fuer Infor-
matik, LIPIcs, vol5, pp 17–32. https ://doi.org/10.4230/LIPIc
s.STACS .2010.2495
Rakthanmanon T, Campana B, Mueen A, Batista G, Westover B, Zhu
Q, Zakaria J, Keogh E (2012) Searching and mining trillions of
time series subsequences under dynamic time warping. In: Pro-
ceedings of the 18th ACM SIGKDD international conference
on knowledge discovery and data mining(KDD ’12). ACM, pp
262–270. https ://doi.org/10.1145/23395 30.23395 76
Riesen K (2015) Structural pattern recognition with graph edit dis-
tance. Springer, New York. https ://doi.org/10.1007/978-3-319-
27252 -8
Rozenshtein P, Gionis A (2019) Mining temporal networks. In: Pro-
ceedings of the 25th ACM SIGKDD international conference
on knowledge discovery & data mining (KDD’19). ACM, pp
3225–3226. https ://doi.org/10.1145/32925 00.33322 95
Rozenshtein P, Gionis A, Prakash BA, Vreeken J (2016) Reconstruct-
ing an epidemic over time. In: Proceedings of the 22nd ACM
SIGKDD international conference on knowledge discovery
and data mining (KDD’16).ACM, pp 1835–1844. https ://doi.
org/10.1145/29396 72.29398 65
Sakoe H, Chiba S (1978) Dynamic programming algorithm optimi-
zation for spoken word recognition. IEEE Trans Acoust Speech
Signal Process 26(1):43–49. https ://doi.org/10.1109/TASSP
.1978.11630 55
Vijayan V, Critchlow D, Milenković T (2017) Alignment of dynamic
networks. Bioinformatics 33(14):i180–i189. https ://doi.
org/10.1093/bioin forma tics/btx24 6
Wang X, Mueen A, Ding H, Trajcevski G, Scheuermann P, Keogh
E (2013) Experimental comparison of representation methods
and distance measures for time series data. Data Min Knowl Disc
26(2):275–309. https ://doi.org/10.1007/s1061 8-012-0250-5
Zschoche P, Fluschnik T, Molter H, Niedermeier R (2020) The com-
plexity of finding small separators in temporal graphs. J Comput
Syst Sci 107:72–92. https ://doi.org/10.1016/j.jcss.2019.07.006
Zuo Y, Liu G, Lin H, Guo J, Hu X, Wu J (2018) Embedding temporal
network via neighborhood formation. In: Proceedings of the 24th
ACM SIGKDD international conference on knowledge discovery
and data mining(KDD ’18). ACM, pp 2857–2866. https ://doi.
org/10.1145/32198 19.32200 54
Publisher’s Note Springer Nature remains neutral with regard to
jurisdictional claims in published maps and institutional affiliations.
Content courtesy of Springer Nature, terms of use apply. Rights reserved.
1.
2.
3.
4.
5.
6.
Terms and Conditions
Springer Nature journal content, brought to you courtesy of Springer Nature Customer Service Center GmbH (“Springer Nature”).
Springer Nature supports a reasonable amount of sharing of research papers by authors, subscribers and authorised users (“Users”), for small-
scale personal, non-commercial use provided that all copyright, trade and service marks and other proprietary notices are maintained. By
accessing, sharing, receiving or otherwise using the Springer Nature journal content you agree to these terms of use (“Terms”). For these
purposes, Springer Nature considers academic use (by researchers and students) to be non-commercial.
These Terms are supplementary and will apply in addition to any applicable website terms and conditions, a relevant site licence or a personal
subscription. These Terms will prevail over any conflict or ambiguity with regards to the relevant terms, a site licence or a personal subscription
(to the extent of the conflict or ambiguity only). For Creative Commons-licensed articles, the terms of the Creative Commons license used will
apply.
We collect and use personal data to provide access to the Springer Nature journal content. We may also use these personal data internally within
ResearchGate and Springer Nature and as agreed share it, in an anonymised way, for purposes of tracking, analysis and reporting. We will not
otherwise disclose your personal data outside the ResearchGate or the Springer Nature group of companies unless we have your permission as
detailed in the Privacy Policy.
While Users may use the Springer Nature journal content for small scale, personal non-commercial use, it is important to note that Users may
not:
use such content for the purpose of providing other users with access on a regular or large scale basis or as a means to circumvent access
control;
use such content where to do so would be considered a criminal or statutory offence in any jurisdiction, or gives rise to civil liability, or is
otherwise unlawful;
falsely or misleadingly imply or suggest endorsement, approval , sponsorship, or association unless explicitly agreed to by Springer Nature in
writing;
use bots or other automated methods to access the content or redirect messages
override any security feature or exclusionary protocol; or
share the content in order to create substitute for Springer Nature products or services or a systematic database of Springer Nature journal
content.
In line with the restriction against commercial use, Springer Nature does not permit the creation of a product or service that creates revenue,
royalties, rent or income from our content or its inclusion as part of a paid for service or for other commercial gain. Springer Nature journal
content cannot be used for inter-library loans and librarians may not upload Springer Nature journal content on a large scale into their, or any
other, institutional repository.
These terms of use are reviewed regularly and may be amended at any time. Springer Nature is not obligated to publish any information or
content on this website and may remove it or features or functionality at our sole discretion, at any time with or without notice. Springer Nature
may revoke this licence to you at any time and remove access to any copies of the Springer Nature journal content which have been saved.
To the fullest extent permitted by law, Springer Nature makes no warranties, representations or guarantees to Users, either express or implied
with respect to the Springer nature journal content and all parties disclaim and waive any implied warranties or warranties imposed by law,
including merchantability or fitness for any particular purpose.
Please note that these rights do not automatically extend to content, data or other material published by Springer Nature that may be licensed
from third parties.
If you would like to use or distribute our Springer Nature journal content to a wider audience or on a regular basis or in any other manner not
expressly permitted by these Terms, please contact Springer Nature at
onlineservice@springernature.com
... To do this, we constructed smoothedspline estimates of LAI from 1996 to 2017 using the remotely-sensed NOAA Advanced Very High-Resolution Radiometer (AVHRR) time series product. We then developed a functional cluster analysis model to allocate 27,196 sites in the CRB into more uniform groups based on similar trends in LAI. Next, we took regional averages of those groups and investigated intra-and inter-annual variability in vegetation dynamics within each cluster. ...
... , 6 clusters [26]. There are other dissimilarity metrics for functional data available such as integrating the difference of two functions, dynamic time warping (DTW), and information theoretic measures [27][28][29] . Ultimately, exploring a large selection of dissimilarity metrics is left to future work. ...
Article
Full-text available
Remotely-sensed Leaf Area Index (LAI) is a useful metric for assessing changes in vegetation cover and greeness over time and space. Satellite-derived LAI measurements can be used to assess these intra- and inter-annual vegetation dynamics and how they correlate with changing regional and local climate conditions. The detection of such changes at local and regional levels is challenged by the underlying continuity and extensive missing values of high-resolution spatio-temporal vegetation data. Here, the feasibility of functional data analysis methods was evaluated to improve the exploration of such data. In this paper, an investigation of multidecadal variation in LAI is conducted in the Columbia River Watershed, as detected by NOAA Advanced Very High-Resolution Radiometer (AVHRR) satellite imaging. The inter- and intra-annual correlation of LAI with temperature and precipitation were then investigated using data from the European Centre for Medium-Range Weather Forecasts global atmospheric re-analysis (ERA-Interim) in the period 1996–2017. A functional cluster analysis model was implemented to identify regions in the Columbia River Watershed that exhibit similar long-term greening trends. Across this region, a multidecadal trend toward earlier and higher annual LAI peaks was detected, and strong correlations were found between earlier and higher LAI peaks and warmer temperatures in late winter and early spring. Although strongly correlated to LAI, maximum temperature and precipitation do not demonstrate a similar strong multidecadal trend over the studied time period. The modeling approach is proficient for analyzing tens or hundreds of thousands of sampled sites without parallel processing or high-performance computing (HPC).
... In particular, the method of ref. 41 is based on a set of features that can be tailored to a specific research question (similarly to ref. 29 for static graphs). Ref. 42, on the other hand, addresses the same problem of temporal graph comparison we tackle here, but it assumes the graphs to be matched, and it is computationally inefficient (the graph dissimilarity is obtained by solving an NP-hard optimization problem and the authors propose an approximation running in Oðn 3 Þ operations, where n is the number of graph nodes). Finally, ref. 43 only considers the unmatched case and focuses on a specific property of temporal graphs, namely the comparison of temporal paths' statistics, to provide a definition of dissimilarity. ...
Article
Full-text available
Temporal graphs are commonly used to represent time-resolved relations between entities in many natural and artificial systems. Many techniques were devised to investigate the evolution of temporal graphs by comparing their state at different time points. However, quantifying the similarity between temporal graphs as a whole is an open problem. Here, we use embeddings based on time-respecting random walks to introduce a new notion of distance between temporal graphs. This distance is well-defined for pairs of temporal graphs with different numbers of nodes and different time spans. We study the case of a matched pair of graphs, when a known relation exists between their nodes, and the case of unmatched graphs, when such a relation is unavailable and the graphs may be of different sizes. We use empirical and synthetic temporal network data to show that the distance we introduce discriminates graphs with different topological and temporal properties. We provide an efficient implementation of the distance computation suitable for large-scale temporal graphs.
Chapter
In this paper, sensor networks are considered, which are (stable) transportation networks equipped with sensors. We abstract transportation networks as graphs with sensor measurements that can be attributed to the nodes and edges. A sensor network is thus modelled as a graph with properties that can change throughout time, and which can be viewed as time series. To the best of our knowledge, a model, in which graph databases and time series analysis are combined to create a temporal property graph model, is new. This work also describes a language to query such temporal property graphs and discusses how both can be implemented and realised by using Neo4j and its query language Cypher. In short, this paper presents a database system for storing and querying sensor networks that enables future projects to reduce set-up times and prevent use-case specific implementation of database and querying applications.KeywordsGraphsTime seriesSensor networksQuery languages
Preprint
Treewidth is arguably the most important structural graph parameter leading to algorithmically beneficial graph decompositions. Triggered by a strongly growing interest in temporal networks (graphs where edge sets change over time), we discuss fresh algorithmic views on temporal tree decompositions and temporal treewidth. We review and explain some of the recent work together with some encountered pitfalls, and we point out challenges for future research.
Article
Full-text available
Addressing a quest by Gupta et al. (in: Proceedings of the 41st international colloquium on automata, languages, and programming (ICALP 2014), vol 8572 of LNCS. Springer, pp 563–575, 2014), we provide a first, comprehensive study of finding a short s – t path in the multistage graph model, referred to as the Multistage s – t Path problem. Herein, given a sequence of graphs over the same vertex set but changing edge sets, the task is to find short s – t paths in each graph (“snapshot”) such that in the found path sequence the consecutive s – t paths are “similar”. We measure similarity by the size of the symmetric difference of either the vertex set (vertex-similarity) or the edge set (edge-similarity) of any two consecutive paths. We prove that these two variants of Multistage s – t Path are already NP{\text {NP}} NP -hard for an input sequence of only two snapshots and maximum vertex degree four. Motivated by this fact and natural applications of this scenario e.g. in traffic route planning, we perform a parameterized complexity analysis. Among other results, for both variants, vertex- and edge-similarity, we prove parameterized hardness ( W[1]{\text {W[1]}} W[1] -hardness) regarding the parameter path length (solution size). As a further conceptual investigation, we then modify the multistage model by asking for dissimilar consecutive paths. As one of the main technical results (employing so-called representative sets known from non-temporal settings), we prove that dissimilarity allows for fixed-parameter tractability for the parameter solution size, contrasting with our W[1]-hardness proof of the corresponding similarity case. We also provide partially positive results concerning efficient and effective data reduction (kernelization).
Article
Full-text available
Dynamic Time Warping (DTW) is a well-known similarity measure for time series. The standard dynamic programming approach to compute the DTW distance of two length- n time series, however, requires O(n2)O(n^2) O ( n 2 ) time, which is often too slow for real-world applications. Therefore, many heuristics have been proposed to speed up the DTW computation. These are often based on lower bounding techniques, approximating the DTW distance, or considering special input data such as binary or piecewise constant time series. In this paper, we present a first exact algorithm to compute the DTW distance of two run-length encoded time series whose running time only depends on the encoding lengths of the inputs. The worst-case running time is cubic in the encoding length. In experiments we show that our algorithm is indeed fast for time series with short encoding lengths.
Article
Full-text available
Abstract Graph kernels have become an established and widely-used technique for solving classification tasks on graphs. This survey gives a comprehensive overview of techniques for kernel-based graph classification developed in the past 15 years. We describe and categorize graph kernels based on properties inherent to their design, such as the nature of their extracted graph features, their method of computation and their applicability to problems in practice. In an extensive experimental evaluation, we study the classification accuracy of a large suite of graph kernels on established benchmarks as well as new datasets. We compare the performance of popular kernels with several baseline methods and study the effect of applying a Gaussian RBF kernel to the metric induced by a graph kernel. In doing so, we find that simple baselines become competitive after this transformation on some datasets. Moreover, we study the extent to which existing graph kernels agree in their predictions (and prediction errors) and obtain a data-driven categorization of kernels as result. Finally, based on our experimental results, we derive a practitioner’s guide to kernel-based graph classification.
Chapter
The links between vertices within many real-world networks change over time. Correspondingly, there has been a recent boom in studying temporal graphs. Proximity-based pattern recognition in temporal graphs requires a (dis)similarity measure to compare different temporal graphs. To this end, we propose to employ dynamic time warping on temporal graphs. We define the dynamic temporal graph warping distance (dtgw) to determine the (dis)similarity of two temporal graphs. Our novel measure is flexible and can be applied in various application domains. We show that computing the dtgw-distance is a challenging (in general NP-hard) optimization problem and we identify some polynomial-time solvable special cases. Moreover, we develop an efficient heuristic which performs well in empirical studies. In experiments on real-word data we show that our dtgw-distance performs favorably in de-anonymizing networks compared to other approaches. KeywordsTemporal graph alignmentGraph matchingVertex signaturesNP-hardnessMajorize-minimize algorithm
Book
This book focuses on the theoretical side of temporal network research and gives an overview of the state of the art in the field. Curated by two pioneers in the field who have helped to shape it, the book contains contributions from many leading researchers. Temporal networks fill the border area between network science and time-series analysis and are relevant for the modeling of epidemics, optimization of transportation and logistics, as well as understanding biological phenomena. Network theory has proven, over the past 20 years to be one of the most powerful tools for the study and analysis of complex systems. Temporal network theory is perhaps the most recent significant development in the field in recent years, with direct applications to many of the "big data" sets. This monograph will appeal to students, researchers and professionals alike interested in theory and temporal networks, a field that has grown tremendously over the last decade.
Conference Paper
Biological networks describe the interactions among molecules. Unlike static biological networks at a single time point, temporal networks capture how the network topology evolves over time in response to external stimuli or internal variations. We say that two temporal networks have co-evolving subnetworks if the topologies of these subnetworks remain similar to each other as the networks evolve over time. Existing methods for identifying co-evolving patterns make the strong and unrealistic assumption that the two network topologies evolve at the same rate. In this paper, we consider the generalized problem, where each network may evolve at different rates and the rates of evolution may change over time. Moreover, the two networks may have network topologies available for different number of time points. Existing methods fail to solve this problem as they rely on the strong prior assumption. We develop an efficient algorithm, Tempo++, for identifying co-evolving subnetworks within two given temporal networks. Unlike existing methods, Tempo++ does not assume that the networks have same and uniform evolutionary rates. We experimentally demonstrate that Tempo++ scales efficiently and accurately on both synthetic and real datasets. Our results on E. coli time resolved response to five different environmental stress conditions demonstrate that Tempo++ identifies genes specific to those conditions that conforms to well-known studies in the literature. Statistical significance of alignments found by Tempo++ outperforms existing strategies. Moreover, Tempo++ correctly identifies co-evolving networks with similar stress response compared to networks with different stress response.
Article
Temporal graphs have time-stamped edges. Building on previous work, we study the problem of finding a small vertex set (the separator) whose removal destroys all temporal paths between two designated terminal vertices. Herein, we consider two models of temporal paths: those that pass through arbitrarily many edges per time step (non-strict) and those that pass through at most one edge per time step (strict). Regarding the number of time steps of a temporal graph, we show a complexity dichotomy (NP-completeness versus polynomial-time solvability) for both problem variants. Moreover, we prove both problem variants to be NP-complete even on temporal graphs whose underlying graph is planar. Finally, we introduce the notion of a temporal core (vertices whose incident edges change over time) and prove that the non-strict variant is fixed-parameter tractable when parameterized by the temporal core size, while the strict variant remains NP-complete, even for constant-size temporal cores.
Conference Paper
Networks (or graphs) are used to represent and analyze large datasets of objects and their relations. Naturally, real-world networks have a temporal component: for instance, interactions between objects have a timestamp and a duration. In this tutorial we present models and algorithms for mining temporal networks, i.e., network data with temporal information. We overview different models used to represent temporal networks. We highlight the main differences between static and temporal networks, and discuss the challenges arising from introducing the temporal dimension in the network representation. We present recent papers addressing the most well-studied problems in the setting of temporal networks, including computation of centrality measures, motif detection and counting, community detection and monitoring, event and anomaly detection, analysis of epidemic processes and influence spreading, network summarization, and structure prediction.
Article
A link stream is a sequence of pairs of the form (t,{u,v}), where t∈N represents a time instant and u≠v. Given an integer γ, the γ-edge between vertices u and v, starting at time t, is the set of temporally consecutive edges defined by {(t′,{u,v})|t′∈〚t,t+γ−1〛}. We introduce the notion of temporal matching of a link stream to be an independent γ-edge set belonging to the link stream. We show that the problem of computing a temporal matching of maximum size is NP-hard as soon as γ>1. We depict a kernelization algorithm parameterized by the solution size for the problem. As a byproduct we also give a 2-approximation algorithm. Both our 2-approximation and kernelization algorithms are implemented and confronted to link streams collected from real world graph data. We observe that finding temporal matchings is a sensitive question when mining our data from such a perspective as: managing peer-working when any pair of peers X and Y are to collaborate over a period of one month, at an average rate of at least two email exchanges every week. We furthermore design a link stream generating process by mimicking the behavior of a random moving group of particles under natural simulation, and confront our algorithms to these generated instances of link streams. All the implementations are open source.
Article
Dynamic Time Warping (DTW) and Geometric Edit Distance (GED) are basic similarity measures between curves or general temporal sequences (e.g., time series) that are represented as sequences of points in some metric space (X, dist). The DTW and GED measures are massively used in various fields of computer science and computational biology. Consequently, the tasks of computing these measures are among the core problems in P. Despite extensive efforts to find more efficient algorithms, the best-known algorithms for computing the DTW or GED between two sequences of points in X &equals; Rd are long-standing dynamic programming algorithms that require quadratic runtime, even for the one-dimensional case d &equals; 1, which is perhaps one of the most used in practice. In this article, we break the nearly 50-year-old quadratic time bound for computing DTW or GED between two sequences of n points in R by presenting deterministic algorithms that run in O(n² log log log n/ log log n) time. Our algorithms can be extended to work also for higher-dimensional spaces Rd, for any constant d, when the underlying distance-metric dist is polyhedral (e.g., L1, Linfin).