Skip to main content

dynG

dynG keeps the results of graph and hypergraph algorithms up to date while the structure changes in batches of insertions and deletions, without recomputing from scratch. It unifies the research codes of DynaMOSP (dynamic single- and multi-objective shortest paths), TruCy / DynTruCy (cycle counting) and ESCHER / ESCHER+ (hypergraph triads): dyng.sssp, dyng.mosp, dyng.cycle_count, the hypergraph dyng.Hypergraph and dyng.triad_count are stable, with more algorithms (label propagation, shortest hyperpaths) to follow; dyng.dynamic_bfs and dyng.triangle_delta are small tutorial algorithms.

import dyng

g = dyng.Graph.from_edges([0, 0, 1, 2], [1, 2, 2, 3], [4, 1, 1, 5])   # src, dst, weights
tree = dyng.sssp.compute(g, source=0)                                # shortest-path tree
batch = dyng.EdgeBatch(insert=([1], [3], [1]), delete=([0], [2]))
stats = dyng.sssp.update(g, batch, tree)                             # incremental update
print(tree.distances.to_numpy(), stats.invalidated)

hist = dyng.cycle_count.compute(g, max_length=4)                     # simple cycles by length
print(hist.counts.tolist(), hist.total)

w2 = [[4, 1], [1, 5], [1, 1], [5, 2]]                                # two objectives per edge
g2 = dyng.Graph.from_edges([0, 0, 1, 2], [1, 2, 2, 3], w2)
paths = dyng.mosp.compute(g2, source=0)                              # multi-objective (MOSP)
dyng.mosp.update(g2, dyng.EdgeBatch(delete=([0], [2])), paths)
print(paths.path_costs.to_numpy().tolist())                          # the K costs per vertex

h = dyng.Hypergraph.from_lists([[0, 1, 2], [1, 2, 3], [0, 2, 3]])    # three hyperedges
triads = dyng.triad_count.compute(h)                                 # the 30 h-motif bins
dyng.triad_count.update(h, dyng.HyperedgeBatch(insert_hyperedges=[[0, 1, 3]]), triads)
print(triads.total, triads.counts.nonzero()[0].tolist())             # triads, non-zero bins

The package also installs the dyng command line, which reads and writes the formats of the original tools:

$ dyng cycle_count compute --graph DD_A.txt --max-length 6       # histogram CSV
$ dyng sssp compute --graph roadNet-CA_ --out init                # MOSP's distance and tree files
$ dyng sssp update --graph roadNet-CA_ --changes batch --init init --out updated
$ dyng mosp update --graph roadNet-CA_ --changes batch --init init --preferences 4,1,4 --out out
$ dyng triad_count update --input coauth.hg --batches batches.dgb --format json   # triad bins JSON

This wheel contains the sequential and OpenMP backends (dyng.Resources("openmp")). The CUDA backend comes as a plugin wheel of the same version, from 0.2: pip install "dyng[cu13]" (an NVIDIA driver of CUDA 13) or pip install "dyng[cu12]" (CUDA 12); dyng.Resources.cuda() then runs every algorithm on the GPU, and dyng.show_config() reports which module is used. Upgrading from 0.2.0 or 0.1.0: pip install -U "dyng[cu13]" (or "dyng[cu12]", or -U dyng without the plugin); without -U pip keeps the installed release. The C++ library, the documentation and the parity reports with the original codes are at https://github.com/dyng-dev/dyng.

Cite dynG and the papers behind the algorithms you use: dyng.citation("sssp").

License: dynG is Apache-2.0. The wheel also contains nanobind (BSD-3-Clause), robin-map (MIT) and the GCC runtime (GPL-3.0-or-later WITH GCC-exception-3.1), which the distributions' licence expression names; their licences are in THIRD_PARTY_LICENSES.txt.

Metadata

Release files for dyng 0.3.0

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

Source distribution (sdist)

Source distribution for dyng 0.3.0
File Size Uploaded Provenance Actions
dyng-0.3.0.tar.gz 1.6 MB With provenance Details for dyng-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dyng 0.3.0
File Interpreter ABI Platform Actions
dyng-0.3.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 abi3 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for dyng-0.3.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Total release size: 3.6 MB

Release files / dyng-0.3.0.tar.gz

Download URL dyng-0.3.0.tar.gz
Size 1.6 MB
Tags Source
SHA-256 checksum
How to use checksums
b371cc9b381844caa60aaf6715e12ba3c6d4855c26b6eef2b1a41db384197619
BLAKE2b-256 checksum
How to use checksums
859de691d9640e95ba2dfd3c3d4feb39377eea0d98d1c847d0f30da76c91c2ba
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 Oct 29, 2026.

Transparency log

Release files / dyng-0.3.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL dyng-0.3.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 2.0 MB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
a45fc87697dcd4aa2f74da0dd733f936104460900d8c8532695f56f00a890671
BLAKE2b-256 checksum
How to use checksums
4bd7c7a34c5903348561a2725f6c960a657e582451a98b62bd0557832204ac7f
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 Oct 29, 2026.

Transparency log

Security for dyng 0.3.0

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 dyng-0.3.0.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 Oct 29, 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.

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