Skip to main content

Flow Network Python Library

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 MaximumFlow, MinimumCostFlow

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

mcf = MinimumCostFlow(2)  # 创建一个包含 2 个点的费用流对象,下标从 0 开始
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 Distribution

flow-network-0.1.11.tar.gz (63.8 kB view details)

Uploaded Source

Built Distributions

flow_network-0.1.11-cp39-cp39-manylinux2010_x86_64.whl (644.7 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64

flow_network-0.1.11-cp39-cp39-manylinux1_x86_64.whl (644.7 kB view details)

Uploaded CPython 3.9

flow_network-0.1.11-cp38-cp38-win_amd64.whl (98.3 kB view details)

Uploaded CPython 3.8 Windows x86-64

flow_network-0.1.11-cp38-cp38-manylinux2010_x86_64.whl (634.8 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

flow_network-0.1.11-cp38-cp38-manylinux1_x86_64.whl (634.8 kB view details)

Uploaded CPython 3.8

flow_network-0.1.11-cp38-cp38-macosx_10_9_x86_64.whl (95.3 kB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

flow_network-0.1.11-cp37-cp37m-manylinux2010_x86_64.whl (636.1 kB view details)

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

flow_network-0.1.11-cp37-cp37m-manylinux1_x86_64.whl (636.1 kB view details)

Uploaded CPython 3.7m

flow_network-0.1.11-cp36-cp36m-manylinux2010_x86_64.whl (634.8 kB view details)

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

flow_network-0.1.11-cp36-cp36m-manylinux1_x86_64.whl (634.8 kB view details)

Uploaded CPython 3.6m

File details

Details for the file flow-network-0.1.11.tar.gz.

File metadata

  • Download URL: flow-network-0.1.11.tar.gz
  • Upload date:
  • Size: 63.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

File hashes

Hashes for flow-network-0.1.11.tar.gz
Algorithm Hash digest
SHA256 8c9d54fb42e1bb694c6ff32ee3b6efc04f3390f2b9c705c66058844f412db756
MD5 677acd6a53602f299b71c6415b0a6422
BLAKE2b-256 9dfba590e19edeca2ebf6d900b73d1c313c61fc648809dd969f96273ab2c35ca

See more details on using hashes here.

File details

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

File metadata

  • Download URL: flow_network-0.1.11-cp39-cp39-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 644.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.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.7.9

File hashes

Hashes for flow_network-0.1.11-cp39-cp39-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 e70a7f5e413aa31027d51306bab2a49df7d229cd894d650ad66c971942813df4
MD5 cb251018773d10c8b34496ef94abd218
BLAKE2b-256 634e4ddce55d796cb2d00a583c476a60b2a05f460fffd8e43b41be159005c4ca

See more details on using hashes here.

File details

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

File metadata

  • Download URL: flow_network-0.1.11-cp39-cp39-manylinux1_x86_64.whl
  • Upload date:
  • Size: 644.7 kB
  • Tags: CPython 3.9
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.7.9

File hashes

Hashes for flow_network-0.1.11-cp39-cp39-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 541986508d09ee70dc07c6213a570e336e1cb3c6c340dd7864491c97b7e8e7df
MD5 2beab98da9f3d5a495a43b53f7217990
BLAKE2b-256 c65396cb78fa4bc6eff6cbf954e8977729b7993c5d665f0e58d9cec25fd7b3d5

See more details on using hashes here.

File details

Details for the file flow_network-0.1.11-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: flow_network-0.1.11-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 98.3 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

File hashes

Hashes for flow_network-0.1.11-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 ce067656d205d98a9f479c69cb0d1a795d45d43e54a8d33741f712141c177c2a
MD5 d9bba44bc6e522c6f6c8dd7fe76a6594
BLAKE2b-256 4de3384b4f149ca419de239d099f00ec8409f793d0d9e105c9f9144f23f4f49f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: flow_network-0.1.11-cp38-cp38-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 634.8 kB
  • Tags: CPython 3.8, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.7.9

File hashes

Hashes for flow_network-0.1.11-cp38-cp38-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 742a1356f5c73348f89e3c7be00810eda720658db826c8f9905af9af05114410
MD5 703c317eefc85c67633c1e86683469db
BLAKE2b-256 9f5bd1605c948fb8e2de1d7dfb426177c5ffa2db421e256764db9b5f273c1301

See more details on using hashes here.

File details

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

File metadata

  • Download URL: flow_network-0.1.11-cp38-cp38-manylinux1_x86_64.whl
  • Upload date:
  • Size: 634.8 kB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.7.9

File hashes

Hashes for flow_network-0.1.11-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 93c5b076a36fc52b219bd190f92e660c79d22b5bcad207404f857b2143c7b8a6
MD5 92c0e061041daa994d9a3bc3fc89bc30
BLAKE2b-256 ff140d376d34ef495a1dcfe7ea91cfb5e9b3de6c232497fba4912e067e654cf5

See more details on using hashes here.

File details

Details for the file flow_network-0.1.11-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: flow_network-0.1.11-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 95.3 kB
  • Tags: CPython 3.8, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

File hashes

Hashes for flow_network-0.1.11-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 977e7f2aec8ba53b6ef710816d060f185ec3647a3ad30271aeb051d09539e287
MD5 3c86ca22826e2a8e21bd1a94775ba60e
BLAKE2b-256 ca8d3d365d4324133eb8a7aca81a5f06a87fa5c698e00de3b0791aa01f08f71b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: flow_network-0.1.11-cp37-cp37m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 636.1 kB
  • Tags: CPython 3.7m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.7.9

File hashes

Hashes for flow_network-0.1.11-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 2dae3658cf8c2cc82f723f21bdeebf74420935cdf073bf26a22a5ae9bad995b6
MD5 d8e7fea267c9f1b23784b2ce23d99c89
BLAKE2b-256 8f4a18dab5160b9440da29f9aa9637c320f7d7826a5ef596a0d188b53372dbed

See more details on using hashes here.

File details

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

File metadata

  • Download URL: flow_network-0.1.11-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 636.1 kB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.7.9

File hashes

Hashes for flow_network-0.1.11-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 a666c9c356f2fe0e57304b37aab087e02758eaa37b95f925618969aa5979316e
MD5 c9e2979ad98110e7067b42e728520100
BLAKE2b-256 95a7d2ecf2bdef37c6839753fc886f94e7617317de4172c7048093bc6a932f17

See more details on using hashes here.

File details

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

File metadata

  • Download URL: flow_network-0.1.11-cp36-cp36m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 634.8 kB
  • Tags: CPython 3.6m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.7.9

File hashes

Hashes for flow_network-0.1.11-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 fd72200d09f0edfe2672bc40c29eb1c6bedf0d3aae7cbc34554288e41504177d
MD5 66a9d4c7377230c9134ae810f2e9d8bf
BLAKE2b-256 b533880b36ddaf53d63acded30644724c7aa0a5399d310bd085716d205e0b4be

See more details on using hashes here.

File details

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

File metadata

  • Download URL: flow_network-0.1.11-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 634.8 kB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.7.9

File hashes

Hashes for flow_network-0.1.11-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 052bbe04a9c835e0849b32704620e6913f02cfab2dfe6ee8b130b6e2afabea43
MD5 58ca40c76cc33de52a3ce67a8c8932bb
BLAKE2b-256 1bb0b843798c002e46ca8819280c8394b0aa2db4626b561a02e33595580b780a

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