Skip to main content

BPRG: Bootstrap Percolation in Random Graphs

PyPI Python License Documentation Streamlit

bootstrap_percolation.mp4

BPRG is a high performance Python library for analyzing bootstrap percolation in random graphs. It implements the theoretical framework in Detering and Lin (2026): Bootstrap percolation in random graphs of unbounded rank, providing comprehensive tools to study contagion dynamics in random graphs.

Installation

Install bprg via uv (recommended):

uv add bprg

or via pip:

pip install bprg

Interactive Demo

Explore the interactive analysis in the BPRG Streamlit app.

The demo provides an intuitive interface to simulate random graphs, visualize the bootstrap percolation process, and estimate the final fraction of infected vertices using both the asymptotic fixed point solution and Monte Carlo simulation.

Overview

Bootstrap percolation in random graphs

Bootstrap percolation is a contagion process on graphs where vertices have thresholds. The process starts with a set of initially infected vertices. An uninfected vertex with threshold $k$ becomes infected as soon as it has at least $k$ infected neighbors. This simple rule gives rise to complex infection dynamics.

For the Random Graphs setting, BPRG considers those of unbounded rank, which admits a general kernel function $κ$ that determines connection probabilities by the types of vertices.

Final fraction of infected vertices

The final fraction of infected vertices is a key quantity of interest in bootstrap percolation. It represents the proportion of the graph that becomes infected in the long run, after the infection process has stabilized. BPRG provides tools to compute this quantity via both theoretical asymptotic solution and Monte Carlo simulation.

Theoretical asymptotic solution

One of the main theoretical results of Detering and Lin (2026) is that the asymptotic final fraction of infected vertices in large random graphs is determined by the least fixed point of a non-linear operator on the space of functions. BPRG provides neural network-based solvers to promptly compute this fixed point.

Monte Carlo simulation

BPRG also provides a Monte Carlo simulation framework to efficiently generate random graphs, simulate bootstrap percolation in the graph, and estimate the final fraction of infected vertices. This allows users to validate theoretical predictions and explore infection dynamics in finite-size graphs.

Key Features

Feature Description
JAX-based Implementation High-performance computations leveraging JAX
Random Graph of Unbounded Rank Generate random graphs from general kernel functions $κ$
Bootstrap Percolation Simulation Simulate infection dynamics with efficient
Neutral Fixed Point Solvers Neural network-based operator solvers for asymptotic final infection
Monte Carlo Estimation Estimate final infection through Monte Carlo methods

References

@article{detering2026bootstrap,
  title={Bootstrap Percolation in Random Graphs of Unbounded Rank},
  author={Detering, Nils and Lin, Jimin},
  journal={Advances in Applied Probability},
  year={2026},
  doi={doi.org/10.1017/apr.2026.10072}
}

Metadata

Release files for bprg 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bprg 0.1.1
File Size Uploaded Provenance Actions
bprg-0.1.1.tar.gz 9.9 kB With provenance Details for bprg-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bprg 0.1.1
File Interpreter ABI Platform Actions
bprg-0.1.1-py3-none-any.whl Python 3 none any Details for bprg-0.1.1-py3-none-any.whl

Total release size: 21.8 kB

Release files / bprg-0.1.1.tar.gz

Download URL bprg-0.1.1.tar.gz
Size 9.9 kB
Tags Source
SHA-256 checksum
How to use checksums
5710be8a3bcf4f17e8da4774da239ff7c49e7054ebafe35b27be082573c53a83
BLAKE2b-256 checksum
How to use checksums
eb339cbd19b186e21853ed81330fdc72480b82129d4794fd0818831001fe8324
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 16, 2026.

Transparency log

Release files / bprg-0.1.1-py3-none-any.whl

Download URL bprg-0.1.1-py3-none-any.whl
Size 11.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
37d842590cf473306c7d66efa1b86f4aca809192a789e1f0f8868d9c5f26c8f9
BLAKE2b-256 checksum
How to use checksums
cf9daf06f37e2d07736696d4e222aba74dc2c36d9930f02067bb3db1ae282ccf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 16, 2026.

Transparency log

Security for bprg 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for bprg-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 16, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page