LayoutGKN: Graph Similarity Learning of Floor Plans

Casper van Engelenburg, Jan van Gemert, Seyran KhademiarXiv 2025

TL;DR

LayoutGKN introduces an efficient graph similarity learning framework for floor plans by decoupling graph embedding from similarity computation. By replacing slow, layer-by-layer cross-graph matching with independent node embeddings and a differentiable graph kernel at the very end, it matches the accuracy of state-of-the-art methods while delivering a massive 20x speedup at inference time.

What Problem Does This Paper Address?

When analyzing or retrieving architectural floor plans, researchers often represent layouts as graphs where rooms are nodes and doors/walls are edges. Comparing these graphs is essential for applications like automated floor plan search, clustering, and design visualization.

To do this accurately, standard Graph Matching Networks (GMNs) compute cross-graph node-level interactions at every single layer of the network. While highly precise, this approach creates a severe computational bottleneck: because the embedding of one floor plan depends on the floor plan it is being compared to, embeddings cannot be precomputed offline. If you have a database of thousands of floor plans, you have to run the entire network pairwise for every query, making real-time search engines painfully slow.

Methods

The authors propose LayoutGKN (Graph Kernel Network), which postpones cross-graph node-level interactions to the very end of the pipeline.

Figure 1. Joint embeddings architectures for graph similarity learning. (Left) Graph embeddings networks (GENs) independently embed graphs G1 and G2 in a vector space using parameter-shared graph networks (gray box) followed by pooling (orange box). The similarity s is computed based on the vector embeddings. (Middle) In addition to GENs, graph matching networks (GMNs) model cross- graph node-level interactions (blue arrows) between the two sets of node features in each layer. Embeddings (Hi) depend on the other. (Right) Our graph kernel network (GKN) shifts node-level interactions to the similarity function via a graph kernel (green box), enabling independent embeddings while preserving node-level interactions.

The architecture consists of two main stages:

  1. Independent Feature Learning: Floor plans are converted into richly attributed graphs containing room functions (e.g., kitchen, balcony), room shapes (area, perimeter, center coordinates), and a shortest-path histogram matrix. A standard Message Passing Network (MPN) processes each graph independently to generate final node-level embeddings. Because there are no cross-graph interactions here, these embeddings can be computed and stored offline.
  2. Postponed Node Interactions via Graph Kernels: To compute the similarity between two sets of learned node embeddings, the model utilizes a differentiable, path-based graph kernel called GraphHopper. This kernel calculates a weighted sum over node kernels across all pairs of nodes, effectively capturing structural alignments without requiring joint neural network layers.

Additionally, instead of training the network on standard spatial overlap metrics like Intersection over Union (IoU), the authors train the model using a triplet loss designed to mimic a normalized Graph Edit Distance (sGED), which penalizes structural differences (adding/deleting rooms or doors).

Datasets

The model was trained and evaluated on two large-scale floor plan datasets:

  • RPLAN: Contains over 46,000 cleaned, apartment-level floor plans from Asian residential buildings.
  • MSD (Multi-Structure Dataset): Contains over 16,000 apartment-level floor plans from residential building complexes in Switzerland. This dataset was used exclusively for zero-shot generalization testing to evaluate how well the model transfers to entirely different architectural styles.

Key Insights and Ideas

  • Postponing Interactions Works: The core "aha!" moment is that modeling expensive cross-graph interactions within the GNN layers isn't necessary. Pushing these interactions to a final graph-kernel-based similarity function preserves fine-grained structural matching while unlocking offline embedding generation.
  • Architects Care About Topology: Through a user study with trained architects, the authors discovered that human judgment of floor plan similarity correlates strongly with Graph Edit Distance (topology and connectivity) rather than IoU (geometric overlap).
  • Embedding Size Efficiency: Because the graph kernel naturally accounts for the graph's topology during the similarity step, the GNN's node embeddings don't need to work as hard to encode structural information. As a result, LayoutGKN maintains high accuracy even when the hidden node dimension is significantly reduced, unlike traditional GMNs which degrade rapidly.

Key Results

  • 20x Speedup: LayoutGKN computes the similarity of 10,000 pairs in just 1.8 seconds, compared to 35.6 seconds for LayoutGMN.
  • State-of-the-Art Accuracy: On the RPLAN dataset, LayoutGKN achieves a triplet accuracy of 97.78%, slightly outperforming LayoutGMN (97.74%) while being orders of magnitude faster.
  • Superior Generalization: In zero-shot testing on the MSD dataset, LayoutGKN significantly outperformed LayoutGMN in Precision@5 (0.674 vs. 0.585) and Precision@10 (0.697 vs. 0.596), demonstrating that the structural prior provided by the graph kernel prevents overfitting to specific dataset distributions.

Limitations and Future Work

While LayoutGKN shows robust performance, the authors note a few limitations:

  • Strict Grid Invariance: Because the room shape features include absolute center coordinates $(c_x, c_y)$, the model is not perfectly invariant to rotations and flips out of the box (though the authors note this can be fixed simply by removing those two coordinates).
  • Encoder Capacity: The framework was only evaluated using standard MPNs. Testing more expressive GNN backbones like Graph Attention Networks (GAT) or Graph Isomorphism Networks (GIN) remains an open direction.
  • Cross-Domain Generalization: The authors express interest in exploring whether this decoupled graph-kernel approach can benefit other non-architectural graph domains, such as molecular similarity search.

Summary updated

BibTeX
@misc{engelenburg2025layoutgkn,
  author = {Casper van Engelenburg and Jan van Gemert and Seyran Khademi},
  title = {{LayoutGKN: Graph Similarity Learning of Floor Plans}},
  year = {2025},
  eprint = {2509.03737},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2509.03737},
}
Figure