{"id":26216048,"url":"https://github.com/borgwardtlab/gnnscancountsubstructures","last_synced_at":"2026-02-11T16:02:06.421Z","repository":{"id":279781729,"uuid":"939949493","full_name":"BorgwardtLab/GNNsCanCountSubstructures","owner":"BorgwardtLab","description":"Code and Data for the paper: \"Graph Neural Networks Can (Often) Count Substructures\" (ICLR 2025 Spotlight)","archived":false,"fork":false,"pushed_at":"2025-02-27T16:50:57.000Z","size":194,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-19T19:14:10.297Z","etag":null,"topics":["gnns","iclr2025","subgraph-isomorphism"],"latest_commit_sha":null,"homepage":"","language":"GLSL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BorgwardtLab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-02-27T11:22:42.000Z","updated_at":"2025-06-05T08:46:28.000Z","dependencies_parsed_at":"2025-02-27T15:54:30.172Z","dependency_job_id":"9b3c51c5-a219-459a-84c0-bb6337f60ad7","html_url":"https://github.com/BorgwardtLab/GNNsCanCountSubstructures","commit_stats":null,"previous_names":["borgwardtlab/gnnscancountsubstructures"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BorgwardtLab/GNNsCanCountSubstructures","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BorgwardtLab%2FGNNsCanCountSubstructures","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BorgwardtLab%2FGNNsCanCountSubstructures/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BorgwardtLab%2FGNNsCanCountSubstructures/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BorgwardtLab%2FGNNsCanCountSubstructures/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BorgwardtLab","download_url":"https://codeload.github.com/BorgwardtLab/GNNsCanCountSubstructures/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BorgwardtLab%2FGNNsCanCountSubstructures/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29337001,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T16:00:30.228Z","status":"ssl_error","status_checked_at":"2026-02-11T16:00:25.398Z","response_time":97,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gnns","iclr2025","subgraph-isomorphism"],"created_at":"2025-03-12T11:19:13.811Z","updated_at":"2026-02-11T16:02:06.406Z","avatar_url":"https://github.com/BorgwardtLab.png","language":"GLSL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Graph Neural Networks Can (Often) Count Substructures\n\nThis repository contains the experiments for the _ICLR 2025_  (Spotlight) paper \"Graph Neural Networks Can (Often) Count Substructures\". The paper is available [here](https://openreview.net/forum?id=sZQRUrvLn4).\n\n| ![](Quitecolorful.png) |\n|:--| \n| *On the left, a graph **G** and a tree pattern **P**. The copies of **G** on the right have colors obtained from one WL iteration. The subgraph isomorphism from **P** to the red-highlighted subgraph of **G** is not quite-colorful, while the one to the green-highlighted subgraph of **G** is quite-colorful (see Section 5 of the paper).*|\n\n\n### Description\n\nMessage passing graph neural networks (GNNs) are known to have limited expressive power in their ability to distinguish some non-isomorphic graphs.\nBecause of this, it is well known that they are unable to detect or count arbitrary graph substructures (i.e., solving the subgraph isomorphism problem), a task that is of great importance for several types of graph-structured data. \nHowever, we observe that GNNs are in fact able to count graph patterns quite accurately across several real-world graph datasets.\nMotivated by this observation, we provide an analysis of the subgraph-counting capabilities of GNNs beyond the worst case, deriving several sufficient conditions for GNNs to be able to count subgraphs and, more importantly, to be able to _sample-efficiently learn_ to count subgraphs. \nMoreover, we develop novel dynamic programming algorithms for solving the subgraph isomorphism problem on restricted classes of pattern and target graphs, and show that message-passing GNNs can efficiently simulate these dynamic programs. \n\n### Citing our work\n\n\u003e Paolo Pellizzoni, Till Hendrik Schulz, and Karsten Borgwardt. _Graph Neural Networks Can (Often) Count Substructures_, in ICLR, 2025.\n\n```\n@inproceedings{\n  pellizzoni2025graph,\n  title={Graph Neural Networks Can (Often) Count Substructures},\n  author={Paolo Pellizzoni and Till Hendrik Schulz and Karsten Borgwardt},\n  booktitle={International Conference on Learning Representations},\n  year={2025},\n  url={https://openreview.net/forum?id=sZQRUrvLn4}\n}\n```\n\n### Usage\n\nRun ```source s``` to load modules \n\n- dataset_statistics/ contains the experiments to compute the dataset statistics (Section 6.1)\n- gnns/ contains the experiments on GNNs (Table 1 and Table 4)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborgwardtlab%2Fgnnscancountsubstructures","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fborgwardtlab%2Fgnnscancountsubstructures","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborgwardtlab%2Fgnnscancountsubstructures/lists"}