Metadata-Version: 2.4
Name: dyng
Version: 0.2.0
Summary: dynG: dynamic graph and hypergraph algorithms that update their results under batches of changes
Keywords: dynamic graph,batch update,shortest paths,cycle counting,GPU,OpenMP,graph algorithms
Author-Email: S M Shovan <sm.shovan@gmail.com>
License-Expression: Apache-2.0 AND BSD-3-Clause AND MIT AND GPL-3.0-or-later WITH GCC-exception-3.1
License-File: LICENSE
License-File: LICENSES/Apache-2.0.txt
License-File: NOTICE
License-File: THIRD_PARTY_LICENSES.txt
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Developers
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: C++
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Typing :: Typed
Project-URL: Homepage, https://github.com/dyng-dev/dyng
Project-URL: Documentation, https://dyng-dev.github.io/dyng/
Project-URL: Repository, https://github.com/dyng-dev/dyng
Project-URL: Issues, https://github.com/dyng-dev/dyng/issues
Project-URL: Changelog, https://github.com/dyng-dev/dyng/blob/main/CHANGELOG.md
Requires-Python: >=3.12
Requires-Dist: numpy>=1.26
Provides-Extra: test
Requires-Dist: pytest>=8; extra == "test"
Requires-Dist: hypothesis>=6.100; extra == "test"
Provides-Extra: torch
Requires-Dist: torch; extra == "torch"
Provides-Extra: pandas
Requires-Dist: pandas; extra == "pandas"
Provides-Extra: cu12
Requires-Dist: dyng-cu12==0.2.0; extra == "cu12"
Provides-Extra: cu13
Requires-Dist: dyng-cu13==0.2.0; extra == "cu13"
Provides-Extra: cupy-cu12
Requires-Dist: cupy-cuda12x; extra == "cupy-cu12"
Provides-Extra: cupy-cu13
Requires-Dist: cupy-cuda13x; extra == "cupy-cu13"
Description-Content-Type: text/markdown

# dynG

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

<!-- snippet: pypi-readme -->
```python
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
```

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

```console
$ 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
```

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. 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`.
