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> pre-instantiations for number type double compute the optimal matching for a modified<br />

weight function c1 , where for every edge e<br />

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

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

<strong>The</strong> weight of the optimal matching for the modified weight function and the weight of<br />

the optimal matching for the original weight function differ by at most n · f · C · 2 −52 .<br />

template <br />

list MAX WEIGHT BIPARTITE MATCHING T(graph& G,<br />

const edge array& c,<br />

node array& pot)<br />

computes a matching of maximal cost and a potential function pot that<br />

is tight with respect to M. <strong>The</strong> running time of the algorithm is O(n ·<br />

(m + n log n)). <strong>The</strong> argument pot is optional.<br />

Precondition: G must be bipartite.<br />

template <br />

list MAX WEIGHT BIPARTITE MATCHING T(graph& G,<br />

const list& A,<br />

const list& B,<br />

const edge array& c,<br />

node array& pot)<br />

As above. It is assumed that the partition (A, B) witnesses that G is<br />

bipartite and that all edges of G are directed from A to B. If A and<br />

B have different sizes then is is advisable that A is the smaller set; in<br />

general, this leads to smaller running time. <strong>The</strong> argument pot is optional.<br />

template <br />

bool CHECK MWBM T(const graph& G, const edge array& c,<br />

const list& M, const node array& pot)<br />

checks that pot is a tight feasible potential function with respect to M<br />

and that M is a matching. Tightness of pot implies that M is a maximum<br />

weighted matching.<br />

template <br />

list MAX WEIGHT ASSIGNMENT T(graph& G, const edge array& c,<br />

node array& pot)<br />

computes a perfect matching of maximal cost and a potential function<br />

pot that is tight with respect to M. <strong>The</strong> running time of the algorithm<br />

is O(n · (m + n log n)). If G contains no perfect matching the empty set<br />

of edges is returned. <strong>The</strong> argument pot is optional.<br />

Precondition: G must be bipartite.

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

Saved successfully!

Ooh no, something went wrong!