Skip to main content

Flow Network C++ Implementation

Project description

Flow Network

网络流的工业级应用

Release Drafter Upload Python Package

使用 Dinic 和朴素费用流,算法来自 DuckKnowNothing - 网络流

支持平台

在尝试了各种方法之后,GitHub Actions 在 Windows 平台下始终无法正确编译 C++,所以放弃支持 Windows 平台

  • Linux
  • macOS

安装

pip install flow-network

样例代码

from flow_network import FlowNetwork, MinimumCostFlow

fn = FlowNetwork(2)  # 创建一个包含 2 个点的网络流对象,下标从 0 开始
fn.add_edge(0, 1, 3)  # 添加一条从 0 指向 1 的边,流量为 3
result = fn.run(0, 1)  # 指定源点为 0,汇点为 1,跑最大流 & 最小割
print(result)  # 3

mcf = MinimumCostFlow(2)  # 创建一个包含 2 个点的费用流对象,下标从 1 开始
mcf.add_edge(0, 1, 3, 2)  # 添加一条从 0 指向 1 的边,流量为 3,单位流量的费用为 2
flow, cost = mcf.run(0, 1)  # 指定源点为 0,汇点为 1,跑最大流 & 最小费
print(flow, cost)  # 3 6

测试代码

tests.py

Reference

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

