Table of Contents
Fetching ...

GNNs Getting ComFy: Community and Feature Similarity Guided Rewiring

Celia Rubio-Madrigal, Adarsh Jamadandi, Rebekka Burkholz

TL;DR

Addresses over-squashing in GNNs by examining how spectral-gap rewiring interacts with latent community structure and graph-task alignment. Proposes three task-aware rewiring families—ComMa, FeaSt, and ComFy—grounded in SBM theory to optimize label-community alignment and feature similarity. Theoretical results link spectral gap to community strength and alignment, while extensive experiments show FeaSt excels in homophilic graphs and ComFy in heterophilic ones, with ComMa offering fast performance improvements. The work demonstrates that combining topology and feature similarity yields more reliable GNN performance across diverse graph types, paving the way for alignment-aware rewiring strategies.

Abstract

Maximizing the spectral gap through graph rewiring has been proposed to enhance the performance of message-passing graph neural networks (GNNs) by addressing over-squashing. However, as we show, minimizing the spectral gap can also improve generalization. To explain this, we analyze how rewiring can benefit GNNs within the context of stochastic block models. Since spectral gap optimization primarily influences community strength, it improves performance when the community structure aligns with node labels. Building on this insight, we propose three distinct rewiring strategies that explicitly target community structure, node labels, and their alignment: (a) community structure-based rewiring (ComMa), a more computationally efficient alternative to spectral gap optimization that achieves similar goals; (b) feature similarity-based rewiring (FeaSt), which focuses on maximizing global homophily; and (c) a hybrid approach (ComFy), which enhances local feature similarity while preserving community structure to optimize label-community alignment. Extensive experiments confirm the effectiveness of these strategies and support our theoretical insights.

GNNs Getting ComFy: Community and Feature Similarity Guided Rewiring

TL;DR

Addresses over-squashing in GNNs by examining how spectral-gap rewiring interacts with latent community structure and graph-task alignment. Proposes three task-aware rewiring families—ComMa, FeaSt, and ComFy—grounded in SBM theory to optimize label-community alignment and feature similarity. Theoretical results link spectral gap to community strength and alignment, while extensive experiments show FeaSt excels in homophilic graphs and ComFy in heterophilic ones, with ComMa offering fast performance improvements. The work demonstrates that combining topology and feature similarity yields more reliable GNN performance across diverse graph types, paving the way for alignment-aware rewiring strategies.

Abstract

Maximizing the spectral gap through graph rewiring has been proposed to enhance the performance of message-passing graph neural networks (GNNs) by addressing over-squashing. However, as we show, minimizing the spectral gap can also improve generalization. To explain this, we analyze how rewiring can benefit GNNs within the context of stochastic block models. Since spectral gap optimization primarily influences community strength, it improves performance when the community structure aligns with node labels. Building on this insight, we propose three distinct rewiring strategies that explicitly target community structure, node labels, and their alignment: (a) community structure-based rewiring (ComMa), a more computationally efficient alternative to spectral gap optimization that achieves similar goals; (b) feature similarity-based rewiring (FeaSt), which focuses on maximizing global homophily; and (c) a hybrid approach (ComFy), which enhances local feature similarity while preserving community structure to optimize label-community alignment. Extensive experiments confirm the effectiveness of these strategies and support our theoretical insights.

Paper Structure

This paper contains 31 sections, 3 theorems, 18 equations, 12 figures, 21 tables, 6 algorithms.

Key Result

Theorem 1

Let $G$ be a ($p$-$q$)-SBM with $N$ nodes in 2 equally-sized communities and intra/inter-edge probabilities $p > q$. Let $G^{\text{del}}$ be a ($p'$-$q$)-SBM where $p'<p$, and $G^{\text{add}}$ be a ($p$-$q'$)-SBM where $q'>q$. The (expected) spectral gap of $G$ is smaller than those of $G^{\text{del

Figures (12)

  • Figure 1: Behaviour of the proposed algorithms on a 2-cluster graph for $k$ edge modifications. Columns denote our methods and their variants (see §\ref{['s:algs']}, §\ref{['app:algs']}). Rows indicate 3 edge areas used for budgeting across the graph — except for FeaSt, which is global. The (latent) clusters are precomputed via Louvain. ComMa randomly draws edges from all intra or all inter-cluster areas, which is equivalent to drawing from each area with a proportional budget in expectation. This insight is translated to ComFy, but the edges are not drawn randomly but prioritized similarly to FeaSt.
  • Figure 2: Adjacency matrices of $(p,q)$-SBM for different alignments. Shaded areas are intra-community edges drawn with probability $p$ (except self-loops), and unshaded areas are inter-community edges drawn with probability $q$. In Figure \ref{['fig:perfalign']}, the two communities match classes $c_1$ (orange) and $c_2$ (purple). In Figure \ref{['fig:twothirdsalign']}, a third of nodes in each community are of the opposite class.
  • Figure 3: The effects of \ref{['th:sbmsgproof']} (for the spectral gap) and Theorems \ref{['th:sbmperfproof']}, \ref{['th:sbmnoiseproof']} (for accuracy) on 1000-node SBM-$(p,q)$. Each SBM has different $p$ and $q$, where $p = \{0.5,0.7,0.8,0.99\}$ and $q = \{0.2,0.5\}$, and different alignment between the labels and the communities: $\{0.9,0.95,1\}$, as well as an example of $0.6$ alignment which gets practically null performance. The spectral gap correlates perfectly with $-\frac{p-q}{p+q}$, and negatively with the community structure and the homophily with perfect alignment. Thus, it is equivalent to plot Figure \ref{['fig:accssbm']} with any of these as the x-axis.
  • Figure 4: Maximizing the spectral gap (using jamadandi2024spectral) on Cora and Citeseer reduces both the graph-task alignment and the test accuracy. Labels denote the number of edge additions.
  • Figure 5: Alignment matrices for Cora (homophilic) and Chameleon (heterophilic) by a 500-edge rewiring method. In each row: spectral minimization and maximization from jamadandi2024spectral, and random rewiring. In each column: additions and deletions. Each alignment matrix compares the number of edges added/deleted in terms of the type of nodes it connects: with the Same or Different L(abel), and with the Same or Different C(ommunity).
  • ...and 7 more figures

Theorems & Definitions (6)

  • Theorem 1: A less pronounced community structure corresponds to a higher spectral gap
  • Theorem 2: A less pronounced community structure harms performance — if high graph-task alignment
  • Theorem 3: The effect of different alignments on performance
  • proof
  • proof
  • proof