BCGL: Binary Classification-Based Graph Layout

Kai Yan, Tiejun Zhao, Muyun Yang

Abstract

BCGL (Binary Classification-based Graph Layout) reformulates the graph layout problem as an edge classification task, where vertex coordinates are treated as trainable parameters. By optimizing these coordinates to "predict" whether an edge exists between node pairs, the framework produces layouts that excel at local neighborhood preservation and human readability without the high computational cost of traditional similarity matrices.

Introduction

Visualizing complex graphs is a balancing act. You want to show the "big picture" (global structure) while ensuring that local connections (who is connected to whom) are clear. Traditional force-directed methods (like Fruchterman-Reingold) are intuitive but often get stuck in local minima, failing to preserve local neighborhoods. Dimensionality reduction (DR) methods (like t-SNE or MDS) are powerful but computationally expensive; they typically require an "all-pairs shortest path" similarity matrix, which is a nightmare to calculate for large graphs.

The authors identify a specific gap: how do we create a layout that helps a human reader accurately "reconstruct" the graph in their mind? If two nodes are placed close together, a reader naturally assumes they are connected. BCGL aims to make that assumption true as often as possible.

Methods

The core innovation of BCGL is treating graph layout as a machine learning optimization problem.

The BCGL framework treats vertex coordinates as trainable parameters in an edge classification task.
  1. Layout as a Classifier: The authors define a binary classifier where the input is a pair of vertices and the output is the probability that an edge exists between them.
  2. Trainable Coordinates: Unlike standard ML where you train weights, here the "weights" are the actual 2D coordinates of the vertices.
  3. The Loss Function: They use a logistic regression framework (Binary Cross-Entropy). The goal is to maximize the probability of edge existence for connected pairs while minimizing it for unconnected pairs.
  4. Probability Distributions: The authors implement two versions: BCGL-G (Gaussian) for uniform vertex placement and BCGL-T (Student’s t-distribution) to help alleviate the "crowding problem" by allowing more room for local clusters to spread out.
  5. Optimization & Scalability: To handle large graphs, they use a multilevel strategy (coarsening the graph into smaller versions, laying them out, and then refining) combined with Stochastic Gradient Descent (SGD). This approach does not require a pre-computed similarity matrix, making it more scalable than many DR-based methods.

Key Insights and Ideas

  • The "Reestablishment" Perspective: A "good" layout is one that functions as an accurate edge predictor. This shifts the focus from abstract energy minimization to human-centric recognition.
  • Implicit Forces: By taking the partial derivative of the classification loss, the authors show that BCGL naturally generates "attractive" forces for edges and "吸引" forces for non-edges, effectively bridging the gap between force-directed and classification-based logic.
  • Efficiency via Sparsity: Because BCGL focuses on edge existence rather than global graph-theoretical distances, it avoids the $O(V^3)$ or $O(V^2 \log V)$ cost of calculating all-pairs shortest paths.

Key Results

Qualitatively, BCGL produces "cleaner" local structures. In tree-like graphs, it distributes leaf nodes more evenly than tsNET, which tends to clump them too tightly. Quantitatively, BCGL-T consistently outperformed state-of-the-art methods like tsNET and DRGraph in the Neighborhood Preservation Metric (NPM). For regular grid datasets, BCGL achieved a perfect 100% NPM score.

Visual comparison of BCGL-G and BCGL-T against baseline methods across various graph datasets.

BCGL is also significantly faster than tsNET-style algorithms. While tsNET can spend up to 30% of its time just calculating the distance matrix, BCGL skips this step entirely, running in seconds on datasets where others take minutes. The layouts also scored highly on "crosslessness" and "minimum angle" metrics, indicating they are visually pleasing.

Limitations and Future Work

  • Complex Local Structures: BCGL struggles with structures like triangles and small cliques. Because the model relies on pairwise distances, a dense cluster of triangles can "break" the local neighborhood logic.
  • Global Topology: In some cases, like the G65 torus, BCGL prioritizes local edge accuracy so much that the overall global shape is lost compared to methods that look at the whole graph structure.
  • Future Directions: The authors plan to investigate how to incorporate higher-order structures (like triangles) into the classification loss and how to better handle extremely sparse graphs.

Summary updated

Abstract

Graph layouts reveal global or local structures of graph data. However, there are few studies on assisting readers in better reconstructing a graph from a layout. This paper attempts to generate a layout whose edges can be reestablished. We reformulate the graph layout problem as an edge classification problem. The inputs are the vertex pairs, and the outputs are the edge existences. The trainable parameters are the laid-out coordinates of the vertices. We propose a binary classification-based graph layout (BCGL) framework in this paper. This layout aims to preserve the local structure of the graph and does not require the total similarity relationships of the vertices. We implement two concrete algorithms under the BCGL framework, evaluate our approach on a wide variety of datasets, and draw comparisons with several other methods. The evaluations verify the ability of the BCGL in local neighborhood preservation and its visual quality with some classic metrics.
BibTeX
@article{yan2022bcgl,
  author = {Kai Yan and Tiejun Zhao and Muyun Yang},
  title = {{BCGL: Binary Classification-Based Graph Layout}},
  journal = {IEICE Trans. Information and Systems},
  year = {2022},
  doi = {10.1587/transinf.2021edp7260},
}
Figure