lemon/euler.h
changeset 1977 8ef02f0c4245
parent 1956 a055123339d5
child 1979 c2992fd74dad
equal deleted inserted replaced
7:cb91ff3b5789 8:424db5705ef3
    32 
    32 
    33   ///Euler iterator for directed graphs.
    33   ///Euler iterator for directed graphs.
    34 
    34 
    35   /// \ingroup topology
    35   /// \ingroup topology
    36   ///This iterator converts to the \c Edge type of the graph and using
    36   ///This iterator converts to the \c Edge type of the graph and using
    37   ///operator ++ it provides an Euler tour of the graph (if there exists).
    37   ///operator ++ it provides an Euler tour of a \e directed
       
    38   ///graph (if there exists).
    38   ///
    39   ///
    39   ///For example
    40   ///For example
    40   ///if the given graph if Euler (i.e it has only one nontrivial component
    41   ///if the given graph if Euler (i.e it has only one nontrivial component
    41   ///and the in-degree is equal to the out-degree for all nodes),
    42   ///and the in-degree is equal to the out-degree for all nodes),
    42   ///the following code will print the edge IDs according to an
    43   ///the following code will put the edges of \c g
       
    44   ///to the vector \c et according to an
    43   ///Euler tour of \c g.
    45   ///Euler tour of \c g.
    44   ///\code
    46   ///\code
    45   ///  for(EulerIt<ListGraph> e(g),e!=INVALID;++e) {
    47   ///  std::vector<ListGraph::Edge> et;
    46   ///    std::cout << g.id(e) << std::eol;
    48   ///  for(EulerIt<ListGraph> e(g),e!=INVALID;++e)
    47   ///  }
    49   ///    et.push_back(e);
    48   ///\endcode
    50   ///\endcode
    49   ///If \c g is not Euler then the resulted tour will not be full or closed.
    51   ///If \c g is not Euler then the resulted tour will not be full or closed.
       
    52   ///\sa UEulerIt
    50   ///\todo Test required
    53   ///\todo Test required
    51   template<class Graph>
    54   template<class Graph>
    52   class EulerIt 
    55   class EulerIt 
    53   {
    56   {
    54     typedef typename Graph::Node Node;
    57     typedef typename Graph::Node Node;
   116   };
   119   };
   117 
   120 
   118   ///Euler iterator for undirected graphs.
   121   ///Euler iterator for undirected graphs.
   119 
   122 
   120   /// \ingroup topology
   123   /// \ingroup topology
   121   ///This iterator converts to the \c Edge type of the graph and using
   124   ///This iterator converts to the \c Edge (or \cUEdge)
   122   ///operator ++ it provides an Euler tour of the graph (if there exists).
   125   ///type of the graph and using
       
   126   ///operator ++ it provides an Euler tour of an \undirected
       
   127   ///graph (if there exists).
   123   ///
   128   ///
   124   ///For example
   129   ///For example
   125   ///if the given graph if Euler (i.e it has only one nontrivial component
   130   ///if the given graph if Euler (i.e it has only one nontrivial component
   126   ///and the degree of each node is even),
   131   ///and the degree of each node is even),
   127   ///the following code will print the edge IDs according to an
   132   ///the following code will print the edge IDs according to an
   134   ///Although the iterator provides an Euler tour of an undirected graph,
   139   ///Although the iterator provides an Euler tour of an undirected graph,
   135   ///in order to indicate the direction of the tour, UEulerIt
   140   ///in order to indicate the direction of the tour, UEulerIt
   136   ///returns directed edges (that convert to the undirected ones, of course).
   141   ///returns directed edges (that convert to the undirected ones, of course).
   137   ///
   142   ///
   138   ///If \c g is not Euler then the resulted tour will not be full or closed.
   143   ///If \c g is not Euler then the resulted tour will not be full or closed.
       
   144   ///\sa EulerIt
   139   ///\todo Test required
   145   ///\todo Test required
   140   template<class Graph>
   146   template<class Graph>
   141   class UEulerIt
   147   class UEulerIt
   142   {
   148   {
   143     typedef typename Graph::Node Node;
   149     typedef typename Graph::Node Node;