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.

12.12 Euler Tours ( euler tour )<br />

An Euler tour in an undirected graph G is a cycle using every edge of G exactly once. A<br />

graph has an Euler tour if it is connected and the degree of every vertex is even.<br />

bool Euler Tour(const graph& G, list& T )<br />

<strong>The</strong> function returns true if the undirected version of<br />

G has an Euler tour. <strong>The</strong> Euler tour is returned in<br />

T . <strong>The</strong> items in T are of the form (e, ± + 1), where<br />

the second component indicates the traversal direction<br />

d of the edge. If d = +1, the edge is traversed in<br />

forward direction, and if d = −1, the edge is traversed<br />

in reverse direction. <strong>The</strong> running time is O(n + m).<br />

bool Check Euler Tour(const graph& G, const list& T )<br />

bool Euler Tour(graph& G, list& T )<br />

returns true if T is an Euler tour in G. <strong>The</strong> running<br />

time is O(n + m).<br />

<strong>The</strong> function returns true if the undirected verion of<br />

G has an Euler tour. G is reoriented such that every<br />

node has indegree equal to its outdegree and an Euler<br />

tour (of the reoriented graph) is returned in T . <strong>The</strong><br />

running time is O(n + m).<br />

bool Check Euler Tour(const graph& G, const list& T )<br />

returns true if T is an Euler tour in the directed graph<br />

G. <strong>The</strong> running time is O(n + m).

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

Saved successfully!

Ooh no, something went wrong!