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.6 Maximum Cardinality Matchings in Bipartite<br />

Graphs ( mcb matching )<br />

A matching in a graph G is a subset M of the edges of G such that no two share an<br />

endpoint. A node cover is a set of nodes NC such that every edge has at least one endpoint<br />

in NC . <strong>The</strong> maximum cardinality of a matching is at most the minimum cardinality of a<br />

node cover. In bipartite graph, the two quantities are equal.<br />

list MAX CARD BIPARTITE MATCHING(graph& G)<br />

returns a maximum cardinality matching.<br />

Precondition: G must be bipartite.<br />

list MAX CARD BIPARTITE MATCHING(graph& G, node array& NC )<br />

returns a maximum cardinality matching and a minimum cardinality<br />

node cover NC . <strong>The</strong> node cover has the same cardinality as the<br />

matching and hence proves the optimality of the matching. Precondition:<br />

G must be bipartite.<br />

bool CHECK MCB(const graph& G, const list& M,<br />

const node array& NC )<br />

checks that M is a matching in G, i.e., that at most one edge in M<br />

is incident to any node of G, that NC is a node cover, i.e., for every<br />

edge of G at least one endpoint is in NC and that M and NC have<br />

the same cardinality. <strong>The</strong> function writes diagnostic output to cerr,<br />

if one of the conditions is violated.<br />

list MAX CARD BIPARTITE MATCHING(graph& G, const list& A,<br />

const list& B)<br />

returns a maximum cardinality matching. Precondition: G must be<br />

bipartite. <strong>The</strong> bipartition of G is given by A and B. All edges of G<br />

must be directed from A to B.<br />

list MAX CARD BIPARTITE MATCHING(graph& G, const list& A,<br />

const list& B,<br />

node array& NC )<br />

returns a maximum cardinality matching. A minimal node cover is<br />

returned in NC . <strong>The</strong> node cover has the same cardinality as the<br />

matching and hence proves the maximality of the matching. Precondition:<br />

G must be bipartite. <strong>The</strong> bipartition of G is given by A and<br />

B. All edges of G must be directed from A to B.<br />

We offer several implementations of bipartite matching algorithms. All of them require

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

Saved successfully!

Ooh no, something went wrong!