# NetworkX Arxiv Generators [](https://github.com/YanYablonovskiy/networkx-arxiv-generators/actions/workflows/ci.yml)
Advanced graph generation models for [NetworkX](https://github.com/networkx/networkx), implementing algorithms from mathematical literature (with arxiv citations), and published
in reputable peer-reviewed journals, or presented at established conferences, symposiums and seminars.
## Current state
Currently the project is in a scaffolding state, with the first goal of generating uniform power law graphs as in [Uniform generation of random graphs with power-law degree sequences](https://arxiv.org/abs/1709.02674). These results were presented at
[SODA '18: Proceedings of the Twenty-Ninth Annual ACM-SIAM Symposium on Discrete Algorithms](https://dl.acm.org/doi/10.5555/3174304.3175419) .
To begin, this requires results from the seminal paper B.D. McKay and N.C. Wormald, Uniform generation of random regular graphs of moderate degree,
J. Algorithms 11 (1990), 52–67.
Currently in progress, located in `src/nx_arxivgen/generators/mckay_wormald.py` .
## Install
Once published:
```bash
pip install networkx-arxiv-generators
```
## Quickstart
```python
import networkx as nx
import matplotlib.pyplot as plt
from nx_arxivgen.generators.mckay_wormald import mckay_wormald_simple_graph, mckay_random_graph_encoding
test_deg_seq = [1, 1, 2, 3, 3, 2, 6, 6,7,8,6,1,2,3,4,5,6,7,8,9,10]
test = mckay_wormald_simple_graph(test_deg_seq, debug=True)
nx.draw_spring(test, with_labels=True)
plt.show()
sample_graph = nx.generators.binomial_graph(20, 0.5)
print(mckay_random_graph_encoding(sample_graph))
```
An example of a graph generated this way, with the degree sequence
```
[10, 1, 0, 4, 3, 3, 2, 1, 10, 8, 1, 9, 6, 0, 0, 1, 3, 3, 8, 9, 0, 8, 3, 10, 8, 6, 3, 7, 9, 4]
```
The nodes of degree 0 are 2, 13, 14 and 20.
<img width="593" height="449" alt="image" src="https://github.com/user-attachments/assets/20cdd3ef-0153-40d6-9a15-fc186e7eb8c6" />
## Goals
- Faithful implementations of arxiv models with clear citations, existing in reputable publications.
- Deterministic seeding and reproducibility, wherever relevant by the context of the research paper.
- Tests, docs, and examples for each model.
## Citing
If you use this package, please cite it. See `CITATION.cff`. Each model’s docstring cites its originating paper(s).
Raw data
{
"_id": null,
"home_page": null,
"name": "networkx-arxiv-generators",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "arxiv, generators, graphs, models, networks, networkx, random graphs",
"author": null,
"author_email": "Yan <yablonovskiy.yan@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/c0/1f/574f90c17a78cdf6cb19b2ecfeaacd65bd2ed6981dffb33238e91950c808/networkx_arxiv_generators-0.1.1.tar.gz",
"platform": null,
"description": "# NetworkX Arxiv Generators [](https://github.com/YanYablonovskiy/networkx-arxiv-generators/actions/workflows/ci.yml)\n\nAdvanced graph generation models for [NetworkX](https://github.com/networkx/networkx), implementing algorithms from mathematical literature (with arxiv citations), and published\nin reputable peer-reviewed journals, or presented at established conferences, symposiums and seminars.\n\n## Current state \n\nCurrently the project is in a scaffolding state, with the first goal of generating uniform power law graphs as in [Uniform generation of random graphs with power-law degree sequences](https://arxiv.org/abs/1709.02674). These results were presented at\n[SODA '18: Proceedings of the Twenty-Ninth Annual ACM-SIAM Symposium on Discrete Algorithms](https://dl.acm.org/doi/10.5555/3174304.3175419) .\n\nTo begin, this requires results from the seminal paper B.D. McKay and N.C. Wormald, Uniform generation of random regular graphs of moderate degree, \nJ. Algorithms 11 (1990), 52\u201367.\n\nCurrently in progress, located in `src/nx_arxivgen/generators/mckay_wormald.py` .\n\n## Install\nOnce published:\n```bash\npip install networkx-arxiv-generators\n```\n\n## Quickstart\n\n```python\nimport networkx as nx\nimport matplotlib.pyplot as plt\nfrom nx_arxivgen.generators.mckay_wormald import mckay_wormald_simple_graph, mckay_random_graph_encoding\n\ntest_deg_seq = [1, 1, 2, 3, 3, 2, 6, 6,7,8,6,1,2,3,4,5,6,7,8,9,10]\n\ntest = mckay_wormald_simple_graph(test_deg_seq, debug=True)\nnx.draw_spring(test, with_labels=True)\nplt.show()\n\nsample_graph = nx.generators.binomial_graph(20, 0.5)\n\nprint(mckay_random_graph_encoding(sample_graph))\n```\nAn example of a graph generated this way, with the degree sequence \n```\n[10, 1, 0, 4, 3, 3, 2, 1, 10, 8, 1, 9, 6, 0, 0, 1, 3, 3, 8, 9, 0, 8, 3, 10, 8, 6, 3, 7, 9, 4]\n```\nThe nodes of degree 0 are 2, 13, 14 and 20.\n<img width=\"593\" height=\"449\" alt=\"image\" src=\"https://github.com/user-attachments/assets/20cdd3ef-0153-40d6-9a15-fc186e7eb8c6\" /> \n\n## Goals\n\n- Faithful implementations of arxiv models with clear citations, existing in reputable publications.\n- Deterministic seeding and reproducibility, wherever relevant by the context of the research paper.\n- Tests, docs, and examples for each model.\n\n## Citing\n\nIf you use this package, please cite it. See `CITATION.cff`. Each model\u2019s docstring cites its originating paper(s).\n",
"bugtrack_url": null,
"license": "BSD-3-Clause",
"summary": "Advanced NetworkX graph generation models implementing algorithms from mathematical papers.",
"version": "0.1.1",
"project_urls": {
"Homepage": "https://github.com/YanYablonovskiy/networkx-arxiv-generators",
"Issues": "https://github.com/YanYablonovskiy/networkx-arxiv-generators/issues",
"Source": "https://github.com/YanYablonovskiy/networkx-arxiv-generators"
},
"split_keywords": [
"arxiv",
" generators",
" graphs",
" models",
" networks",
" networkx",
" random graphs"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "e9fc1c3a7aef6f35899d383768cc7ed9edea2026a98b3ae1b54d6849b1e625a3",
"md5": "1d8036f656c7a98bf0f38d69adb21189",
"sha256": "03d027f8e5107a5766afd2459395459faa08d426f5fd4b5237db658541b68a27"
},
"downloads": -1,
"filename": "networkx_arxiv_generators-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1d8036f656c7a98bf0f38d69adb21189",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 10568,
"upload_time": "2025-09-07T05:37:31",
"upload_time_iso_8601": "2025-09-07T05:37:31.383168Z",
"url": "https://files.pythonhosted.org/packages/e9/fc/1c3a7aef6f35899d383768cc7ed9edea2026a98b3ae1b54d6849b1e625a3/networkx_arxiv_generators-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "c01f574f90c17a78cdf6cb19b2ecfeaacd65bd2ed6981dffb33238e91950c808",
"md5": "ad03296494d89fea9cef1a81afeb95ba",
"sha256": "0779dd4a7c351eb603b62367c6af4721acaf819f97a801e8c4384574cb49fece"
},
"downloads": -1,
"filename": "networkx_arxiv_generators-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "ad03296494d89fea9cef1a81afeb95ba",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 12701,
"upload_time": "2025-09-07T05:37:32",
"upload_time_iso_8601": "2025-09-07T05:37:32.497099Z",
"url": "https://files.pythonhosted.org/packages/c0/1f/574f90c17a78cdf6cb19b2ecfeaacd65bd2ed6981dffb33238e91950c808/networkx_arxiv_generators-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-07 05:37:32",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "YanYablonovskiy",
"github_project": "networkx-arxiv-generators",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "networkx-arxiv-generators"
}