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.

template <br />

bool ALL PAIRS SHORTEST PATHS T(graph& G, const edge array& c,<br />

node matrix& DIST)<br />

returns true if G has no negative cycle and returns false otherwise.<br />

In the latter case all values returned in DIST are<br />

unspecified. In the former case the following holds for all v<br />

and w: if µ(v, w) < ∞ then DIST(v, w) = µ(v, w) and if<br />

µ(v, w) = ∞ then the value of DIST(v, w) is arbitrary. <strong>The</strong><br />

procedure runs in time O(nm + n 2 log n).<br />

rational MINIMUM RATIO CYCLE(graph& G, const edge array& c,<br />

const edge array& p, list& C star)<br />

Returns a minimum cost to profit ratio cycle C star and the<br />

ratio of the cycle. For a cycle C let c(C) be the sum of the c-<br />

values of the edges on the cycle and let p(C) be the sum of the<br />

p-values of the edges on the cycle. <strong>The</strong> cost to profit ratio of<br />

the cycle is the quotient c(C)/p(C). <strong>The</strong> cycle C start realizes<br />

the minimum ratio for any cycle C. <strong>The</strong> procedure runs in<br />

time O(nm log(n · C · P )) where C and P are the maximum<br />

cost and profit of any edge, respectively. <strong>The</strong> program returns<br />

zero if there is no cycle in G.<br />

Precondition: <strong>The</strong>re are no cycles of cost zero or less with<br />

respect to either c or p.

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

Saved successfully!

Ooh no, something went wrong!