Manuscript Offprint
arXiv:2608.27500Optimal Transport for Network Comparison: A Review with Machine Learning Applications
James Hyun¹ and François G. Meyer¹
University of Colorado, Boulder, CO 80309, sehy1420@colorado.edu, fmeyer@colorado.edu United States
Abstract. Network comparison using optimal transport is a growing area of research in network science. Unlike standard graph metrics, optimal transport computes both network dissimilarity and a transport plan that explains how one graph morphs into another. In this paper, we review how optimal transport compares undirected, unweighted graphs using three primary distances: the Wasserstein, Gromov-Wasserstein, and Bures-Wasserstein distances. We examine the closed form of the Wasserstein distance in one dimension via node feature probability distributions, and show how the transport plans of the Wasserstein and Gromov-Wasserstein distances visualize how mass is shifted to transform one network into another. For the Bures-Wasserstein distance, we derive bounds in terms of the Laplacian spectra. Finally, we evaluate these distances using a synthetic network dataset for clustering and a real-world temporal network.
Keywords: optimal transport, transport plan, network comparison
1 Introduction
Networks, or graphs, are fundamental data for complex systems with interacting components, arising in domains ranging from neuroscience and social science to biology and communication systems. Quantifying the distance between graphs has become a key focus in data science, providing a way to measure the dissimilarity of complex relationships and interactions. However, graphs are hard to analyze because they do not live in Euclidean space. Motivated by the Gromov-Hausdorff distance in shape analysis ([6], [24], [25]) – which measures how far two compact metric spaces are from being isometric – several studies have sought to adapt this metric to define the network distance ([7], [8]). Although it is mathematically well-defined pseudo-metric in the set of all graphs, it is NP-hard to compute.
To avoid NP-hard computation, vector- and matrix-based distances have become popular to compare graphs by embedding graphs into vectors or matrices ([40]). Although they are easy to compute, these distances depend on graph size ([18]) or require the graph alignment ([22]). Other graph size-independent distances, like the graph edit distance ([15]) and the graphlet-based distance
James Hyun and François G. Meyer
([36]), are NP-hard to compute. To avoid these bottlenecks of traditional graph distances, optimal transport has emerged as a powerful field for network comparison. We hope that this paper provides practical guidance on the use of transport-based distances in network analysis.
2.1 Graph Theory
An undirected unweighted graph consists of a node set and an edge set . If two nodes and are connected by an edge, we write or . A digraph is a graph whose edges have a specific orientation, indicating a one-way relationship. A connected graph is an undirected graph where a path exists between every pair of nodes. A simple graph is an undirected unweighted graph that contains no self-loops and no more than one edge between two nodes.
An adjacency matrix is a symmetric matrix with entries if and otherwise. We write the degree matrix , and the (combinatorial) Laplacian matrix is a symmetric positive semi-definite matrix, defined as . The multiplicity of the zero eigenvalue of is equal to the number of connected components in an undirected graph ([5]). Throughout, we refer to a graph as a simple graph and write and with , , and , unless otherwise stated. The Laplacian matrices of and are and , respectively, and their spectral decompositions are and . The eigenvalues of and of are in ascending order.
2.2 Optimal Transport
Optimal transport is to compute the minimal cost of moving masses in one probability space to another probability space . The probability measure in the product space whose marginals are and is called a transport plan. If and are probability measures in , then , and represents the mass transported from bin to bin . We denote by the set of all transport plans.
Let be the transport cost from bin to bin for some measurable cost function . The Kantorovich problem minimizes the Frobenius inner product between and over all transport plans in .
(KP)
If we require moving mass from one location to a single target without splitting it, then (KP) becomes the Monge problem.
(MP)
Problem (MP) minimizes the objective function over the transport map such that is the pushforward measure of under . The optimal transport map is called the Monge map.
If is non-atomic and if is convex (, quadratic cost), then the Monge map in one dimension has the closed form , where and are the cumulative distribution functions of and , respectively. Moreover, is monotonic and , where is the identity map ([39]). In a higher dimension, the optimality condition of the transport map and transport plan generalizes to cyclical monotonicity ([2]).
2.3 Sinkhorn Algorithm
For an approximation of the optimal transport plan, the Sinkhorn algorithm ([9], [33]) is a popular fixed-point algorithm. It adds a regularization term to (KP) using the entropy of the distribution .
The Gibbs kernel and the KKT condition in convex analysis reduce the number of unknowns in (KP) by finding and . The algorithm uses fixed point iterations and . Some variants of the Sinkhorn algorithm ([1], [17]) reduce the time complexity to a near-linear time. We refer the reader to Table 1 in [23] for the improvement of algorithms for solving optimal transport problems.
3 Transport Distances Between Networks
3.1 Discrete Network Embedding
Empirical measure One particular case of (KP) widely used in practice is when is the distance matrix where each entry is the distance between the support points of the empirical measures and . This gives the famous probability metric, called the Wasserstein distance.
Definition 1 (Wasserstein Distance, [33]). Let and be probability measures in . For , the -Wasserstein distance between and is defined as
Because compares two graphs and as distributions of node features, causes no conceptual difficulty. Throughout the paper, we study because it bounds by Hölder's inequality under the assumption of
James Hyun and François G. Meyer
bounded supports ([39]). In general, (2) has cubic time complexity ([31]). If and in , then is the metric between the cumulative distribution functions of and ([39]).
The node features and are sorted in ascending order, and (3) is computable in time.
Node feature Any node feature, such as degree, centrality, clustering coefficient, graphlet count, PageRank, etc., can be used in (3) as long as the feature does not blow up under graph perturbation. Fig. 1 shows harmonic centrality used as a feature in the stochastic block model with two communities. When an intra-community edge is removed, the cumulative distribution functions almost overlap, resulting in compared to in the bridge removal case.
(a)

