Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mikolalysenko/ndflow
n-dimensional network flow solver
https://github.com/mikolalysenko/ndflow
Last synced: about 2 months ago
JSON representation
n-dimensional network flow solver
- Host: GitHub
- URL: https://github.com/mikolalysenko/ndflow
- Owner: mikolalysenko
- Created: 2013-03-21T20:11:55.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2013-03-21T20:26:28.000Z (almost 12 years ago)
- Last Synced: 2024-10-13T10:01:54.157Z (2 months ago)
- Language: JavaScript
- Size: 105 KB
- Stars: 2
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
ndflow
======
Network flow in the nth-dimension! Basically a higher dimensional generalization of [minimum cost network flow](http://en.wikipedia.org/wiki/Minimum-cost_flow_problem).Usage
=====
First install like this:npm install ndflow
Then use it as follows:```javascript
require("ndflow")(
[[0,1,2], [1,2,3]], //Simplicial complex
[1, 1], //Capacities
[[0,1], [1,3], [3,2], [2,0]], //Boundary circulation
[1,1,1,1], //Boundary weights
[1,1]) //Cost function
```### `require("ndflow")(cells, capacities, boundary_cells, boundary_weights, cost)`
Solves for the flow from the boundary cells that minimizes the cost. This is the same thing as solving the linear program:```
Minimize cost(flow)
Subject to D(flow) = boundary_cells * boundary_weights
0 <= flow <= capacities
```In the case where the cell complex is one dimensional, this is the same as solving minimum cost network flow for a given capacity. Binary searching on the scale of the capacities lets one compute a maximum/min-cost flow.
Credits
=======
(c) 2013 Mikola Lysenko. BSD License