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.

that the bipartition (A, B) is given and that all edges are directed from A to B; all of<br />

them return a maximum cardinality matching and a minimum cardinality node cover.<br />

<strong>The</strong> initial characters of the inventors are used to distinguish between the algorithms.<br />

<strong>The</strong> common interface is<br />

list MAX_CARD_BIPARTITE_MATCHING_XX(graph& G,<br />

const list& A,<br />

const list& B,<br />

node_array& NC,<br />

bool use_heuristic = true);<br />

where XX is to be replaced by either HK, ABMP, FF, or FFB. All algorithms can be<br />

asked to use a heuristic to find an initial matching. This is the default.<br />

HK stands for the algorithm due to Hopcroft and Karp [44]. It has running time O( √ nm).<br />

ABMP stands for algorithm due to Alt, Blum, Mehlhorn, and Paul [1]. <strong>The</strong> algorithm has<br />

running time O( √ nm). <strong>The</strong> algorithm consists of two major phases. In the first phase<br />

all augmenting paths of length less than Lmax are found, and in the second phase the<br />

remaining augmenting paths are determined. <strong>The</strong> default value of Lmax is 0.1 √ n. Lmax<br />

is an additional optional parameter of the procedure.<br />

FF stands for the algorithm due to Ford and Fulkerson [34]. <strong>The</strong> algorithm has running<br />

time O(nm) and FFB stands for a simple and slow version of FF. <strong>The</strong> algorithm FF has<br />

an additional optional parameter use bfs of type bool. If set to true, breadth-first-search<br />

is used in the search for augmenting paths, and if set to false, depth-first-search is used.<br />

Be aware that the algorithms XX change the graph G. <strong>The</strong>y leave the graph structure<br />

unchanged but reorder adjacency lists (and hence change the embedding). If this is<br />

undesirable you must restore the original order of the adjacency lists as follows.<br />

edge_array edge_number(G); int i = 0;<br />

forall_nodes(v,G)<br />

forall_adj_edges(e,G) edge_number[e] = i++;<br />

call matching algorithm;<br />

G.sort_edges(edge_number);<br />

12.7 Bipartite Weighted Matchings and Assignments<br />

( mwb matching )<br />

We give functions

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

Saved successfully!

Ooh no, something went wrong!