Skip to main content

Efficient sampling of Geometric Inhomogeneous Random Graphs (GIRG). Wrapper for C++ libraries libgirg and libhypergirg.

Project description

GIRG sampling

A Python wrapper for the GIRGs sampling library (C++). Contains a direct wraper of the C++ library and NetworkX Graph generators (optional). Efficiently generates Geometric Inhomogeneous Random Graphs (GIRGs) and Hyperbolic Random Graphs (HRGs).

See the paper Efficiently Generating Geometric Inhomogeneous and Hyperbolic Random Graphs for details of the algorithm.

Install

Install from PyPI as girg-sampling via pip, poetry etc. To build the package locally, install Poetry package manager and run poetry build, optionally with poetry install.

To use generateNetworkX functions, you need to have the networkx package (not a default dependency of girg-sampling)

Usage

import girg_sampling

g = girg_sampling.girgs.generateNetworkX(n=135, ple=1.5, dim=4, deg=4.2, alpha=100, seed=41)
h = girg_sampling.hypergirgs.generateNetworkX(n=1001, alpha=0.75, T=0.7, deg=2.2, seed=None)

See tests for sample usage of the raw C++ wrappers.

Changelog

  • 0.1.0: A direct wrapper of the C++ graph generator functions.
  • 0.2.0: Minor fixes, unify seed param, add e2e tests, build wheels for python up to 3.10
  • 0.2.1: Update urllib3 dev-dependency for twine under Python 3.10
  • 0.3.0: Add NetworkX wrapper, update python version, add docs.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

girg_sampling-0.3.0.tar.gz (27.9 kB view hashes)

Uploaded Source

Built Distributions

girg_sampling-0.3.0-cp312-cp312-manylinux_2_35_x86_64.whl (1.6 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.35+ x86-64

girg_sampling-0.3.0-cp311-cp311-manylinux_2_35_x86_64.whl (1.6 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.35+ x86-64

girg_sampling-0.3.0-cp310-cp310-manylinux_2_35_x86_64.whl (1.6 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.35+ x86-64

girg_sampling-0.3.0-cp39-cp39-manylinux_2_35_x86_64.whl (1.6 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.35+ x86-64

girg_sampling-0.3.0-cp38-cp38-manylinux_2_35_x86_64.whl (1.6 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.35+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page