Introduction
The search for specific subgraphs within massive graph databases—a problem known as subgraph isomorphism—is a fundamental task in domains ranging from medicinal chemistry to social network analysis. However, the computational complexity of this task is daunting. Locally, determining if a query graph is contained within a target graph is NP-complete. Globally, high-accuracy neural models often suffer from a linear scaling bottleneck ($\Omega(C)$), requiring exhaustive "early interaction" comparisons between the query and every graph in the corpus.
While single-vector embedding methods offer speed, they often sacrifice the structural granularity necessary for precise matching. Conversely, multi-vector methods provide accuracy but lack the scalability of modern text-search engines. This paper introduces CORGII (Contextual Representation of Graphs for Inverted Indexing), a framework designed to bridge this gap by discretizing graph structures into "contextual tokens" that can be indexed and searched using highly optimized inverted indices.
Methodology: The CORGII Framework
CORGII adapts the principles of dense and sparse information retrieval to graph data. The architecture is built upon several key innovations:
1. Graph Tokenizer Network (GTNet)
At the core of CORGII is the GTNet, which transforms continuous node representations into a discrete, latent structural vocabulary. Using a Graph Neural Network (GNN) followed by a discretization module, each node is mapped to a $D$-bit binary code. These codes act as "tokens," effectively treating a graph like a document composed of structural "words."
2. Asymmetric Dual Encoding
Subgraph retrieval is inherently asymmetric; the presence of a query in a target graph does not imply the reverse. CORGII addresses this by employing separate Multi-Layer Perceptrons (MLPs) for the query and the corpus. This asymmetric dual encoding allows the model to better capture the directional "containment" logic required for subgraph search, moving away from the symmetric limitations of standard Siamese networks.
3. Chamfer Distance Training
To facilitate efficient indexing, the authors replace traditional, computationally expensive permutation-based alignment with a Chamfer distance metric. This choice allows the model to be trained such that relevant graph pairs share overlapping tokens without requiring joint processing of the query and corpus. This "loosening" of alignment requirements is critical for compatibility with inverted index structures.
4. Trainable Impact Scores and Multiprobing
Inspired by TF-IDF in text retrieval, CORGII utilizes a "trainable impact network" to assign weights to tokens based on their structural significance. This ensures that the index prioritizes discriminative features. Furthermore, to mitigate discretization errors and structural noise, the framework employs Co-occurrence Multiprobing (CM), which identifies and probes similar tokens based on their frequency of co-occurrence in posting lists.
Experimental Evaluation
The researchers evaluated CORGII against several baselines, including FourierHashNet (FHN), IVF-multi, and DiskANN, using four real-world datasets from the TU benchmark suite: PTC-FR, PTC-FM, PTC-MR (chemical compounds), and COX2 (cyclooxygenase-2 inhibitors). The experiments involved a corpus of 100,000 graphs and 500 query graphs per dataset.
Performance and Efficiency
CORGII demonstrated significant improvements in both accuracy and retrieval efficiency. On the PTC-FR dataset, CORGII achieved a Mean Average Precision (MAP) of approximately 0.36 while retrieving less than 33% of the corpus. In contrast, most baselines required scanning over 75% of the corpus to achieve comparable accuracy. On the COX2 dataset, CORGII reached a MAP of ~0.50 at a 50% retrieval budget, significantly outperforming the strongest baseline, FHN, which saturated at 0.35.
Scalability
The framework's practical utility is highlighted by its scalability. Indexing a million graphs on the PTC-FR dataset takes approximately 272 seconds, suggesting that CORGII is well-suited for large-scale production environments where rapid indexing and low-latency retrieval are paramount.
Conclusion and Future Directions
CORGII represents a significant step forward in making high-precision subgraph retrieval scalable. By treating graph nodes as tokens and leveraging the efficiency of inverted indices, it overcomes the $\Omega(C)$ bottleneck of traditional neural scoring.
However, several avenues for future research remain. Currently, CORGII focuses primarily on structural topology; incorporating node and edge attributes (e.g., atom types) would enhance its applicability to more complex datasets. Additionally, exploring dynamic vocabularies and update-friendly indexing for evolving graphs would further broaden the framework's utility in real-time applications.
Summary updated