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.

11.17 Sets of Edges ( edge set )<br />

1. Definition<br />

An instance S of the data type edge set is a subset of the edges of a graph G. S is said<br />

to be valid for the edges of G.<br />

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

2. Creation<br />

edge set<br />

S(const graph& G);<br />

creates an instance S of type edge set valid for all edges currently<br />

in graph G and initializes it to the empty set.<br />

3. Operations<br />

void S.insert(edge x) adds edge x to S.<br />

void S.del(edge x) removes edge x from S.<br />

bool S.member(edge x) returns true if x in S, false otherwise.<br />

edge S.choose( ) returns an edge of S.<br />

int S.size( ) returns the size of S.<br />

bool S.empty( ) returns true iff S is the empty set.<br />

void S.clear( ) makes S the empty set.<br />

4. Implementation<br />

An edge set S for a graph G is implemented by a combination of a list L of edges and an<br />

edge array of list items associating with each edge its position in L. All operations take<br />

constant time, except for clear which takes time O(S). <strong>The</strong> space requirement is O(n),<br />

where n is the number of edges of G.

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

Saved successfully!

Ooh no, something went wrong!