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.

12.11 Minimum Spanning Trees ( min span )<br />

list SPANNING TREE(const graph& G)<br />

SPANNING TREE takes as argument a graph<br />

G(V, E). It computes a spanning tree T of the underlying<br />

undirected graph, SPANNING TREE returns<br />

the list of edges of T . <strong>The</strong> algorithm ([58]) has running<br />

time O(|V | + |E|).<br />

void SPANNING TREE1(graph& G)<br />

SPANNING TREE takes as argument a graph<br />

G(V, E). It computes a spanning tree T of the underlying<br />

undirected graph by deleting the edges in G<br />

that do not belong to T . <strong>The</strong> algorithm ([58]) has<br />

running time O(|V | + |E|).<br />

list<br />

MIN SPANNING TREE(const graph& G, const edge array& cost)<br />

MIN SPANNING TREE takes as argument an undirected<br />

graph G(V, E) and an edge array cost giving<br />

for each edge an integer cost. It computes a<br />

minimum spanning tree T of G, i.e., a spanning<br />

tree such that the sum of all edge costs is minimal.<br />

MIN SPANNING TREE returns the list of edges of T .<br />

<strong>The</strong> algorithm ([52]) has running time O(|E| log |V |).<br />

list MIN SPANNING TREE(const graph& G,<br />

const leda cmp base& cmp)<br />

A variant using a compare object to compare edge<br />

costs.<br />

list MIN SPANNING TREE(const graph& G, int (∗cmp)(const edge& ,<br />

const edge& ))<br />

A variant using a compare function to compare edge<br />

costs.

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

Saved successfully!

Ooh no, something went wrong!