Deep Graph Mapper: Seeing Graphs through the Neural Lens
Abstract
Recent advancements in graph representation learning have led to the emergence of condensed encodings that capture the main properties of a graph. However, even though these abstract representations are powerful for downstream tasks, they are not equally suitable for visualization purposes. In this work, we merge Mapper, an algorithm from the field of Topological Data Analysis (TDA), with the expressive power of Graph Neural Networks (GNNs) to produce hierarchical, topologically-grounded visualizations of graphs. These visualizations do not only help discern the structure of complex graphs but also provide a means of understanding the models applied to them for solving various tasks. We further demonstrate the suitability of Mapper as a topological framework for graph pooling by mathematically proving an equivalence with Min-Cut and Diff Pool. Building upon this framework, we introduce a novel pooling algorithm based on PageRank, which obtains competitive results with state of the art methods on graph classification benchmarks.
Introduction: The Challenge of Graph Visualization
As graph datasets grow in size and complexity, standard visualization tools often fail to provide meaningful insights. Traditional force-directed layouts frequently result in "hairballs"—dense, overlapping clusters of nodes and edges that obscure the underlying structure. While Graph Neural Networks (GNNs) excel at learning high-dimensional representations for tasks like node classification, these representations are often "black boxes" that are difficult for humans to interpret.
There is a critical need for tools that can simultaneously summarize complex graph structures, reduce visual clutter, and provide a window into the model's internal logic. Deep Graph Mapper (DGM) addresses this by bridging Topological Data Analysis (TDA) with deep learning.
The Deep Graph Mapper Pipeline
The core of this work is the adaptation of the Mapper algorithm. Mapper is a TDA tool designed to summarize high-dimensional data by capturing its "shape." The DGM pipeline replaces traditional, rigid graph-theoretic lenses with learnable GNNs.
The process follows several key steps:
- Lens Function: A GNN (supervised or unsupervised) maps the graph nodes to a lower-dimensional space (typically $\mathbb{R}$ or $\mathbb{R}^2$).
- Covering: This lower-dimensional space is covered with a set of overlapping intervals (bins).
- Clustering: For each bin, the original nodes mapped to it are clustered based on their connectivity in the original graph.
- Summary Graph: A new graph is constructed where each node represents a cluster, and edges connect clusters that share common nodes from the original graph.
By using GNNs as lenses, DGM can incorporate both structural information and node features. Furthermore, because the GNN can be trained for specific tasks, the resulting visualization can be tuned to highlight features relevant to that task, such as class separation.
Graph Pooling via Mapper
Beyond visualization, the authors provide a significant theoretical contribution by proving that the Mapper algorithm is a mathematical generalization of soft-cluster assignment pooling methods, such as Min-Cut and DiffPool. This insight reveals that graph pooling is essentially a form of topological summarization.
Building on this, the paper introduces Mapper-based PageRank (MPR) Pooling. This novel layer uses a normalized PageRank score as the lens function to identify node importance. Nodes with similar PageRank scores are grouped into clusters using Mapper’s overlapping intervals to coarsen the graph. Unlike many pooling methods that rely on learnable parameters for clustering, MPR leverages the intrinsic topology of the graph.
Key Results
The authors evaluated DGM and MPR across several benchmarks:
- Visualization: On citation networks like Cora and CiteSeer, DGM successfully organized graphs into semantically separated clusters, revealing structures that traditional algorithms missed. It also served as a "visual debugger," allowing researchers to see where models confused different classes.
- Graph Classification: The MPR pooling algorithm was tested on biological (D&D, Proteins) and social (Collab, Reddit-Binary) networks. MPR achieved state-of-the-art or highly competitive results, notably reaching 78.2% accuracy on D&D and 81.5% on Collab, proving that TDA-inspired pooling is practically viable.
Conclusion
Deep Graph Mapper provides a powerful framework for both visualizing and coarsening graphs. By grounding GNN representations in topological principles, it offers a path toward more interpretable and structurally-aware graph models. Future work aims to make the "pull-back cover" operations fully differentiable, allowing for end-to-end learning of the lens and cover parameters.
Summary updated