Skip to main content

C++ implementation of graph algorithms for network flow analysis and traffic engineering with Python bindings

Project description

NetGraph-Core

C++ graph engine for network flow analysis, traffic engineering simulation, and capacity planning.

Overview

NetGraph-Core provides a specialized graph implementation for networking problems. Key design priorities:

  • Determinism: Guaranteed reproducible edge ordering by (cost, src, dst).
  • Flow Modeling: Native support for multi-commodity flow state, residual tracking, and ECMP/WCMP placement.
  • Performance: Immutable CSR (Compressed Sparse Row) adjacency and zero-copy NumPy views.

Core Features

1. Graph Representations

  • StrictMultiDiGraph: Immutable directed multigraph using CSR adjacency. Supports parallel edges (multi-graph), essential for network topologies.
  • FlowGraph: Topology overlay managing mutable flow state, per-flow edge allocations, and residual capacities.

2. Network Algorithms

  • Shortest Paths (SPF):

    • Modified Dijkstra returns a Predecessor DAG to capture all equal-cost paths.
    • Supports ECMP (Equal-Cost Multi-Path) routing.
    • Features node/edge masking and residual-aware tie-breaking.
  • K-Shortest Paths (KSP):

    • Yen's algorithm returning DAG-wrapped paths.
    • Configurable constraints on cost factors (e.g., paths within 1.5x of optimal).
  • Max-Flow:

    • Algorithm: Iterative augmentation using Successive Shortest Path on residual graphs, pushing flow across full ECMP/WCMP DAGs at each step.
    • Traffic Engineering (TE) Mode: Routing adapts to residual capacity (progressive fill).
    • IP Routing Mode: Cost-only routing (ECMP/WCMP) ignoring capacity constraints.
  • Analysis:

    • Sensitivity Analysis: Identifies bottleneck edges where capacity relaxation increases total flow.
    • Min-Cut: Computes minimum cuts on residual graphs.

3. Flow Policy Engine

Unified configuration object (FlowPolicy) that models diverse routing behaviors:

  • Modeling: Unified configuration for IP Routing (static costs) and Traffic Engineering (dynamic residuals).
  • Placement Strategies:
    • EqualBalanced: ECMP (equal splitting) - equal distribution across next-hops and parallel edges.
    • Proportional: WCMP (weighted splitting) - distribution proportional to residual capacity.
  • Lifecycle Management: Handles demand placement, re-optimization of existing flows, and constraints (path cost, stretch factor, flow counts).

4. Python Integration

  • Zero-Copy: Exposes C++ internal buffers to Python as read-only NumPy arrays (float64/int64).
  • Concurrency: Releases the Python GIL during graph algorithms to enable threading.

Installation

pip install netgraph-core

Or from source:

pip install -e .

Repository Structure

src/                    # C++ implementation
include/netgraph/core/  # Public C++ headers
bindings/python/        # pybind11 bindings
python/netgraph_core/   # Python package
tests/cpp/              # C++ tests (googletest)
tests/py/               # Python tests (pytest)

Development

make dev        # Setup: venv, dependencies, pre-commit hooks
make check      # Run all tests and linting (auto-fix formatting)
make check-ci   # Strict checks without auto-fix (for CI)
make cpp-test   # C++ tests only
make py-test    # Python tests only
make cov        # Coverage report (C++ + Python)

Requirements

  • C++: C++20 compiler (GCC 10+, Clang 12+, MSVC 2019+)
  • Python: 3.9+
  • Build: CMake 3.15+, scikit-build-core
  • Dependencies: pybind11, NumPy

License

AGPL-3.0-or-later

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

