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.

graph algorithms, i.e., algorithms accepting instances of any parametrized graph type as<br />

argument.<br />

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

2. Types<br />

GRAPH :: node value type<br />

GRAPH :: edge value type<br />

3. Creation<br />

the type of node data (vtype).<br />

the type of edge data (etype).<br />

GRAPH G; creates an instance G of type GRAPH and initializes<br />

it to the empty graph.<br />

4. Operations<br />

const vtype& G.inf(node v) returns the information of node v.<br />

const vtype& G[node v]<br />

returns a reference to G.inf(v).<br />

const etype& G.inf(edge e) returns the information of edge e.<br />

const etype& G[edge e]<br />

returns a reference to G.inf(e).<br />

node array& G.node data( ) makes the information associated with the nodes of G<br />

available as a node array of type node array.<br />

edge array& G.edge data( ) makes the information associated with the edges of G<br />

available as an edge array of type edge array.<br />

void G.assign(node v, const vtype& x)<br />

void G.assign(edge e, const etype& x)<br />

node G.new node(const vtype& x)<br />

makes x the information of node v.<br />

makes x the information of edge e.<br />

adds a new node to G and returns it.<br />

node<br />

G.new node(node u, const vtype& x, int dir)<br />

adds a new node v = to G and returns it. v<br />

is inserted in front of (dir = leda :: before) or behind<br />

(dir = leda ::behind) node u into the list of all nodes.

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

Saved successfully!

Ooh no, something went wrong!