Semi-relaxed Gromov Wasserstein divergence with applications on graphs

Cédric Vincent-Cuaz, Rémi Flamary, Marco Corneli, Titouan Vayer, Nicolas Courty

Abstract

Comparing structured objects such as graphs is a fundamental operation involved in many learning tasks. To this end, the Gromov-Wasserstein (GW) distance, based on Optimal Transport (OT), has proven to be successful in handling the specific nature of the associated objects. More specifically, through the nodes connectivity relations, GW operates on graphs, seen as probability measures over specific spaces. At the core of OT is the idea of conservation of mass, which imposes a coupling between all the nodes from the two considered graphs. We argue in this paper that this property can be detrimental for tasks such as graph dictionary or partition learning, and we relax it by proposing a new semi-relaxed Gromov-Wasserstein divergence. Aside from immediate computational benefits, we discuss its properties, and show that it can lead to an efficient graph dictionary learning algorithm. We empirically demonstrate its relevance for complex tasks on graphs such as partitioning, clustering and completion.

Introduction

Graph comparison is a cornerstone of modern machine learning, yet traditional methods often struggle with the structural complexity of these objects. The Gromov-Wasserstein (GW) distance has gained popularity by treating graphs as probability distributions over nodes and matching them based on internal connectivity. However, a significant limitation of standard GW is the "conservation of mass" constraint, which forces a correspondence between every node in the source graph and the target graph. This global matching requirement is often suboptimal for real-world scenarios involving noisy data, unbalanced structures, or subgraph matching.

The Semi-relaxed Gromov-Wasserstein (srGW) Divergence

To overcome these limitations, we propose the semi-relaxed Gromov-Wasserstein (srGW) divergence. By relaxing the mass conservation constraint on the target graph, srGW allows the target node weights to be optimized within the probability simplex. This shift transforms graph comparison into a projection-like operation: a source graph is matched against the most structurally similar subgraph of the target.

Comparison of standard GW (left) and srGW (middle, right) matchings. While GW forces a full coupling, srGW identifies relevant subgraphs by optimizing target weights, resulting in lower divergence scores for structural matches.

This relaxation provides several key advantages:

  • Partial Matching: The algorithm can effectively "ignore" outliers or irrelevant portions of the target graph.
  • Automatic Cluster Discovery: In partitioning tasks, srGW does not require prior knowledge of cluster proportions; it discovers them automatically by optimizing the target distribution.
  • Regularization Flexibility: We introduce entropic and sparsity-promoting penalties (such as $L_{1/2}$) to further refine the matching process, which is particularly useful for tasks like graph completion.

Computational Efficiency

Contrary to the typical trade-off where increased model flexibility leads to higher complexity, srGW is significantly faster than standard GW. We utilize a Conditional Gradient (CG) solver where the subproblems are independent across rows. This architecture is highly parallelizable, allowing srGW to achieve computational speedups of up to 1000x on both CPU and GPU architectures, making it viable for large-scale graph dictionary learning.

Empirical Results

We evaluated srGW across a variety of tasks, including graph partitioning, clustering, and completion, using datasets ranging from social networks (IMDB) to bioinformatics (MUTAG, PROTEIN).

Graph Partitioning and Dictionary Learning

In partitioning experiments, srGW consistently outperformed standard GW-based methods (GWL and SpecGWL) and often surpassed specialized community detection algorithms like Louvain. By mapping complex graphs to simple "atoms" or identity matrices, srGW achieves near-perfect clustering scores.

srGW applied to graph partitioning, mapping a complex graph structure to a simplified representation (identity matrix $I_4$) to identify clusters with perfect Adjusted Mutual Information (ami=1.0).

Clustering and Completion

On benchmark datasets like MUTAG and BZR, srGW variants achieved state-of-the-art performance in clustering quality (measured by the Rand Index). Furthermore, in graph completion tasks, the use of sparsity regularization allowed srGW to predict missing edges more accurately than previous state-of-the-art methods like GDL, effectively preventing overfitting on small observed subgraphs.

Conclusion

The semi-relaxed Gromov-Wasserstein divergence offers a flexible, robust, and computationally superior alternative to standard GW for graph-based learning. By relaxing strict transport constraints, srGW enables more natural structural comparisons, paving the way for advanced applications in community detection and graph representation learning.

Summary updated

BibTeX
@inproceedings{vincentcuaz2022semi,
  author = {Cédric Vincent-Cuaz and Rémi Flamary and Marco Corneli and Titouan Vayer and Nicolas Courty},
  title = {{Semi-relaxed Gromov Wasserstein divergence with applications on graphs}},
  booktitle = {International Conference on Learning Representations},
  year = {2022},
  url = {https://openreview.net/forum?id=b0lXRuEvmav},
}
Figure