{"id":20515462,"url":"https://github.com/snap-research/cabam-graph-generation","last_synced_at":"2026-05-27T21:32:12.189Z","repository":{"id":106386426,"uuid":"588662589","full_name":"snap-research/cabam-graph-generation","owner":"snap-research","description":"[KDD MLG'20] Class-Assortative Barabasi Albert Model for Graph Generation","archived":false,"fork":false,"pushed_at":"2023-01-20T03:41:08.000Z","size":24992,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-05T23:22:24.006Z","etag":null,"topics":["graph-generation","graph-generator","graph-neural-networks"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","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/snap-research.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}},"created_at":"2023-01-13T17:15:35.000Z","updated_at":"2023-02-03T17:41:53.000Z","dependencies_parsed_at":"2023-07-17T14:01:14.085Z","dependency_job_id":null,"html_url":"https://github.com/snap-research/cabam-graph-generation","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/snap-research/cabam-graph-generation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snap-research%2Fcabam-graph-generation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snap-research%2Fcabam-graph-generation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snap-research%2Fcabam-graph-generation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snap-research%2Fcabam-graph-generation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/snap-research","download_url":"https://codeload.github.com/snap-research/cabam-graph-generation/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snap-research%2Fcabam-graph-generation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33585203,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-27T02:00:06.184Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["graph-generation","graph-generator","graph-neural-networks"],"created_at":"2024-11-15T21:21:53.555Z","updated_at":"2026-05-27T21:32:12.173Z","avatar_url":"https://github.com/snap-research.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Scale-Free, Attributed and Class-Assortative Graph Generation\n\nThis repository contains code for the paper [\"Scale-Free, Attributed and Class-Assortative Graph Generation to Facilitate Introspection of Graph Neural Networks,\"](https://nshah.net/publications/CABAM.MLG.2020.pdf) published at KDD MLG 2020.  In particular, it enables use of the CABAM (Class Assortative Barabasi Albert Model) for graph generation, which enhances the traditional Barabasi-Albert preferential attachment model with flexible class labels, feature distributions and assortativity (homophily) parameters.\n\n## Installation\n\nYou can install a `cabam` package with \n\n```\npip install .\n```\n\n## Downloading Data\n\nYou can see `./Dataset Summaries.ipynb` for reproducing dataset statistics mentioned in the paper.\n\nData referenced in this code is sourced from versions available at \n[graph2gauss](https://github.com/abojchevski/graph2gauss) and \n[GAug](https://github.com/zhao-tong/GAug) repositories.  \n\nPlease run:\n\n```\nbash download_data.sh\n```\n\nin order to download all relevant data files referenced in scripts here (all files will be placed under `./data`), before trying to run notebook commands yourself.\n\n## Generating graphs with CABAM\n\nThe below is a basic example, to use CABAM to generate a graph with with 1000 nodes and minimum degree of 3, \nwith two balanced classes (default) and roughly equal numbers of homophilous and heterophilous edges (default).\n\n```\nfrom cabam import CABAM\nmodel = CABAM()\nG, degrees, labels, num_intra_edges, num_inter_edges = model.generate_graph(n=1000, m=3)\n```\n\nSee `generate_graph(...)` in `./cabam/cabam.py` for customizing use.\n\n## Reference\n\nIf you use the model, or graphs generated with the model for evaluation in your own work, please cite\n\n```BibTeX\n @inproceedings{cabam2020shah,\n     author = {Shah, Neil},\n     title = {Scale-Free, Attributed and Class-Assortative Graph Generation to Facilitate Introspection of Graph Neural Networks},\n     booktitle = {KDD Mining and Learning with Graphs},\n     year = {2020}\n   }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnap-research%2Fcabam-graph-generation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsnap-research%2Fcabam-graph-generation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnap-research%2Fcabam-graph-generation/lists"}