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.

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

const edge array& cap,<br />

const edge array& f)<br />

checks whether f is a maximum flow in the network (G, s, t, cap). <strong>The</strong> functions<br />

returns false if this is not the case.<br />

bool MAX FLOW SCALE CAPS(const graph& G, node s, edge array& cap)<br />

replaces cap[e] by cap1 [e] for every edge e, where cap1 [e] is as defined above.<br />

<strong>The</strong> function returns false if the scaling changed some capacity, and returns<br />

true otherwise.<br />

template <br />

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

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

computes a maximum (s, t)-flow f in the network (G, s, t, ucap) s.th. f(e) ≤<br />

lcap[e] for every edge e. If a feasible flow exists, its value returned; otherwise<br />

the return value is -1.<br />

<strong>The</strong> following functions are only available in template form. <strong>The</strong>y allow to study the effect<br />

of different heuristics and of different selection rules on the preflow push method. <strong>The</strong><br />

class SET must provide the following operations: construction, destruction, del, insert,<br />

insert0 , and clear; see the <strong>LEDA</strong> book for details. Three implementations are part of the<br />

distribution: fifo set, hl set, and mfifo set.<br />

template <br />

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

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

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

int& num relabels)<br />

<strong>The</strong> basic version of the preflow push algorithm: No heuristic is used.<br />

template <br />

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

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

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

int& num relabels)<br />

<strong>The</strong> preflow push method with the distinction between low and high nodes.<br />

template <br />

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

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

SET & U, int& num pushes,<br />

int& num edge inspections, int& num relabels)<br />

<strong>The</strong> preflow push method with the distinction between low and high nodes and<br />

the local relabeling heuristic.<br />

template

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

Saved successfully!

Ooh no, something went wrong!