Utility package for generating graph structures
Project description
NumGraph
Read the Documentation
Num(py)Graph is a library for synthetic graph generation. The main principle of NumGraph is to be a lightweight library (i.e., numpy is the only dependency) that generates graphs from a broad range of distributions. Indeed, It implements several graph distributions in both the static and temporal domain.
Implemented distributions
Static Graphs
- Star graph
- Clique
- Two-dimensional rectangular grid lattice graph
- Random Tree
- Erdos Renyi
- Barabasi Albert
- Stochastic Block Model
Temporal Graphs
- Susceptible-Infected Dissemination Process Simulation
- Heat diffusion over a graph (closed form solution)
- Generic Euler's method approximation of a diffusion process over a graph
Installation
python3 -m pip install numgraph
Usage
>>> from numgraph import star_coo, star_full
>>> coo_matrix, coo_weights = star_coo(num_nodes=5, weighted=True)
>>> print(coo_matrix)
array([[0, 1],
[0, 2],
[0, 3],
[0, 4],
[1, 0],
[2, 0],
[3, 0],
[4, 0]]
>>> print(coo_weights)
array([[0.89292422],
[0.3743427 ],
[0.32810002],
[0.97663266],
[0.74940571],
[0.89292422],
[0.3743427 ],
[0.32810002],
[0.97663266],
[0.74940571]])
>>> adj_matrix = star_full(num_nodes=5, weighted=True)
>>> print(adj_matrix)
array([[0. , 0.72912008, 0.33964166, 0.30968042, 0.08774328],
[0.72912008, 0. , 0. , 0. , 0. ],
[0.33964166, 0. , 0. , 0. , 0. ],
[0.30968042, 0. , 0. , 0. , 0. ],
[0.08774328, 0. , 0. , 0. , 0. ]])
Other examples can be found in test/plot_static.py and test/plot_temporal.py.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file numgraph-0.1.8.tar.gz.
File metadata
- Download URL: numgraph-0.1.8.tar.gz
- Upload date:
- Size: 14.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
24e02a2ade2deb136d0bb11bf8f0e5bbb15a3a7d6ce556524a608b53fa5b6f06
|
|
| MD5 |
710f1d4a0a656c940c85cfd9c242dd62
|
|
| BLAKE2b-256 |
ea994b0bf16a40f39435c334ace079bb9bd4e01bec0d54f3b2ab882cebee0202
|
File details
Details for the file numgraph-0.1.8-py3-none-any.whl.
File metadata
- Download URL: numgraph-0.1.8-py3-none-any.whl
- Upload date:
- Size: 21.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c8b20ba6c55874f4e66b3d1c6752330c55cf9b3838cec04029be0fb77d33145
|
|
| MD5 |
abc78e22fd70b1d5046a9cd2bb39e602
|
|
| BLAKE2b-256 |
a80762e63d0a6fcf6a86ea363fca4f06e73cfe6d00bfd02cb7db9ec3a4f4d2dc
|