Towards Graph Pooling by Edge Contraction

Thomas Brunner Frederik Diehl, Alois KnollmediaTUM 2019

Abstract

Graph Neural Networks (GNNs) research has concentrated on improving convolutional layers, with little attention paid to developing graph pooling layers. Yet pooling layers can enable GNNs to reason over abstracted groups of nodes instead of single nodes, thus increasing their generalization potential. To close this gap, we propose a graph pooling layer relying on the notion of edge contraction: EdgePool learns a localized and sparse pooling transform. We evaluate it on four datasets, finding that it increases performance on the three largest. We also show that EdgePool can be integrated in existing GNN architectures without adding any additional losses or regularization.

Introduction

In Convolutional Neural Networks (CNNs), pooling layers are fundamental for building spatial hierarchies and capturing multi-scale features. In the graph domain, however, pooling is significantly more challenging due to the irregular structure of the data. Existing graph pooling methods typically fall into two categories: global/dense pooling and top-k/sparse pooling. Dense methods like DiffPool learn soft clusters but suffer from quadratic complexity ($O(n^2)$), making them unsuitable for large-scale graphs. Sparse methods like gPool are efficient but risk losing critical structural information by discarding nodes entirely.

We introduce EdgePool, a sparse pooling method based on edge contraction that maintains structural integrity while scaling linearly with the number of edges.

Methodology: EdgePool via Edge Contraction

The fundamental operation of EdgePool is edge contraction. Instead of selecting nodes to retain or discard, the model identifies edges to merge. When an edge between two nodes is contracted, they are fused into a single node that inherits the connectivity of both original nodes. This ensures that no part of the graph is simply deleted; even isolated nodes can be preserved as singletons.

The edge contraction process: high-scoring edges (indicated by thick lines) are selected and merged to form a coarsened graph representation.

The EdgePool layer operates in three distinct phases:

  1. Scoring: A raw score is computed for every edge using a linear transformation of the concatenated features of its incident nodes. These scores are then normalized (e.g., via tanh or softmax).
  2. Selection: Edges are sorted by their scores, and a greedy selection process identifies edges for contraction. To maintain locality and simplicity, each node is restricted to participating in at most one contraction per layer.
  3. Merging: The features of the merged nodes are combined using a gating mechanism where the sum of the features is scaled by the learned edge score.

Architecture and Integration

One of the primary advantages of EdgePool is its "plug-and-play" nature. Unlike many advanced pooling methods, it does not require auxiliary losses (such as link prediction or entropy regularization) to stabilize training. It can be integrated directly into standard GNN backbones like GraphSAGE or GCN.

The GNN architecture used for evaluation, illustrating the modular block structure (left) and the hierarchical pooling sequence (right).

As shown in the architecture above, EdgePool layers are interleaved with convolutional blocks. This hierarchical structure allows the network to learn increasingly abstract representations of the graph. Because the operation is sparse and localized, it is highly memory-efficient, capable of processing graphs with hundreds of thousands of nodes where dense methods would fail.

Experimental Results

We evaluated EdgePool across four graph classification benchmarks: PROTEINS, REDDIT-BINARY (RDT-B), REDDIT-MULTI-12K (RDT-12K), and COLLAB.

  • Performance: EdgePool consistently outperformed non-pooling baselines and existing pooling methods (DiffPool, TopKPool) on the three largest datasets. The most notable improvement was on RDT-B, where EdgePool achieved 87.4% accuracy, a significant jump from the 70.4% baseline.
  • Efficiency: EdgePool demonstrated superior scalability. While dense methods like DiffPool hit memory limits at approximately 18,000 nodes, EdgePool successfully processed graphs exceeding 300,000 nodes on standard hardware.
  • Compatibility: While EdgePool showed strong synergy with GraphSAGE and GCN, results with GIN (Graph Isomorphism Network) were mixed, suggesting that the interaction between specific convolution types and edge-based pooling warrants further study.

Conclusion

EdgePool provides a robust, scalable, and informative alternative to existing graph pooling techniques. By leveraging edge contraction, it preserves graph structure more effectively than node-dropping methods while avoiding the computational bottlenecks of dense clustering. Future work will explore its application in node classification and the incorporation of explicit edge features, such as chemical bond types in molecular graphs.

Summary updated

BibTeX
@inproceedings{diehl2019towards,
  author = {Thomas Brunner Frederik Diehl and Alois Knoll},
  title = {{Towards Graph Pooling by Edge Contraction}},
  booktitle = {mediaTUM},
  year = {2019},
}
Figure