Graph Comparison via Optimal Transport

This direction is merged into another direction: graph-based optimal transport. Its last version stays readable and citable here.

Version 1 of 142 papers57 conceptsfrozen 2026-10-04

Traditional methods for comparing graphs often face a difficult trade-off. On one hand, graph kernels and Graph Neural Networks (GNNs) typically rely on "pooling" operations—like sum or mean—that squash a graph's rich structural information into a single, fixed-length vector. This process is inherently lossy, often erasing the fine-grained topological nuances that distinguish one graph from another. On the other hand, exact graph matching or subgraph isomorphism is computationally prohibitive (NP-hard), making it impractical for large-scale applications.

A growing body of research suggests a third way: treating graphs as probability distributions of node embeddings and using Optimal Transport (OT) to measure the distance between them. By shifting from rigid structural matching to fluid distributional alignment, researchers are achieving state-of-the-art results in tasks ranging from protein-protein interaction (PPI) alignment to cross-modal retrieval.

Graphs as Point Clouds

The core intuition behind this direction is to stop viewing a graph as a static adjacency matrix and start viewing it as a "point cloud" in an embedding space. In this framework, each node is a point, and its position is determined by its features and its local neighborhood.

Instead of aggregating these points into a single average, researchers like Matteo Togninalli and Karsten Borgwardt in Wasserstein Weisfeiler-Lehman Graph Kernels propose representing the entire graph as a discrete probability distribution. When we compare two graphs, we are no longer looking for a perfect one-to-one node mapping. Instead, we are calculating the Wasserstein distance (also known as the Earth Mover’s Distance), which represents the minimum "work" required to transform one node distribution into another.

This approach, as noted by Tong Zhang in Deep Wasserstein Graph Discriminant Learning for Graph Classification, is superior to Euclidean metrics because it accounts for the global distribution of features. It allows for a "soft" alignment where one node in the first graph can be partially matched to several similar nodes in the second, capturing structural correspondences that are invisible to standard pooling.

Bridging Modalities with Gromov-Wasserstein

One of the most powerful applications of this theory is in cross-modal alignment—for example, matching a visual "scene graph" from an image to a "dependency graph" from a text caption. The challenge here is that the nodes in the visual graph (pixels/objects) and the textual graph (words/entities) live in entirely different feature spaces.

To solve this, researchers like Yi Cai and Li Yuan utilize the Gromov-Wasserstein (GW) distance. As detailed in Joint Multimodal Entity-Relation Extraction Based on Edge-enhanced Graph Alignment Network, the GW distance doesn't compare the node features directly. Instead, it compares the relational structures within each graph. It asks: "Does the relationship between Object A and Object B in the image look like the relationship between Word X and Word Y in the sentence?"

This mechanism allows CLIP-Event and SSIC-WGM to align disparate modalities even when they have different node counts or distinct topological configurations.

Solving the Size Generalization Problem

A persistent weakness of Message Passing Neural Networks (MPNNs) is their inability to generalize to graphs of different sizes; a model trained on small molecules often fails when tested on large ones. Xu Chu and Xin Wang address this in Wasserstein Barycenter Matching for Graph Size Generalization of Message Passing Neural Networks.

By representing each class of graphs as a Wasserstein Barycenter—a "mathematical average" graph in the OT space—the model can classify a new graph based on its distance to these templates. Because this distance is calculated between distributions rather than fixed vectors, it is naturally invariant to the number of nodes. This allows the model to decouple its representation from the absolute scale of the data, leading to significant performance gains in size generalization.

Efficiency and Scalability

While OT is mathematically elegant, it is historically computationally expensive. Recent work has focused on making these methods scalable for real-world datasets. Lingfei Wu 0001 and colleagues introduced Random Graph Embeddings (RGE), which uses a "random features" approximation to compute the Earth Mover's Distance in quasi-linear time. Similarly, Tam Le developed Generalized Sobolev Transport, which achieves massive speedups by reducing the complex OT optimization into a simpler univariate problem.

Beyond Classification: Explainability and Biology

The utility of graph-based OT extends into interpretability and specialized domains:

  • Explainability: Lukas Faber uses OT in Contrastive Graph Neural Network Explanation to compare target graphs to real training examples, ensuring that model explanations remain "distribution compliant" rather than generating unrealistic artifacts.
  • Medical Diagnostics: In scACCorDiON, James S. Nagai applies OT to compare cell-cell communication graphs across patient cohorts, identifying disease subtypes by visualizing how cellular "conversations" shift.
  • Gaze Estimation: Shaonan Liu uses a Sinkhorn operator (a fast OT solver) in GEM to align predicted radiologist gaze patterns with ground truth, treating the search behavior as a graph-matching problem.

By treating graphs as distributions and similarity as a transport problem, this research direction provides a robust, mathematically grounded framework for understanding the complex, non-Euclidean structures that define our world.

Papers in this version

History & citationVersion 1 · 2026-10-04

Merged into another direction · Permanent link

View frozen version 1

Cite this direction

Latest version (a living page):

@misc{lacuna_graph_comparison_via_optimal_transport_72c441f7,
  title = {Graph Comparison via Optimal Transport},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/graph-comparison-via-optimal-transport/rdr_72c441f74d4a4df6b0dc975ebe968a99},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-11-27},
}

This exact version (version 1, frozen text):

@misc{lacuna_graph_comparison_via_optimal_transport_72c441f7_v1,
  title = {Graph Comparison via Optimal Transport},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/graph-comparison-via-optimal-transport/rdr_72c441f74d4a4df6b0dc975ebe968a99/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-11-27},
}