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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>The</strong> algorithms have the following arithmetic demands. Let C be the maximal absolute<br />

value of any edge capacity. If all capacities are integral then all intermediate values are<br />

bounded by d · C, where d is the out-degree of the source.<br />

<strong>The</strong> pre-instantiations for number type double compute the maximum flow for a modified<br />

capacity function cap1 , where for every edge e<br />

cap1 [e] = sign(cap[e])⌊|cap[e]| · S⌋/S<br />

and S is the largest power of two such that S < 2 53 /(d · C).<br />

<strong>The</strong> value of the maximum flow for the modified capacity function and the value of the<br />

maximum flow for the original capacity function differ by at most m · d · C · 2 −52 .<br />

<strong>The</strong> following functions are available:<br />

template <br />

inline NT MAX FLOW T(const graph& G, node s, node t,<br />

const edge array& cap, edge array& f)<br />

computes a maximum (s, t)-flow f in the network (G, s, t, cap) and returns the<br />

value of the flow.<br />

<strong>The</strong> implementation uses the preflow-push method of Goldberg and Tarjan [43]<br />

with the local and global relabeling heuristic and the gap heuristic. <strong>The</strong> highest<br />

level rule is used to select active nodes. <strong>The</strong> section on maximum flow of the<br />

<strong>LEDA</strong> book gives full information.<br />

template <br />

inline NT MAX FLOW T(const graph& G, node s, node t,<br />

const edge array& cap, edge array& f,<br />

list& st cut)<br />

as above, also computes a minimum s − t cut in G.<br />

template <br />

inline NT MAX FLOW T(const graph& G, node s, node t,<br />

const edge array& cap, edge array& f,<br />

int& num pushes, int& num edge inspections,<br />

int& num relabels, int& num global relabels, int& num gaps,<br />

float h)<br />

as above;<br />

<strong>The</strong> additional parameter report some statistics of the execution (the number<br />

of pushes, the number of edge inspections, the number of relabels, the number<br />

of global relabels, and the number of nodes moved by the gap heuristic.<br />

<strong>The</strong> parameter h controls the global relabeling heuristic. <strong>The</strong> global relabeling<br />

heuristic is called every h · m edge inspections. <strong>The</strong> choice h = 5 seems<br />

reasonable.<br />

template

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

Saved successfully!

Ooh no, something went wrong!