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.

void<br />

void<br />

G.sort nodes(const list& vl)<br />

G.sort edges(const list& el)<br />

makes vl the node list of G.<br />

Precondition: vl contains exactly the nodes of G.<br />

makes el the edge list of G.<br />

Precondition: el contains exactly the edges of G.<br />

void G.sort nodes( ) the nodes of G are sorted increasingly according to<br />

their contents.<br />

Precondition: vtype is linearly ordered.<br />

void G.sort edges( ) the edges of G are sorted increasingly according to<br />

their contents.<br />

Precondition: etype is linearly ordered.<br />

void G.write(string fname) writes G to the file with name fname. <strong>The</strong> output<br />

operators operator ≪ (ostream&, const vtype&)<br />

and operator ≪ (ostream&, const etype&)(cf. section<br />

1.6) must be defined.<br />

int G.read(string fname) reads G from the file with name fname. <strong>The</strong> input<br />

operators operator ≫ (istream&, vtype&) and<br />

operator ≫ (istream&, etype&) (cf. section 1.6) must<br />

be defined. Returns error code<br />

1 if file fname does not exist<br />

2 if graph is not of type GRAPH <br />

3 if file fname does not contain a graph<br />

0 if reading was successful.<br />

5. Implementation<br />

Parameterized graph are derived from directed graph. All additional operations for manipulating<br />

the node and edge entries take constant time.

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

Saved successfully!

Ooh no, something went wrong!