netgraph_core-0.1.0.tar.gz (136.3 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

netgraph_core-0.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (323.9 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

netgraph_core-0.1.0-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl (339.6 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ i686

netgraph_core-0.1.0-cp313-cp313-macosx_10_13_universal2.whl (536.8 kB view details)

Uploaded CPython 3.13macOS 10.13+ universal2 (ARM64, x86-64)

netgraph_core-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (322.9 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

netgraph_core-0.1.0-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl (339.3 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ i686

netgraph_core-0.1.0-cp312-cp312-macosx_10_13_universal2.whl (536.9 kB view details)

Uploaded CPython 3.12macOS 10.13+ universal2 (ARM64, x86-64)

netgraph_core-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (324.6 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

netgraph_core-0.1.0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl (339.0 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ i686

netgraph_core-0.1.0-cp311-cp311-macosx_10_9_universal2.whl (528.0 kB view details)

Uploaded CPython 3.11macOS 10.9+ universal2 (ARM64, x86-64)

netgraph_core-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (323.1 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

netgraph_core-0.1.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl (337.9 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ i686

netgraph_core-0.1.0-cp310-cp310-macosx_10_9_universal2.whl (524.9 kB view details)

Uploaded CPython 3.10macOS 10.9+ universal2 (ARM64, x86-64)

netgraph_core-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (323.3 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

netgraph_core-0.1.0-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl (338.2 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ i686

netgraph_core-0.1.0-cp39-cp39-macosx_10_9_universal2.whl (525.1 kB view details)

Uploaded CPython 3.9macOS 10.9+ universal2 (ARM64, x86-64)

File details

Details for the file netgraph_core-0.1.0.tar.gz.

File metadata

  • Download URL: netgraph_core-0.1.0.tar.gz
  • Upload date:
  • Size: 136.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for netgraph_core-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2f58b151e5a59ba93080e82360f2667a7e457b7c563520ad5b07cabd9c123a65
MD5 0c5900e15e72b92b3e1d4fb46dd90b56
BLAKE2b-256 c419129aa68ac40fb31d2bb5ce79cc4138e8ced05f66e6b4d980e53d574de1e0

See more details on using hashes here.

Provenance

The following attestation bundles were made for netgraph_core-0.1.0.tar.gz:

Publisher: release.yml on networmix/NetGraph-Core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file netgraph_core-0.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for netgraph_core-0.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 39a16ec8b378c7b09bd0208e327785158587ccf787bb32dc4edafca0c4b5288c
MD5 fd59a718859b25088140937710ef8cd4
BLAKE2b-256 d8d3953b54f93e0eee3d811f27c351791dcf24ecd4695c2b9465acf6b5a2a159

See more details on using hashes here.

Provenance

The following attestation bundles were made for netgraph_core-0.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on networmix/NetGraph-Core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file netgraph_core-0.1.0-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for netgraph_core-0.1.0-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 954bdf2e8bfece15af085bbf120f92366c325e37f774aed5122ddd81b985f359
MD5 9359107da8b7b48ce8caf32d98f5b4ff
BLAKE2b-256 680d929079a020ea53e92dc8813ad31dd74410e46d66483e8325392238b76980

See more details on using hashes here.

Provenance

The following attestation bundles were made for netgraph_core-0.1.0-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl:

Publisher: release.yml on networmix/NetGraph-Core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file netgraph_core-0.1.0-cp313-cp313-macosx_10_13_universal2.whl.

File metadata

File hashes

Hashes for netgraph_core-0.1.0-cp313-cp313-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 1d863fbc6d65e6c676125806c47698c154c42b37e0ed5c80eea01ac1c3878b61
MD5 6bacbcd0c862ac2504af1c2e89200785
BLAKE2b-256 e524ac78a4ea91e2d935672b857e0e77977e962954a3d6dfd8ab21134ee5019b

See more details on using hashes here.

Provenance

The following attestation bundles were made for netgraph_core-0.1.0-cp313-cp313-macosx_10_13_universal2.whl:

Publisher: release.yml on networmix/NetGraph-Core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file netgraph_core-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for netgraph_core-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4ebd6ef8ebaa8fb67b25c109f00b76106095fa1ea387a0463b76838daa0b4d62
MD5 44f528d31d30e75d1f5f54fd19d1626b
BLAKE2b-256 6545f42c80e3860dcf9bc044422684a6eb1401a05b07cfde409b421dcfef1899

See more details on using hashes here.

Provenance

The following attestation bundles were made for netgraph_core-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on networmix/NetGraph-Core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file netgraph_core-0.1.0-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for netgraph_core-0.1.0-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 5b1d44329caa45d6e94427ae28db1afb18623b9d3e434a1b30da781b32b7a64c
MD5 f1ab92357fbc8a1e0efe5ac95fbc219e
BLAKE2b-256 5364ed3e08d7fb8b7071045fe399f929508fde764f6734e2ea64663bfdfbd3aa

See more details on using hashes here.

Provenance

The following attestation bundles were made for netgraph_core-0.1.0-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl:

Publisher: release.yml on networmix/NetGraph-Core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file netgraph_core-0.1.0-cp312-cp312-macosx_10_13_universal2.whl.

File metadata

File hashes

Hashes for netgraph_core-0.1.0-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 06c75c0c161cddfed9c6b3d597e746301d2acedc475f5d782c753aaed728d340
MD5 b4d7a0a012ae489a1a0d5e479b6ae6c3
BLAKE2b-256 8bfdd8e0ee4370efe4222c62d7afbe0825755c5999ac3b7ef9daf1a09bf1a00a

See more details on using hashes here.

Provenance

The following attestation bundles were made for netgraph_core-0.1.0-cp312-cp312-macosx_10_13_universal2.whl:

Publisher: release.yml on networmix/NetGraph-Core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file netgraph_core-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for netgraph_core-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7e34aed7f69ca47db4335db80fc7d8e0b3b3cfd3b0058414c62463758febb6e7
MD5 bb970c0c51a873e0150c2a7d934e91a2
BLAKE2b-256 1c74ecfee4112d9d20e28ffedc94264baeef8de148f62bc183ffb9f5b94c55e9

See more details on using hashes here.

Provenance

The following attestation bundles were made for netgraph_core-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on networmix/NetGraph-Core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file netgraph_core-0.1.0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for netgraph_core-0.1.0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 84b3cc4237653fb1bbae6d6c8be7eb19816c0f8a2cc170e4f4d2ff2dfcc13079
MD5 ad81423b0c153ed3c11c2b5bdc372093
BLAKE2b-256 7720822e78bdc3f75864228a51176f9ee118d8b205a8da00e8529b94270b024a

See more details on using hashes here.

Provenance

The following attestation bundles were made for netgraph_core-0.1.0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl:

Publisher: release.yml on networmix/NetGraph-Core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file netgraph_core-0.1.0-cp311-cp311-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for netgraph_core-0.1.0-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 fc438604d6fd6742c444a97ddb17786ef45c803f48953a184b77ec4433e23c2b
MD5 ded40094b1ba990aa018688bc049e3b0
BLAKE2b-256 e4f3e2fc251cf85f7fa88af19a0eff0f6491d2df0428e7d9459f79c2083d5d4d

See more details on using hashes here.

Provenance

The following attestation bundles were made for netgraph_core-0.1.0-cp311-cp311-macosx_10_9_universal2.whl:

Publisher: release.yml on networmix/NetGraph-Core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file netgraph_core-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for netgraph_core-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1ff5d92f1ef44585c60f4bb8c8570f6d97db3bd68d15be87747835bf7898ac89
MD5 044178c2385a1c401678b60b2705d863
BLAKE2b-256 bcb57b7bd622eba325e820a0fe2ac8cebdfa5691c511b03659c1168eea2d7eb1

See more details on using hashes here.

Provenance

The following attestation bundles were made for netgraph_core-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on networmix/NetGraph-Core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file netgraph_core-0.1.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for netgraph_core-0.1.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 5ce430e3c3e1922dd8ced502d1c57dcb36e6e4f21d8408d1a00674407e3cfdb4
MD5 2266f423d763b957b64e23f0b65ac228
BLAKE2b-256 e09d2b87b996057b80d0ba149473f498d4f2cde70445c8432079c94a0ad59f82

See more details on using hashes here.

Provenance

The following attestation bundles were made for netgraph_core-0.1.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl:

Publisher: release.yml on networmix/NetGraph-Core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file netgraph_core-0.1.0-cp310-cp310-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for netgraph_core-0.1.0-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 02faec5435dba628f8d72a61017b88d715fb7df41ba5314f0c108d675578ac0c
MD5 cc6b9372dacec61012d8138f8b979b9a
BLAKE2b-256 1c07322847f6a717fbaa73cf9693bd2e1eaf7d1e42194e93d3bc792dfa09ff16

See more details on using hashes here.

Provenance

The following attestation bundles were made for netgraph_core-0.1.0-cp310-cp310-macosx_10_9_universal2.whl:

Publisher: release.yml on networmix/NetGraph-Core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file netgraph_core-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for netgraph_core-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 85071daa2b4fb6b4b1a96caf30848befd4bef08d54fe231bfc9841ac0b4a6095
MD5 b5cd8f84f14f933ec0ddd88122f41947
BLAKE2b-256 1c991a9acb2a9da6f93f9626c1d331af5f2b20cac74b4cb2c46c057cb9e7193b

See more details on using hashes here.

Provenance

The following attestation bundles were made for netgraph_core-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on networmix/NetGraph-Core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file netgraph_core-0.1.0-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for netgraph_core-0.1.0-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 6f7af700703fbf9b39fc4729c3f18b6153687c2e53e71b92840de374e7294cef
MD5 5072bc71181f9950e4a7b65592890b9e
BLAKE2b-256 c9d4f69fc336bbe67f10e9b0647bb947a05d3e38dd9ddd7e196a1724a808cbca

See more details on using hashes here.

Provenance

The following attestation bundles were made for netgraph_core-0.1.0-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl:

Publisher: release.yml on networmix/NetGraph-Core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file netgraph_core-0.1.0-cp39-cp39-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for netgraph_core-0.1.0-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 0cd52f45c1d898b59b6945337d5cf102cf22263dac5350d6392a1d5666205f78
MD5 16c3797f273fdcc2b2583aedaa944f12
BLAKE2b-256 7ab554ce2dbf497ba2377a70c26a8d640e4a8863cbf0c3f525e1f3c11fa83147

See more details on using hashes here.

Provenance

The following attestation bundles were made for netgraph_core-0.1.0-cp39-cp39-macosx_10_9_universal2.whl:

Publisher: release.yml on networmix/NetGraph-Core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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