MCPcopy Create free account
hub / github.com/EbTech/rust-algorithms / dinic

Method dinic

src/graph/flow.rs:45–60  ·  view source on GitHub ↗

Dinic's algorithm to find the maximum flow from s to t where s != t. Generalizes the Hopcroft-Karp maximum bipartite matching algorithm. V^2E in general, min(V^(2/3),sqrt(E))E when all edges are unit capacity, sqrt(V)E when all vertices are unit capacity as in bipartite graphs. # Panics Panics if the maximum flow is 2^63 or larger.

(&self, s: usize, t: usize)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 2

test_basic_flowFunction · 0.80
test_max_matchingFunction · 0.80

Calls 4

dinic_searchMethod · 0.80
num_vMethod · 0.80
adj_listMethod · 0.80
dinic_augmentMethod · 0.80

Tested by 2

test_basic_flowFunction · 0.64
test_max_matchingFunction · 0.64