flow_network-0.1.3-cp39-cp39-manylinux2010_x86_64.whl (90.7 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64

flow_network-0.1.3-cp39-cp39-manylinux1_x86_64.whl (90.7 kB view details)

Uploaded CPython 3.9

flow_network-0.1.3-cp39-cp39-macosx_10_14_x86_64.whl (19.2 kB view details)

Uploaded CPython 3.9 macOS 10.14+ x86-64

flow_network-0.1.3-cp38-cp38-manylinux2010_x86_64.whl (90.7 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

flow_network-0.1.3-cp38-cp38-manylinux1_x86_64.whl (90.7 kB view details)

Uploaded CPython 3.8

flow_network-0.1.3-cp38-cp38-macosx_10_14_x86_64.whl (18.4 kB view details)

Uploaded CPython 3.8 macOS 10.14+ x86-64

flow_network-0.1.3-cp37-cp37m-manylinux2010_x86_64.whl (90.7 kB view details)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

flow_network-0.1.3-cp37-cp37m-manylinux1_x86_64.whl (90.7 kB view details)

Uploaded CPython 3.7m

flow_network-0.1.3-cp36-cp36m-manylinux2010_x86_64.whl (90.7 kB view details)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

flow_network-0.1.3-cp36-cp36m-manylinux1_x86_64.whl (90.7 kB view details)

Uploaded CPython 3.6m

File details

Details for the file flow_network-0.1.3-cp39-cp39-manylinux2010_x86_64.whl.

File metadata

  • Download URL: flow_network-0.1.3-cp39-cp39-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 90.7 kB
  • Tags: CPython 3.9, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.9

File hashes

Hashes for flow_network-0.1.3-cp39-cp39-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 e74220ec52c30a7c901ec578df0e027712945eef0106ccc78692195904fed72f
MD5 3c674224022bef0d8e812f5b85d086ad
BLAKE2b-256 2dc8384299a8dee17cc5bbefcd1b2c8957731d01438fa15a5d1a49a99c7af86d

See more details on using hashes here.

File details

Details for the file flow_network-0.1.3-cp39-cp39-manylinux1_x86_64.whl.

File metadata

  • Download URL: flow_network-0.1.3-cp39-cp39-manylinux1_x86_64.whl
  • Upload date:
  • Size: 90.7 kB
  • Tags: CPython 3.9
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.9

File hashes

Hashes for flow_network-0.1.3-cp39-cp39-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 9911fe0c0e77cd93727ed2df6329b80b308a0098906c536e2b7d7c9a2c198855
MD5 f24887ed7f3b96625d708ab4f0e4bd28
BLAKE2b-256 26e89a6f05d98142c212ab0a04ad2aa3140fae5a7fe894d9e01dae6a34dfe80c

See more details on using hashes here.

File details

Details for the file flow_network-0.1.3-cp39-cp39-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: flow_network-0.1.3-cp39-cp39-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 19.2 kB
  • Tags: CPython 3.9, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0

File hashes

Hashes for flow_network-0.1.3-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 b85122301d70b8e125abeea9a5343fba81e8d0c60e3f5d0fa0b3bb6680e2c122
MD5 0a3b3af34e84895bdae0c12b6bbb0134
BLAKE2b-256 57fa9ae5f25df20c83e21b5e1614af9a0e47dfaaa2caef5e97317fd585cae263

See more details on using hashes here.

File details

Details for the file flow_network-0.1.3-cp38-cp38-manylinux2010_x86_64.whl.

File metadata

  • Download URL: flow_network-0.1.3-cp38-cp38-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 90.7 kB
  • Tags: CPython 3.8, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.9

File hashes

Hashes for flow_network-0.1.3-cp38-cp38-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 a8bbecf2ca08e6cd5bad9f9ba158b834c0f1716e1f89f21c929494502bfa53f3
MD5 76e6d2f81fda0e5cf072117d1b5fc3ef
BLAKE2b-256 3e9696d941d0b70c9085deb2af2de27ae11e75a6d23d471b441680b32c76e795

See more details on using hashes here.

File details

Details for the file flow_network-0.1.3-cp38-cp38-manylinux1_x86_64.whl.

File metadata

  • Download URL: flow_network-0.1.3-cp38-cp38-manylinux1_x86_64.whl
  • Upload date:
  • Size: 90.7 kB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.9

File hashes

Hashes for flow_network-0.1.3-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e8f06a9e69a73cff3d7504472d3d8f073d5341543497c5bad3553d342bf707a2
MD5 07836d7965b5885309080aab73bd9c7d
BLAKE2b-256 45a24abf42761af350525cce6bb1b45191a1445b7d391ec6466b3615071a7f4e

See more details on using hashes here.

File details

Details for the file flow_network-0.1.3-cp38-cp38-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: flow_network-0.1.3-cp38-cp38-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 18.4 kB
  • Tags: CPython 3.8, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6

File hashes

Hashes for flow_network-0.1.3-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 5685be3976cbb6cd6ebe1c2575e44b3d6e44f6354fb430fcf253742f49759d87
MD5 b3cbaea1c6da2802197230ff4429c308
BLAKE2b-256 3c8b9a6fbbb7160ac5697ec984c4f07216ba528543053bd99c2e212527b8c491

See more details on using hashes here.

File details

Details for the file flow_network-0.1.3-cp37-cp37m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: flow_network-0.1.3-cp37-cp37m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 90.7 kB
  • Tags: CPython 3.7m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.9

File hashes

Hashes for flow_network-0.1.3-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 3ab59800b591e8ee83c17c29fdf5ec67ba61936acd4daa3697452debb023f865
MD5 65a94127d5f7c744a8c923736100f676
BLAKE2b-256 c8d55cb357f2e55bdcb01b5fd78cbcacc579a870f5feb3d9173d51a772520ee9

See more details on using hashes here.

File details

Details for the file flow_network-0.1.3-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

  • Download URL: flow_network-0.1.3-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 90.7 kB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.9

File hashes

Hashes for flow_network-0.1.3-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 d24da66fc830ac08696a94202a2961bf6b08302769c8b4d1a6370586cc4b55f6
MD5 0fdcde2256a5928b057df51446b1cf90
BLAKE2b-256 eebfbf5c759290ce64d140903548842f5c2d0d06c9e86e62b4908da6af6e398b

See more details on using hashes here.

File details

Details for the file flow_network-0.1.3-cp36-cp36m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: flow_network-0.1.3-cp36-cp36m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 90.7 kB
  • Tags: CPython 3.6m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.9

File hashes

Hashes for flow_network-0.1.3-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 8a3d210b50f8b44bc9b6a07d5c3844dfc825290a29396c6d2a52373821ac6b1f
MD5 564877c419e8ec99582fa5fe1d128fbc
BLAKE2b-256 bf9e79873b86fd15e2a508e9ef1c2a0a3b7eb67ee7361e0ba1bd5383206f3369

See more details on using hashes here.

File details

Details for the file flow_network-0.1.3-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: flow_network-0.1.3-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 90.7 kB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.9

File hashes

Hashes for flow_network-0.1.3-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 380e4d88fde3c61c94945e722b39b014f87a1193debda90563dc7a98b7ba9708
MD5 00bea336224f175696d4792c9edaa32e
BLAKE2b-256 af77d77d43431b9c2e75f2eccb75dba0490211987dc3f1b3efbb764512d93378

See more details on using hashes here.

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