31.01.2014 Views

Version 5.0 The LEDA User Manual

Version 5.0 The LEDA User Manual

Version 5.0 The LEDA User Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

12.4 Min Cost Flow Algorithms ( min cost flow )<br />

bool<br />

MIN COST FLOW(graph& G, const edge array& lcap,<br />

const edge array& ucap,<br />

const edge array& cost,<br />

const node array& supply,<br />

edge array& flow)<br />

MIN COST FLOW takes as arguments a directed<br />

graph G(V, E), an edge array lcap (ucap) giving<br />

for each edge a lower (upper) capacity bound, an<br />

edge array cost specifying for each edge an integer<br />

cost and a node array supply defining for each node<br />

v a supply or demand (if supply[v] < 0). If a feasible<br />

flow (fulfilling the capacity and mass balance conditions)<br />

exists it computes such a flow of minimal cost<br />

and returns true, otherwise false is returned. <strong>The</strong> algorithm<br />

is based on capacity scaling and successive<br />

shortest path computation (cf. [28] and [4]) and has<br />

running time O(|E| log U(|E| + |V | log |V |)).<br />

bool<br />

MIN COST FLOW(graph& G, const edge array& cap,<br />

const edge array& cost,<br />

const node array& supply,<br />

edge array& flow)<br />

This variant of MIN COST FLOW assumes that<br />

lcap[e] = 0 for every edge e ∈ E.<br />

int MIN COST MAX FLOW(graph& G, node s, node t,<br />

const edge array& cap,<br />

const edge array& cost,<br />

edge array& flow)<br />

MIN COST MAX FLOW takes as arguments a directed<br />

graph G(V, E), a source node s, a sink node<br />

t, an edge array cap giving for each edge in G a<br />

capacity, and an edge array cost specifying for each<br />

edge an integer cost. It computes for every edge e<br />

in G a flow flow[e] such that the total flow from s<br />

to t is maximal, the total cost of the flow is minimal,<br />

and 0 ≤ flow[e] ≤ cap[e] for all edges e.<br />

MIN COST MAX FLOW returns the total flow from<br />

s to t.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!