|
1 | 1 | # {: style="height:30px"} _flowpaths_ Python Package |
2 | 2 |
|
3 | | -This package implements solvers for decomposing weighted directed graphs into weighted paths or walks, based on (Mixed) Integer Linear Programming ((M)ILP) formulations. It supports both acyclic graphs (DAGs, decomposed into paths) and general graphs with cycles (decomposed into walks), and makes it easy to create new decomposition models. |
| 3 | +This package implements fast solvers for decomposing weighted directed graphs into weighted paths or walks, based on (Mixed) Integer Linear Programming ((M)ILP) formulations. It supports both acyclic graphs (DAGs, decomposed into paths) and general graphs with cycles (decomposed into walks), and makes it easy to create new decomposition models. |
4 | 4 |
|
5 | 5 |  |
6 | 6 |
|
@@ -74,19 +74,22 @@ if mfd_solver.is_solved(): |
74 | 74 |
|
75 | 75 | You can inherit from these classes to add weights and model-specific constraints/objectives. See [a basic example](https://github.com/algbio/flowpaths/blob/main/examples/inexact_flow_solver.py). These abstract classes interface with a wrapper for popular MILP solvers, so you don't need to worry about solver-specific details. |
76 | 76 |
|
77 | | -4. **Fast**: Having solvers implemented using `AbstractPathModelDAG` means that any optimization to the path-finding mechanisms benefits **all** solvers that inherit from this class. We implement some "safety optimizations" described in [this paper](https://doi.org/10.4230/LIPIcs.ESA.2025.55), based on ideas first introduced in [this paper](https://doi.org/10.4230/LIPIcs.SEA.2024.14), which can provide up to **1000x speedups**, depending on the graph instance, while preserving global optimality (under some simple assumptions). |
| 77 | +4. **Fast**: Having solvers implemented using `AbstractPathModelDAG` or `AbstractWalkModelDiGraph` means that any optimization to the path-/walk-finding mechanisms benefits **all** solvers that inherit from these classes. In particular, in these abstract classes we implement "safety optimizations" described in [this paper](https://doi.org/10.4230/LIPIcs.ESA.2025.55) (for DAGs) and [this paper](http://arxiv.org/abs/2511.19153) (for general graphs), based on ideas first introduced in [this paper](https://doi.org/10.4230/LIPIcs.SEA.2024.14). These can provide up to **1000x speedups**, depending on the graph instance, while preserving global optimality (under some simple assumptions). |
78 | 78 |
|
79 | | -5. **Flexible inputs**: The models support graphs with flows/weights on either edges or nodes, and additional real use-case input features, such as subpath or subset constraints. |
| 79 | +5. **Flexible inputs**: The models support graphs with flows/weights on either edges or nodes, and additional real use-case input features, such as [subpathconstraints](https://algbio.github.io/flowpaths/subpath-constraints.html) or [subset constraints](https://algbio.github.io/flowpaths/subset-constraints.html). |
80 | 80 |
|
81 | 81 | ### Models currently implemented |
82 | 82 | - [**Minimum Flow Decomposition**](https://algbio.github.io/flowpaths/minimum-flow-decomposition.html): Given a graph with flow values on its edges (i.e. at every node different from source or sink the flow entering the node is equal to the flow exiting the node), find the minimum number of weighted paths / walks such that, for every edge, the sum of the weights of the paths going through the edge equals the flow value of the edge. |
83 | 83 |
|
84 | | -- [**$k$-Least Absolute Errors**](https://algbio.github.io/flowpaths/k-least-absolute-errors.html): Given a graph with weights on its edges, and a number $k$, find $k$ weighted paths / walks such that the sum of the absolute errors of each edge is minimized. |
| 84 | +- [**_k_-Least Absolute Errors**](https://algbio.github.io/flowpaths/k-least-absolute-errors.html): Given a graph with weights on its edges, and a number $k$, find $k$ weighted paths / walks such that the sum of the absolute errors of each edge is minimized. |
85 | 85 | - The *error of an edge* is defined as the weight of the edge minus the sum of the weights of the paths / walks going through it. |
86 | | -- [**$k$-Minimum Path Error**](https://algbio.github.io/flowpaths/k-min-path-error.html): Given a graph with weights on its edges, and a number $k$, find $k$ weighted paths / walks, with associated *slack* values, such that: |
| 86 | + |
| 87 | +- [**_k_-Minimum Path Error**](https://algbio.github.io/flowpaths/k-min-path-error.html): Given a graph with weights on its edges, and a number $k$, find $k$ weighted paths / walks, with associated *slack* values, such that: |
87 | 88 | - The error of each edge (defined as in $k$-Least Absolute Errors above) is at most the sum of the slacks of the paths / walks going through the edge, and |
88 | 89 | - The sum of path / walk slacks is minimized. |
| 90 | + |
| 91 | +- [**Minimum Path Cover**](https://algbio.github.io/flowpaths/minimum-path-cover.html): Given a graph and node sets _S_ and _T_, find a minimum number of _S-T_ paths (if the graph is acyclic) or _S-T_ walks (if the graph has cycles) such that every edge appears in at least one path or walk. |
89 | 92 |
|
90 | 93 | ### Contributing |
91 | 94 |
|
92 | | -Contributions are welcome! Please read the [CONTRIBUTING.md](contributing.md) guide for how to set up a dev environment, run tests locally, and build/preview the documentation with MkDocs. |
| 95 | +Contributions are welcome! Please read the [CONTRIBUTING.md](https://github.com/algbio/flowpaths/blob/main/CONTRIBUTING.md) guide for how to set up a dev environment, run tests locally, and build/preview the documentation with [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/). |
0 commit comments