(b)
(c)
(d)
(e)
(f)
Fig. 1. (a) The stochastic block model with two communities, intra-probability , and one bridge (red solid). (b), (c) after a random edge (blue-dashed) and the bridge (red-dashed) removal. (d) The histogram of harmonic centrality of and . (e), (f) The is the area between the cumulative distribution functions of and (gray colored).
Unlike local, structural node features, Laplacian eigenvalues capture the total magnitude of an edge deletion but lose information about where the deletion occurs. The between graphs of the same size stays constant regardless of which edge is removed, making it invariant to the structural placement of the removal for the same-sized graphs.
Proposition 1. Let be a subgraph of , with , and . If and , then .
The full detailed rigorous proof of Proposition 1 is provided in the supplementary material; here, we outline the key ideas of the proof. Specifically, we utilize the interlacing property of the Laplacian spectrum (Proposition 3.2.1 in [5]) and the closed form of when the supports of and have the same cardinality.
Metric measure space Instead of comparing distributions or graph spectra, we can embed a graph into a metric measure space (mm-space) . Here, and are a metric and a measure in , respectively.
Definition 2 (Gromov-Wasserstein Distance, [26]). For , the Gromov-Wasserstein distance between and is
The is a metric in the set of all isomorphism classes of mm-spaces ([26]). The transport plan in aligns two mm-spaces by minimizing internal distance distortion rather than the Euclidean costs. In contrast to , compares spaces with different dimensions or features (e.g., matching a 2D shape to a 3D shape). It is a nonconvex problem, and the closed form is available for and uniform weights in one dimension ([38]). Moreover, it generally lacks a closed form Monge map because the objective function is nonconvex ([13], [27]). In practice, the Sinkhorn algorithm adds a negative entropy term to approximate by computing the entropic regularized distance ([35]).
3.2 Gaussian Network Embedding
Graph signal distribution The between two Gaussians and has a closed form, and the Monge map is the affine transformation , where ([33]). In particular, if the Gaussians have zero mean, then coincides with the Bures distance, a metric in the set of all positive semi-definite matrices ([12], [4]). This closed form is widely used in graph signal processing ([11]) by embedding a graph into a graph signal distribution , where is the Moore-Penrose pseudoinverse.
Definition 3 (Bures-Wasserstein Distance, [32]). The Bures-Wasserstein distance between the graph signal distributions and is
James Hyun and François G. Meyer
In contrast to , is not invariant under node permutation. Swapping rows and columns of the pseudoinverses via a permutation matrix independently alters the value of the distance ([32]). To the best of our knowledge, is the only transport distance with a closed form solution in high dimensions.
Unlike the spectral distance , BW can distinguish some isospectral graphs. In Fig. 2, we compute and BW between non-isomorphic isospectral graphs ([10]). Since BW is a metric in the set of all positive semi-definite matrices, if and only if . Consequently, BW can measure the dissimilarity between isospectral graphs.

(c) Laplacian spectra
(d)
Fig. 2. (a), (b) Example of nonisomorphic isospectral graphs . (c) Same Laplacian spectrum of and . (d) The eigenvector matrices and of and are not aligned and .
Spectral bounds For connected graphs and if and share the same eigenvectors, then ([30]). The eigenvalues of the pseudoinverse of a connected graph's Laplacian matrix are 0 and . We prove the bounds of when the eigenbases are not aligned.
Theorem 1. Let and with be connected graphs. Then
The full detailed rigorous proof of Theorem 1 is provided in the supplementary material; here, we present the core ideas of the proof. We derive the bounds via the matrix generalization of the Hardy-Littlewood-Pólya rearrangement inequality (Theorem 3 in [42]).
Every circulant graph with nodes has the same Laplacian eigenvectors regardless of the number of jumps . The Laplacian matrix is diagonalized by real Fourier basis vectors, and the eigenvalues are for all ([21]).
Corollary 1. Let and be the graph signal distributions of and , respectively. Then
In most cases, the Laplacian eigenvectors are not aligned under graph perturbation. We prove that the gap between the squared distance and the lower bound from Theorem 1 is bounded above by .
Theorem 2. If , with the spectral norm , then
The full detailed rigorous proof of Theorem 2 is provided in the supplementary material. We highlight the key ideas of the proof. Since the lower bound matches the first two terms in (5), we focus on the spectral decomposition of the last term in (5) and apply Weyl's inequality.
4 Numerical Experiments
K-medoids network clustering We evaluate the transport distances on the SYNTHIE dataset ([29]) against the graph edit distance, approximated via bipartite matching ([34]). The dataset contains 400 networks with 90 or 100 nodes each. These graphs have different numbers of edges and fall into four classes. The four classes mix two structural types – made from mixtures of two Erdős-Rényi seed sets – with two attribute types. We compute in (3) using harmonic centrality ( ) and Laplacian eigenvalues ( ). In addition, we use the 15-dimensional node attributes given from the dataset ( ). Since each network in the dataset has no node labels, we label nodes in the order that they appear in the dataset. We zero-pad in BW to keep dimensions consistent. Finally, adopts a diffusion distance ([41]) as the ground metric in (4). All transport distance computations lacking a closed form solution were implemented via the Sinkhorn algorithm in POT library ([14]).
For every distance, we compute the pairwise distance matrix and use a greedy search method, PAM, to cluster the graphs into groups ([19]). We score the network classification against the true labels with ARI, AMI, and V-measure in Table 1. As shown in Fig. 3, , , BW, and have almost the same clustering scores, regardless of which specific mathematical
James Hyun and François G. Meyer
construction (centrality, spectrum, covariance, diffusion) produced the distance. In contrast, the edit distance measures the dissimilarity between the graphs based on their topology but fails to classify this coarse partition. Notably, using dataset node attributes even fails to classify both structural and attribute variations.
Table 1. 4-medoids clustering performance on SYNTHIE by distance
| Clustering Score | Edit distance | (local) | (global) | (attribute) | BW | |
|---|---|---|---|---|---|---|
| ARI | -0.001 | 0.333 | 0.334 | 0.197 | 0.334 | 0.334 |
| AMI | 0.000 | 0.498 | 0.498 | 0.237 | 0.499 | 0.499 |
| V-measure | 0.009 | 0.502 | 0.503 | 0.243 | 0.503 | 0.503 |

Fig. 3. 2D multidimensional scaling plot of SYNTHIE graphs colored by 4-medoids clustering. From left to right, the first row displays clustering for edit distance, , and . The second row displays clustering for , BW, and .
Temporal network: case study The Enron corpus ([20]) contains weekly email networks from roughly 150 senior executives of the Enron corporation. We adapt the code from [28] which computes the resistance perturbation distance, DeltaCon, and between two consecutive weekly email networks. While the original experiment forces a fixed node count across all weeks – padding inactive weeks with isolated nodes – our version builds each week's adjacency matrix using only active senders and receivers for the Wasserstein and Gromov-Wasserstein distances.
As in the clustering experiment, we compare the graphs using the closed form (3) of (between degree distributions), BW, and . The resulting normalized transport distances between consecutive weekly email networks are plotted in Fig. 4. The spiked when no labeled event occurs while remains flat across the entire dataset. However, changes in BW appear to track the weeks with the event labels. We plot the transport plans of and during the week when Dynegy agrees to buy Enron in Fig. 5. We omit the transport map of BW because it maps a continuous vector into a continuous space while lacking any individual node-to-scalar mapping.

