Flowty Network Optimization Solver
Project description
Flowty
Flowty is a network optimization solver for multi-commodity flow (MCF), resource-constrained MCF (RCMCF), fixed-charge MCF (FCMCF), vehicle routing (VRPTW), and related problems. It uses column generation with branch-and-bound, where subproblems are resource-constrained shortest path problems solved over user-defined graphs. Written in C++ with a Python interface.
Installation
System dependencies (Ubuntu/Debian):
sudo apt-get install libopenblas0 libtbb12
Then install the package:
pip install flowty
Quick Start
Multi-Commodity Flow
Use McfModel for MCF problems:
import flowty
model = flowty.McfModel(flowty.McfModel.Type.Path)
# Network with 4 edges: sources, targets, costs, capacities
model.addEdges([0, 1, 0, 2], [1, 3, 2, 3], [1.0, 1.0, 1.0, 2.0], [10.0, 10.0, 10.0, 10.0])
# Two commodities: origins, destinations, demands
model.addCommodities([0, 0], [1, 3], [3.0, 2.0])
status = model.solve()
solution = model.getSolution()
print(f"Status: {status}, Cost: {solution.cost}")
print(f"Edge flows: {solution.edgeFlows}")
Vehicle Routing with Time Windows
Use Model for VRPTW and other resource-constrained problems:
import flowty
model = flowty.Model()
# Graph: depot(0) -> customer(1) -> depot(2)
edges = [(0, 1), (1, 2)]
costs = [1.0, 1.0]
# Resources: time windows and capacity
resources = [
({"V": [[0, 0, 0], [10, 10, 10]], "E": [[1, 1]]}, "time"),
({"V": [[0, 1, 0]], "G": [2]}, "capacity"),
]
graph = model.addGraph(edges, costs, [], resources, flowty.Graph.PathSense.Simple)
rules = [("Window", ["time"]), ("Capacity", ["capacity"])]
model.addSubproblem(graph, 0, 2, 0.0, 1.0, 1.0, "B", rules)
# Each customer must be visited at least once
model += graph.vertices[1] >= 1.0
status = model.solve()
solution = model.getSolution()
print(f"Status: {status}, Cost: {solution.cost}")
Documentation
Full documentation at docs.flowty.ai.
License
The solver ships with a Non-Commercial License. For commercial licenses, contact license@flowty.ai.
Issues & Contact
Report issues at github.com/flowty/flowty.
For inquiries contact info@flowty.ai.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flowty-2.2.1-cp312-abi3-manylinux_2_39_x86_64.whl.
File metadata
- Download URL: flowty-2.2.1-cp312-abi3-manylinux_2_39_x86_64.whl
- Upload date:
- Size: 4.8 MB
- Tags: CPython 3.12+, manylinux: glibc 2.39+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0a3f5f004a60282e3ca4d711b9c367d454cefa9808a6e8224ea3edab7623ab2a
|
|
| MD5 |
7bf4e39efa2d837a286c2e4abf148089
|
|
| BLAKE2b-256 |
2326c071fe552d82ef897780ff3b8d3d3897736a1429629f8d3c42ce87f0ec56
|
Provenance
The following attestation bundles were made for flowty-2.2.1-cp312-abi3-manylinux_2_39_x86_64.whl:
Publisher:
release.yml on flowty/flowty-core
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
flowty-2.2.1-cp312-abi3-manylinux_2_39_x86_64.whl -
Subject digest:
0a3f5f004a60282e3ca4d711b9c367d454cefa9808a6e8224ea3edab7623ab2a - Sigstore transparency entry: 1233353954
- Sigstore integration time:
-
Permalink:
flowty/flowty-core@cb024ad8d8e7025433b2415285887027da2dbf74 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/flowty
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@cb024ad8d8e7025433b2415285887027da2dbf74 -
Trigger Event:
workflow_dispatch
-
Statement type: