Papers › GREED: A Neural Framework for Learning Graph Distance Functions

GREED: A Neural Framework for Learning Graph Distance Functions

24 Dec 2021arXiv:2112.13143archive 2025-07-28

Rishabh Ranjan, Siddharth Grover, Sourav Medya, Venkatesan Chakaravarthy, Yogish Sabharwal, Sayan Ranu

Among various distance functions for graphs, graph and subgraph edit distances (GED and SED respectively) are two of the most popular and expressive measures. Unfortunately, exact computations for both are NP-hard. To overcome this computational bottleneck, neural approaches to learn and predict edit distance in polynomial time have received much interest. While considerable progress has been made, there exist limitations that need to be addressed. First, the efficacy of an approximate distance function lies not only in its approximation accuracy, but also in the preservation of its properties. To elaborate, although GED is a metric, its neural approximations do not provide such a guarantee. This prohibits their usage in higher order tasks that rely on metric distance functions, such as clustering or indexing. Second, several existing frameworks for GED do not extend to SED due to SED being asymmetric. In this work, we design a novel siamese graph neural network called GREED, which through a carefully crafted inductive bias, learns GED and SED in a property-preserving manner. Through extensive experiments across 10 real graph datasets containing up to 7 million edges, we establish that GREED is not only more accurate than the state of the art, but also up to 3 orders of magnitude faster. Even more significantly, due to preserving the triangle inequality, the generated embeddings are indexable and consequently, even in a CPU-only environment, GREED is up to 50 times faster than GPU-powered baselines for graph / subgraph retrieval.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2112.13143")

Code

Syntology Ran 2 of 15 code samples harvested from 2 repositories linked to this paper; 13 have no recorded run. Of those that ran: 2 ran with no contract checked.

By repository: official repository: 15 samples from 2 repositories, 2 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

idea-iitd/neurosed officialmentioned in papermentioned on GitHubpytorch report
idea-iitd/greed officialmentioned in paperpytorchMIT report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

15 samples harvested; 2 ran; 0 honoured the contract we drafted; 13 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

2ran
13unverified

Licence: 0 of the 15 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 2 repositories linked to this paper, official or community; each sample names its own and says which. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

EmbedModel idea-iitd/neurosed/neuro/models.py official repository ran MIT (permissive) · 24e67ae2ebba81da · report
SiameseModel idea-iitd/neurosed/neuro/models.py official repository ran MIT (permissive) · 6be2041a0ee69000 · report
NeuralSiameseModel idea-iitd/neurosed/neuro/models.py official repository unverified MIT (permissive) · 1c519e2c43db9290 · report
batch_of_dataset idea-iitd/greed/neuro/utils.py official repository unverified MIT (permissive) · 37246958bf6c1aec · report
err idea-iitd/greed/neuro/metrics.py official repository unverified MIT (permissive) · cb067683b0ecbb1b · report
k_hop_nbr_func idea-iitd/greed/neuro/datasets.py official repository unverified MIT (permissive) · cc5d89845905b06b · report
k_hop_nbr_nx idea-iitd/greed/neuro/datasets.py official repository unverified MIT (permissive) · ba67b4e72ce713f6 · report
label_graphs idea-iitd/greed/neuro/utils.py official repository unverified MIT (permissive) · f37d5e53c04dea18 · report
mse idea-iitd/greed/neuro/metrics.py official repository unverified MIT (permissive) · 706a15018478eff5 · report
preprocess idea-iitd/greed/neuro/h2mn_utils.py official repository unverified MIT (permissive) · fe57c0339c66673f · report
random_bfs_sample idea-iitd/greed/neuro/datasets.py official repository unverified MIT (permissive) · 339bda326bbc90d3 · report
sim_to_ged idea-iitd/greed/neuro/h2mn_utils.py official repository unverified MIT (permissive) · 99e446f9903a7a19 · report
sim_to_sed idea-iitd/greed/neuro/h2mn_utils.py official repository unverified MIT (permissive) · 46d5d380b2a8610c · report
to_pyged idea-iitd/greed/neuro/utils.py official repository unverified MIT (permissive) · 958f56a630836334 · report
weighted_mse idea-iitd/greed/neuro/metrics.py official repository unverified MIT (permissive) · c1ac97b5adf74a26 · report

Tasks

Graph Neural NetworkGraph SimilarityInductive BiasRetrieval

2 archive task tags without a task page not shown.

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Graph Neural Network

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections