EulerIt
Declared in lemon/euler.h, in the group Connectivity and Other Graph Properties; the same class on the Doxygen site.
-
template< typename GR >
class EulerIt Euler tour iterator for graphs.
This iterator provides an Euler tour (Eulerian circuit) of an undirected graph (if there exists) and it converts to the
ArcandEdgetypes of the graph.For example, if the given graph has an Euler tour (i.e it has only one non-trivial component and the degree of each node is even), the following code will print the arc IDs according to an Euler tour of
g.Although this iterator is for undirected graphs, it still returns arcs in order to indicate the direction of the tour. (But arcs convert to edges, of course.)for( EulerIt< ListGraph > e( g ) ; e != INVALID ; ++e ) { std::cout << g.id( Edge( e ) ) << std::eol; }
If
ghas no Euler tour, then the resulted walk will not be closed or not contain all edges.Public Functions
-
inline EulerIt( const GR & gr , typename GR::Node start = INVALID )
Constructor.
- Parameters:
gr – A graph.
start – The starting point of the tour. If it is not given, the tour will start from the first node that has an incident edge.
-
inline operator Arc() const
Arc conversion.
-
inline operator Edge() const
Edge conversion.
-
inline EulerIt( const GR & gr , typename GR::Node start = INVALID )