Fig. 4. Transport distances (red), BW (black), and (blue) between consecutive Enron email networks from 2000 to 2002.


Fig. 5. The transport plans of and during the week of 2001/11/05 with event label: Dynegy agrees to buy Enron. The normalized distances during that week results are: , BW = 1, and .
James Hyun and François G. Meyer
5 Discussion
The Wasserstein and Gromov-Wasserstein distances measure dissimilarity between networks without the same number of nodes. In contrast, the Bures-Wasserstein distance requires padding zero rows and columns in Laplacian pseudoinverses to match dimensions. In contrast to the Bures-Wasserstein distance, the Wasserstein and Gromov-Wasserstein distances are invariant under node labels. The Wasserstein distance requires network embeddings to share the same metric space, but the Gromov-Wasserstein distance compares networks from heterogeneous metric spaces. They classify topological differences between networks, but fail to capture node attribute differences in our clustering experiment. Unlike traditional graph metrics, these transport distances not only quantify structural differences but also reveal why networks differ through a transport plan. This plan visualizes mass shifts between nodes to pinpoint structural changes.
While our study examines the one-dimensional closed form and the Sinkhorn algorithm for fast computation, computing these distances for large networks in high dimension remains a key challenge. Construction of high-dimensional network embeddings ([16], [3]) that capture both node attributes and graph topology is another future direction. Recent studies also explore the fused Gromov-Wasserstein distance ([37]), which combines the node and topological features using a convex combination. Combining high-dimensional network embeddings with a scalable algorithm for fused Gromov-Wasserstein distance could solve large-scale machine learning problems on networks.
6 Conclusion
By mapping networks into empirical measure, graph signal distribution, and discrete metric measure space, we adapt the Wasserstein, Bures-Wasserstein, and Gromov-Wasserstein distances for network comparison. These distances use closed-form solutions or the Sinkhorn algorithm for fast computation. The transport plans highlight structural differences between two networks. While the Bures-Wasserstein distance does not have node-to-scalar transport map, we derive the spectral bounds in terms of the Laplacian spectra. Altogether, the transport distances allow researchers to compare networks of different sizes via closed-form solutions and visualize the dissimilarity between networks via transport plans.
References
-
Altschuler, J., Bach, F., Rudi, A., Niles-Weed, J.: Massively scalable sinkhorn distances via the nyström method. Advances in neural information processing systems 32 (2019)
-
Ambrosio, L., Gigli, N.: A user's guide to optimal transport. In: Modelling and Optimisation of Flows on Networks: Cetraro, Italy 2009, Editors: Benedetto Piccoli, Michel Rascle, pp. 1–155. Springer (2012)
-
Belkin, M., Niyogi, P.: Laplacian eigenmaps for dimensionality reduction and data representation. Neural computation 15(6), 1373–1396 (2003)
-
Bhatia, R., Jain, T., Lim, Y.: On the bures–wasserstein distance between positive definite matrices. Expositiones mathematicae 37(2), 165–191 (2019)
-
Brouwer, A.E., Haemers, W.H.: Spectra of graphs. Springer Science & Business Media (2011)
-
Burago, D., Burago, Y., Ivanov, S., et al.: A Course in Metric Geometry, vol. 33. American Mathematical Society, Providence, RI (2001)
-
Chowdhury, S., Mémoli, F.: The metric space of networks. arXiv preprint arXiv:1804.02820 (2018)
-
Chowdhury, S., Mémoli, F.: Distances and isomorphism between networks: stability and convergence of network invariants. Journal of Applied and Computational Topology 7(2), 243–361 (2023)
-
Cuturi, M.: Sinkhorn distances: Lightspeed computation of optimal transport. Advances in neural information processing systems 26 (2013)
-
Dam, E.V., Haemers, W.: Which graphs are determined by their spectrum? Linear Algebra and its Applications 373, 241–272 (2003)
-
Dong, X., Thanou, D., Frossard, P., Vandergheynst, P.: Learning laplacian matrix in smooth graph signal representations. IEEE Transactions on Signal Processing 64(23), 6160–6173 (2016)
-
Dowson, D., Landau, B.: The fréchet distance between multivariate normal distributions. Journal of Multivariate Analysis 12(3), 450–455 (1982)
-
Dumont, T., Lacombe, T., Vialard, F.X.: On the existence of monge maps for the gromov–wasserstein problem. Foundations of Computational Mathematics 25(2), 463–510 (2025)
-
Flamary, R., Vincent-Cuaz, C., Courty, N., Gramfort, A., Kachaiev, O., Quang Tran, H., David, L., Bonet, C., Cassereau, N., Gnassounou, T., Tanguy, E., Delon, J., Collas, A., Mazelet, S., Chapel, L., Kerdoncuff, T., Yu, X., Feickert, M., Krzakala, P., Liu, T., Fernandes Montesuma, E., Neike, N., Genest, B., Coeurjolly, D., Germain, T., O'Shea, S., Corneli, M., Genans, F.: Pot python optimal transport (2026). DOI 10.5281/zenodo.17161062. URL https://github.com/PythonOT/POT
-
Gao, X., Xiao, B., Tao, D., Li, X.: A survey of graph edit distance. Pattern Analysis and applications 13(1), 113–129 (2010)
-
Grover, A., Leskovec, J.: node2vec: Scalable feature learning for networks. In: Proceedings of the 22nd ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 855–864 (2016)
-
Huguet, G., Tong, A., Zapatero, M.R., Tape, C.J., Wolf, G., Krishnaswamy, S.: Geodesic sinkhorn for fast and accurate optimal transport on manifolds. In: 2023 IEEE 33rd International Workshop on Machine Learning for Signal Processing (MLSP), pp. 1–6. IEEE (2023)
-
Jovanović, I., Stanić, Z.: Spectral distances of graphs. Linear algebra and its applications 436(5), 1425–1435 (2012)
-
Kaufman, L., Rousseeuw, P.J.: Partitioning Around Medoids (Program PAM), pp. 68–125. John Wiley & Sons, Inc. (2008). DOI 10.1002/9780470316801.ch2. URL http://dx.doi.org/10.1002/9780470316801.ch2
-
Klint, B., Yang, Y.: Introducing the enron corpus. In: CEAS, vol. 45, pp. 92–96 (2004)
-
Kotzagiannidis, M.S., Dragotti, P.L.: Splines and wavelets on circulant graphs. Applied and Computational Harmonic Analysis 47(2), 481–515 (2019)
James Hyun and François G. Meyer
-
Koutra, D., Shah, N., Vogelstein, J.T., Gallagher, B., Faloutsos, C.: Deltacon: Principled massive-graph similarity function with attribution. ACM Transactions on Knowledge Discovery from Data (TKDD) 10(3), 1–43 (2016)
-
Luo, Y., Xie, Y., Huo, X.: Improved rate of first order algorithms for entropic optimal transport. In: International Conference on Artificial Intelligence and Statistics, pp. 2723–2750. PMLR (2023)
-
Mémoli, F.: On the use of gromov-hausdorff distances for shape comparison. In: Eurographics Symposium on Geometry Processing (2007)
-
Mémoli, F.: Gromov-hausdorff distances in euclidean spaces. In: 2008 IEEE Computer Society Conference on Computer Vision and Pattern Recognition Workshops, pp. 1–8. IEEE (2008)
-
Mémoli, F.: Gromov-wasserstein distances and the metric approach to object matching. Foundations of Computational Mathematics 11(4), 417–487 (2011)
-
Mémoli, F., Needham, T.: Comparison results for gromov-wasserstein and gromov-monge distances. ESAIM: Control, Optimisation and Calculus of Variations 30, 78 (2024)
-
Monnig, N.D., Meyer, F.G.: The resistance perturbation distance: A metric for the analysis of dynamic networks. Discrete Applied Mathematics 236, 347–386 (2018)
-
Morris, C., Kriege, N.M., Kersting, K., Mutzel, P.: Faster kernels for graphs with continuous attributes via hashing. In: 2016 IEEE 16th International Conference on Data Mining (ICDM), pp. 1095–1100. IEEE (2016)
-
Panaretos, V.M., Zemel, Y.: An invitation to statistics in Wasserstein space. Springer (2020)
-
Pele, O., Werman, M.: Fast and robust earth mover's distances. In: 2009 IEEE 12th International Conference on Computer Vision, pp. 460–467. IEEE (2009)
-
Petric Maretic, H., El Gheche, M., Chierchia, G., Frossard, P.: Got: an optimal transport framework for graph comparison. Advances in Neural Information Processing Systems 32 (2019)
-
Peyré, G., Cuturi, M., et al.: Computational optimal transport: With applications to data science. Foundations and Trends in Machine Learning 11(5-6), 355–607 (2019)
-
Riesen, K., Bunke, H.: Approximate graph edit distance computation by means of bipartite graph matching. Image and Vision computing 27(7), 950–959 (2009)
-
Rioux, G., Goldfeld, Z., Kato, K.: Entropic gromov-wasserstein distances: Stability and algorithms. Journal of machine learning research 25(363), 1–52 (2024)
-
Tantardini, M., Ieva, F., Tajoli, L., Piccardi, C.: Comparing methods for comparing networks. Scientific Reports 9(1), 17,557 (2019)
-
Vayer, T., Chapel, L., Flamary, R., Tavenard, R., Courty, N.: Fused gromov-wasserstein distance for structured objects. Algorithms 13(9), 212 (2020)
-
Vayer, T., Flamary, R., Courty, N., Tavenard, R., Chapel, L.: Sliced gromov-wasserstein. In: Advances in Neural Information Processing Systems, vol. 32 (2019)
-
Villani, C.: Topics in Optimal Transportation, Graduate Studies in Mathematics, vol. 58. American Mathematical Society, Providence, RI (2021)
-
Wills, P., Meyer, F.: Metrics for graph comparison: a practitioner's guide. PLoS ONE 15(2), e0228,728 (2020)
-
Xiao, B., Wilson, R.C., Hancock, E.R.: Characterising graphs using the heat kernel. In: Proc. BMVC, pp. 92–1 (2005)
-
Yue, M.C.: A matrix generalization of the hardy-littlewood-pólya rearrangement inequality and its applications: M. yue. Journal of Optimization Theory and Applications 208(2), 64 (2026)
A Supplementary Material
A.1 Proof of Proposition 1
Proposition 1. Let be a subgraph of , with , and . If and , then
Proof. Let and be the Laplacian matrices of and , respectively. Since only one edge, say , is removed, the perturbed Laplacian matrix is written as
Here, is the th standard basis vector, and the outer product is a rank-1 matrix with eigenvalues 2 and 0 with respective algebraic multiplicity of 1 and . The eigenvalues of interleave with the eigenvalues of (Proposition 3.2.1 in [5]):
For each , . Using the closed form (Remark 2.28 in [33]),
Hence, it is proved.
James Hyun and François G. Meyer
A.2 Proof of Theorem 1
Theorem 1. Let and with be connected graphs. Then
Proof. Let . Taking the Moore-Penrose pseudoinverse and square root of the spectral decompositions and ,
Set and rewrite M.
Since eigenvalues are invariant under an orthogonal transformation,
We invoke the matrix generalization of the Hardy-Littlewood-Pólya rearrangement inequality (Theorem 3 in [42]). Define for s > 0. Then f is differentiable in , is increasing, and f is right-continuous at 0. Hence, for positive semi-definite matrices and ,
Since , , and ,
By Spectral Mapping Theorem, . Now, we substitute the chain of inequalities in the Bures-Wasserstein distance. For the lower bound,
Similarly for the upper bound,
Therefore, it is proved.
A.3 Proof of Theorem 2
Theorem 2. If , with the spectral norm , then
Proof. Let . Subtracting the lower bound in Theorem 1 from the squared Bures-Wasserstein distance,
Here, . Assume that , with . Inserting in ,
Write the diagonal matrix and
By triangle inequality and the submultiplicative property of the spectral norm,
By Weyl's inequality,
Taking the square root,
Multiplying both sides by 2 and taking the sum gives the desired result.