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.

11.23 Miscellaneous Graph Functions ( graph misc )<br />

1. Operations<br />

#include < <strong>LEDA</strong>/graph/graph misc.h ><br />

void CopyGraph(graph& H, const graph& G)<br />

constructs a copy H of graph G.<br />

void CopyGraph(GRAPH & H, const graph& G)<br />

constructs a copy H of graph G such that H[v] is<br />

the node of G that corresponds to v and H[e] is<br />

the edge of G that corresponds to e.<br />

void CopyGraph(GRAPH & H, const graph& G,<br />

const list& V, const list& E)<br />

constructs a copy H of the subgraph (V, E) of G<br />

such that H[v] is the node of G that corresponds<br />

to v and H[e] is the edge of G that corresponds to<br />

e. Precondition: V is a subset of the nodes of G<br />

and E is a subset of V × V .<br />

void CopyGraph(GRAPH & H, const graph& G,<br />

const list& E)<br />

constructs a copy H of the subgraph of G induced<br />

by the edges in E.<br />

bool<br />

bool<br />

Is Simple(const graph& G) returns true if G is simple, i.e., has no parallel<br />

edges, false otherwise.<br />

Is Simple(const graph& G, list& el)<br />

as above, but returns in addition the list of all<br />

edges sorted lexicographically by source and target<br />

node, i.e, all parallel edges appear consecutively in<br />

el.<br />

bool Is Loopfree(const graph& G)<br />

bool Is Simple Loopfree(const graph& G)<br />

bool Is Undirected Simple(const graph& G)<br />

returns true if G is loopfree, i.e., has no edge whose<br />

source is equal to its target.<br />

returns true if G is simple and loopfree.<br />

returns true if G viewed as an undirected graph<br />

is simple, i.e., G is loopfree, simple, and has no<br />

anti-parallel edges.

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

Saved successfully!

Ooh no, something went wrong!