lemon/concepts/graph_components.h
changeset 571 d11bf7998905
parent 550 c5fd2d996909
child 572 2313edd0db0b
     1.1 --- a/lemon/concepts/graph_components.h	Tue Apr 07 14:50:20 2009 +0100
     1.2 +++ b/lemon/concepts/graph_components.h	Tue Apr 14 10:33:17 2009 +0200
     1.3 @@ -31,17 +31,16 @@
     1.4  namespace lemon {
     1.5    namespace concepts {
     1.6  
     1.7 -    /// \brief Skeleton class for graph Node and Arc types
     1.8 +    /// \brief Concept class for \c Node, \c Arc and \c Edge types.
     1.9      ///
    1.10 -    /// This class describes the interface of Node and Arc (and Edge
    1.11 -    /// in undirected graphs) subtypes of graph types.
    1.12 +    /// This class describes the concept of \c Node, \c Arc and \c Edge
    1.13 +    /// subtypes of digraph and graph types.
    1.14      ///
    1.15      /// \note This class is a template class so that we can use it to
    1.16 -    /// create graph skeleton classes. The reason for this is than Node
    1.17 -    /// and Arc types should \em not derive from the same base class.
    1.18 -    /// For Node you should instantiate it with character 'n' and for Arc
    1.19 -    /// with 'a'.
    1.20 -
    1.21 +    /// create graph skeleton classes. The reason for this is that \c Node
    1.22 +    /// and \c Arc (or \c Edge) types should \e not derive from the same 
    1.23 +    /// base class. For \c Node you should instantiate it with character
    1.24 +    /// \c 'n', for \c Arc with \c 'a' and for \c Edge with \c 'e'.
    1.25  #ifndef DOXYGEN
    1.26      template <char sel = '0'>
    1.27  #endif
    1.28 @@ -49,45 +48,49 @@
    1.29      public:
    1.30        /// \brief Default constructor.
    1.31        ///
    1.32 +      /// Default constructor.
    1.33        /// \warning The default constructor is not required to set
    1.34        /// the item to some well-defined value. So you should consider it
    1.35        /// as uninitialized.
    1.36        GraphItem() {}
    1.37 +
    1.38        /// \brief Copy constructor.
    1.39        ///
    1.40        /// Copy constructor.
    1.41 +      GraphItem(const GraphItem &) {}
    1.42 +
    1.43 +      /// \brief Constructor for conversion from \c INVALID.
    1.44        ///
    1.45 -      GraphItem(const GraphItem &) {}
    1.46 -      /// \brief Invalid constructor \& conversion.
    1.47 -      ///
    1.48 -      /// This constructor initializes the item to be invalid.
    1.49 +      /// Constructor for conversion from \c INVALID.
    1.50 +      /// It initializes the item to be invalid.
    1.51        /// \sa Invalid for more details.
    1.52        GraphItem(Invalid) {}
    1.53 -      /// \brief Assign operator for nodes.
    1.54 +
    1.55 +      /// \brief Assignment operator.
    1.56        ///
    1.57 -      /// The nodes are assignable.
    1.58 -      ///
    1.59 -      GraphItem& operator=(GraphItem const&) { return *this; }
    1.60 +      /// Assignment operator for the item.
    1.61 +      GraphItem& operator=(const GraphItem&) { return *this; }
    1.62 +
    1.63        /// \brief Equality operator.
    1.64        ///
    1.65 -      /// Two iterators are equal if and only if they represents the
    1.66 -      /// same node in the graph or both are invalid.
    1.67 -      bool operator==(GraphItem) const { return false; }
    1.68 +      /// Equality operator.
    1.69 +      bool operator==(const GraphItem&) const { return false; }
    1.70 +
    1.71        /// \brief Inequality operator.
    1.72        ///
    1.73 -      /// \sa operator==(const Node& n)
    1.74 +      /// Inequality operator.
    1.75 +      bool operator!=(const GraphItem&) const { return false; }
    1.76 +
    1.77 +      /// \brief Ordering operator.
    1.78        ///
    1.79 -      bool operator!=(GraphItem) const { return false; }
    1.80 -
    1.81 -      /// \brief Artificial ordering operator.
    1.82 -      ///
    1.83 -      /// To allow the use of graph descriptors as key type in std::map or
    1.84 -      /// similar associative container we require this.
    1.85 +      /// This operator defines an ordering of the items.
    1.86 +      /// It makes possible to use graph item types as key types in 
    1.87 +      /// associative containers (e.g. \c std::map).
    1.88        ///
    1.89        /// \note This operator only have to define some strict ordering of
    1.90        /// the items; this order has nothing to do with the iteration
    1.91        /// ordering of the items.
    1.92 -      bool operator<(GraphItem) const { return false; }
    1.93 +      bool operator<(const GraphItem&) const { return false; }
    1.94  
    1.95        template<typename _GraphItem>
    1.96        struct Constraints {
    1.97 @@ -99,7 +102,6 @@
    1.98            i1 = i2 = i3;
    1.99  
   1.100            bool b;
   1.101 -          //          b = (ia == ib) && (ia != ib) && (ia < ib);
   1.102            b = (ia == ib) && (ia != ib);
   1.103            b = (ia == INVALID) && (ib != INVALID);
   1.104            b = (ia < ib);
   1.105 @@ -110,13 +112,12 @@
   1.106        };
   1.107      };
   1.108  
   1.109 -    /// \brief An empty base directed graph class.
   1.110 +    /// \brief Base skeleton class for directed graphs.
   1.111      ///
   1.112 -    /// This class provides the minimal set of features needed for a
   1.113 -    /// directed graph structure. All digraph concepts have to
   1.114 -    /// conform to this base directed graph. It just provides types
   1.115 -    /// for nodes and arcs and functions to get the source and the
   1.116 -    /// target of the arcs.
   1.117 +    /// This class describes the base interface of directed graph types.
   1.118 +    /// All digraph %concepts have to conform to this class.
   1.119 +    /// It just provides types for nodes and arcs and functions 
   1.120 +    /// to get the source and the target nodes of arcs.
   1.121      class BaseDigraphComponent {
   1.122      public:
   1.123  
   1.124 @@ -124,31 +125,27 @@
   1.125  
   1.126        /// \brief Node class of the digraph.
   1.127        ///
   1.128 -      /// This class represents the Nodes of the digraph.
   1.129 -      ///
   1.130 +      /// This class represents the nodes of the digraph.
   1.131        typedef GraphItem<'n'> Node;
   1.132  
   1.133        /// \brief Arc class of the digraph.
   1.134        ///
   1.135 -      /// This class represents the Arcs of the digraph.
   1.136 +      /// This class represents the arcs of the digraph.
   1.137 +      typedef GraphItem<'a'> Arc;
   1.138 +
   1.139 +      /// \brief Return the source node of an arc.
   1.140        ///
   1.141 -      typedef GraphItem<'e'> Arc;
   1.142 +      /// This function returns the source node of an arc.
   1.143 +      Node source(const Arc&) const { return INVALID; }
   1.144  
   1.145 -      /// \brief Gives back the target node of an arc.
   1.146 +      /// \brief Return the target node of an arc.
   1.147        ///
   1.148 -      /// Gives back the target node of an arc.
   1.149 +      /// This function returns the target node of an arc.
   1.150 +      Node target(const Arc&) const { return INVALID; }
   1.151 +
   1.152 +      /// \brief Return the opposite node on the given arc.
   1.153        ///
   1.154 -      Node target(const Arc&) const { return INVALID;}
   1.155 -
   1.156 -      /// \brief Gives back the source node of an arc.
   1.157 -      ///
   1.158 -      /// Gives back the source node of an arc.
   1.159 -      ///
   1.160 -      Node source(const Arc&) const { return INVALID;}
   1.161 -
   1.162 -      /// \brief Gives back the opposite node on the given arc.
   1.163 -      ///
   1.164 -      /// Gives back the opposite node on the given arc.
   1.165 +      /// This function returns the opposite node on the given arc.
   1.166        Node oppositeNode(const Node&, const Arc&) const {
   1.167          return INVALID;
   1.168        }
   1.169 @@ -174,91 +171,96 @@
   1.170        };
   1.171      };
   1.172  
   1.173 -    /// \brief An empty base undirected graph class.
   1.174 +    /// \brief Base skeleton class for undirected graphs.
   1.175      ///
   1.176 -    /// This class provides the minimal set of features needed for an
   1.177 -    /// undirected graph structure. All undirected graph concepts have
   1.178 -    /// to conform to this base graph. It just provides types for
   1.179 -    /// nodes, arcs and edges and functions to get the
   1.180 -    /// source and the target of the arcs and edges,
   1.181 -    /// conversion from arcs to edges and function to get
   1.182 -    /// both direction of the edges.
   1.183 +    /// This class describes the base interface of undirected graph types.
   1.184 +    /// All graph %concepts have to conform to this class.
   1.185 +    /// It extends the interface of \ref BaseDigraphComponent with an
   1.186 +    /// \c Edge type and functions to get the end nodes of edges,
   1.187 +    /// to convert from arcs to edges and to get both direction of edges.
   1.188      class BaseGraphComponent : public BaseDigraphComponent {
   1.189      public:
   1.190        typedef BaseDigraphComponent::Node Node;
   1.191        typedef BaseDigraphComponent::Arc Arc;
   1.192 -      /// \brief Undirected arc class of the graph.
   1.193 +
   1.194 +      /// \brief Undirected edge class of the graph.
   1.195        ///
   1.196 -      /// This class represents the edges of the graph.
   1.197 -      /// The undirected graphs can be used as a directed graph which
   1.198 -      /// for each arc contains the opposite arc too so the graph is
   1.199 -      /// bidirected. The edge represents two opposite
   1.200 -      /// directed arcs.
   1.201 -      class Edge : public GraphItem<'u'> {
   1.202 +      /// This class represents the undirected edges of the graph.
   1.203 +      /// Undirected graphs can be used as directed graphs, each edge is
   1.204 +      /// represented by two opposite directed arcs.
   1.205 +      class Edge : public GraphItem<'e'> {
   1.206        public:
   1.207 -        typedef GraphItem<'u'> Parent;
   1.208 +        typedef GraphItem<'e'> Parent;
   1.209 +
   1.210          /// \brief Default constructor.
   1.211          ///
   1.212 +        /// Default constructor.
   1.213          /// \warning The default constructor is not required to set
   1.214          /// the item to some well-defined value. So you should consider it
   1.215          /// as uninitialized.
   1.216          Edge() {}
   1.217 +
   1.218          /// \brief Copy constructor.
   1.219          ///
   1.220          /// Copy constructor.
   1.221 +        Edge(const Edge &) : Parent() {}
   1.222 +
   1.223 +        /// \brief Constructor for conversion from \c INVALID.
   1.224          ///
   1.225 -        Edge(const Edge &) : Parent() {}
   1.226 -        /// \brief Invalid constructor \& conversion.
   1.227 -        ///
   1.228 -        /// This constructor initializes the item to be invalid.
   1.229 +        /// Constructor for conversion from \c INVALID.
   1.230 +        /// It initializes the item to be invalid.
   1.231          /// \sa Invalid for more details.
   1.232          Edge(Invalid) {}
   1.233 -        /// \brief Converter from arc to edge.
   1.234 +
   1.235 +        /// \brief Constructor for conversion from an arc.
   1.236          ///
   1.237 +        /// Constructor for conversion from an arc.
   1.238          /// Besides the core graph item functionality each arc should
   1.239          /// be convertible to the represented edge.
   1.240          Edge(const Arc&) {}
   1.241 -        /// \brief Assign arc to edge.
   1.242 +
   1.243 +        /// \brief Assign an arc to an edge.
   1.244          ///
   1.245 +        /// This function assigns an arc to an edge.
   1.246          /// Besides the core graph item functionality each arc should
   1.247          /// be convertible to the represented edge.
   1.248          Edge& operator=(const Arc&) { return *this; }
   1.249        };
   1.250  
   1.251 -      /// \brief Returns the direction of the arc.
   1.252 +      /// \brief Return one end node of an edge.
   1.253 +      ///
   1.254 +      /// This function returns one end node of an edge.
   1.255 +      Node u(const Edge&) const { return INVALID; }
   1.256 +
   1.257 +      /// \brief Return the other end node of an edge.
   1.258 +      ///
   1.259 +      /// This function returns the other end node of an edge.
   1.260 +      Node v(const Edge&) const { return INVALID; }
   1.261 +
   1.262 +      /// \brief Return a directed arc related to an edge.
   1.263 +      ///
   1.264 +      /// This function returns a directed arc from its direction and the
   1.265 +      /// represented edge.
   1.266 +      Arc direct(const Edge&, bool) const { return INVALID; }
   1.267 +
   1.268 +      /// \brief Return a directed arc related to an edge.
   1.269 +      ///
   1.270 +      /// This function returns a directed arc from its source node and the
   1.271 +      /// represented edge.
   1.272 +      Arc direct(const Edge&, const Node&) const { return INVALID; }
   1.273 +
   1.274 +      /// \brief Return the direction of the arc.
   1.275        ///
   1.276        /// Returns the direction of the arc. Each arc represents an
   1.277        /// edge with a direction. It gives back the
   1.278        /// direction.
   1.279        bool direction(const Arc&) const { return true; }
   1.280  
   1.281 -      /// \brief Returns the directed arc.
   1.282 +      /// \brief Return the opposite arc.
   1.283        ///
   1.284 -      /// Returns the directed arc from its direction and the
   1.285 -      /// represented edge.
   1.286 -      Arc direct(const Edge&, bool) const { return INVALID;}
   1.287 -
   1.288 -      /// \brief Returns the directed arc.
   1.289 -      ///
   1.290 -      /// Returns the directed arc from its source and the
   1.291 -      /// represented edge.
   1.292 -      Arc direct(const Edge&, const Node&) const { return INVALID;}
   1.293 -
   1.294 -      /// \brief Returns the opposite arc.
   1.295 -      ///
   1.296 -      /// Returns the opposite arc. It is the arc representing the
   1.297 -      /// same edge and has opposite direction.
   1.298 -      Arc oppositeArc(const Arc&) const { return INVALID;}
   1.299 -
   1.300 -      /// \brief Gives back one ending of an edge.
   1.301 -      ///
   1.302 -      /// Gives back one ending of an edge.
   1.303 -      Node u(const Edge&) const { return INVALID;}
   1.304 -
   1.305 -      /// \brief Gives back the other ending of an edge.
   1.306 -      ///
   1.307 -      /// Gives back the other ending of an edge.
   1.308 -      Node v(const Edge&) const { return INVALID;}
   1.309 +      /// This function returns the opposite arc, i.e. the arc representing
   1.310 +      /// the same edge and has opposite direction.
   1.311 +      Arc oppositeArc(const Arc&) const { return INVALID; }
   1.312  
   1.313        template <typename _Graph>
   1.314        struct Constraints {
   1.315 @@ -268,7 +270,7 @@
   1.316  
   1.317          void constraints() {
   1.318            checkConcept<BaseDigraphComponent, _Graph>();
   1.319 -          checkConcept<GraphItem<'u'>, Edge>();
   1.320 +          checkConcept<GraphItem<'e'>, Edge>();
   1.321            {
   1.322              Node n;
   1.323              Edge ue(INVALID);
   1.324 @@ -276,6 +278,7 @@
   1.325              n = graph.u(ue);
   1.326              n = graph.v(ue);
   1.327              e = graph.direct(ue, true);
   1.328 +            e = graph.direct(ue, false);
   1.329              e = graph.direct(ue, n);
   1.330              e = graph.oppositeArc(e);
   1.331              ue = e;
   1.332 @@ -289,12 +292,12 @@
   1.333  
   1.334      };
   1.335  
   1.336 -    /// \brief An empty idable base digraph class.
   1.337 +    /// \brief Skeleton class for \e idable directed graphs.
   1.338      ///
   1.339 -    /// This class provides beside the core digraph features
   1.340 -    /// core id functions for the digraph structure.
   1.341 -    /// The most of the base digraphs should conform to this concept.
   1.342 -    /// The id's are unique and immutable.
   1.343 +    /// This class describes the interface of \e idable directed graphs.
   1.344 +    /// It extends \ref BaseDigraphComponent with the core ID functions.
   1.345 +    /// The ids of the items must be unique and immutable.
   1.346 +    /// This concept is part of the Digraph concept.
   1.347      template <typename BAS = BaseDigraphComponent>
   1.348      class IDableDigraphComponent : public BAS {
   1.349      public:
   1.350 @@ -303,45 +306,43 @@
   1.351        typedef typename Base::Node Node;
   1.352        typedef typename Base::Arc Arc;
   1.353  
   1.354 -      /// \brief Gives back an unique integer id for the Node.
   1.355 +      /// \brief Return a unique integer id for the given node.
   1.356        ///
   1.357 -      /// Gives back an unique integer id for the Node.
   1.358 +      /// This function returns a unique integer id for the given node.
   1.359 +      int id(const Node&) const { return -1; }
   1.360 +
   1.361 +      /// \brief Return the node by its unique id.
   1.362        ///
   1.363 -      int id(const Node&) const { return -1;}
   1.364 +      /// This function returns the node by its unique id.
   1.365 +      /// If the digraph does not contain a node with the given id,
   1.366 +      /// then the result of the function is undefined.
   1.367 +      Node nodeFromId(int) const { return INVALID; }
   1.368  
   1.369 -      /// \brief Gives back the node by the unique id.
   1.370 +      /// \brief Return a unique integer id for the given arc.
   1.371        ///
   1.372 -      /// Gives back the node by the unique id.
   1.373 -      /// If the digraph does not contain node with the given id
   1.374 -      /// then the result of the function is undetermined.
   1.375 -      Node nodeFromId(int) const { return INVALID;}
   1.376 +      /// This function returns a unique integer id for the given arc.
   1.377 +      int id(const Arc&) const { return -1; }
   1.378  
   1.379 -      /// \brief Gives back an unique integer id for the Arc.
   1.380 +      /// \brief Return the arc by its unique id.
   1.381        ///
   1.382 -      /// Gives back an unique integer id for the Arc.
   1.383 +      /// This function returns the arc by its unique id.
   1.384 +      /// If the digraph does not contain an arc with the given id,
   1.385 +      /// then the result of the function is undefined.
   1.386 +      Arc arcFromId(int) const { return INVALID; }
   1.387 +
   1.388 +      /// \brief Return an integer greater or equal to the maximum
   1.389 +      /// node id.
   1.390        ///
   1.391 -      int id(const Arc&) const { return -1;}
   1.392 +      /// This function returns an integer greater or equal to the
   1.393 +      /// maximum node id.
   1.394 +      int maxNodeId() const { return -1; }
   1.395  
   1.396 -      /// \brief Gives back the arc by the unique id.
   1.397 +      /// \brief Return an integer greater or equal to the maximum
   1.398 +      /// arc id.
   1.399        ///
   1.400 -      /// Gives back the arc by the unique id.
   1.401 -      /// If the digraph does not contain arc with the given id
   1.402 -      /// then the result of the function is undetermined.
   1.403 -      Arc arcFromId(int) const { return INVALID;}
   1.404 -
   1.405 -      /// \brief Gives back an integer greater or equal to the maximum
   1.406 -      /// Node id.
   1.407 -      ///
   1.408 -      /// Gives back an integer greater or equal to the maximum Node
   1.409 -      /// id.
   1.410 -      int maxNodeId() const { return -1;}
   1.411 -
   1.412 -      /// \brief Gives back an integer greater or equal to the maximum
   1.413 -      /// Arc id.
   1.414 -      ///
   1.415 -      /// Gives back an integer greater or equal to the maximum Arc
   1.416 -      /// id.
   1.417 -      int maxArcId() const { return -1;}
   1.418 +      /// This function returns an integer greater or equal to the
   1.419 +      /// maximum arc id.
   1.420 +      int maxArcId() const { return -1; }
   1.421  
   1.422        template <typename _Digraph>
   1.423        struct Constraints {
   1.424 @@ -367,12 +368,13 @@
   1.425        };
   1.426      };
   1.427  
   1.428 -    /// \brief An empty idable base undirected graph class.
   1.429 +    /// \brief Skeleton class for \e idable undirected graphs.
   1.430      ///
   1.431 -    /// This class provides beside the core undirected graph features
   1.432 -    /// core id functions for the undirected graph structure.  The
   1.433 -    /// most of the base undirected graphs should conform to this
   1.434 -    /// concept.  The id's are unique and immutable.
   1.435 +    /// This class describes the interface of \e idable undirected
   1.436 +    /// graphs. It extends \ref IDableDigraphComponent with the core ID
   1.437 +    /// functions of undirected graphs.
   1.438 +    /// The ids of the items must be unique and immutable.
   1.439 +    /// This concept is part of the Graph concept.
   1.440      template <typename BAS = BaseGraphComponent>
   1.441      class IDableGraphComponent : public IDableDigraphComponent<BAS> {
   1.442      public:
   1.443 @@ -382,31 +384,29 @@
   1.444  
   1.445        using IDableDigraphComponent<Base>::id;
   1.446  
   1.447 -      /// \brief Gives back an unique integer id for the Edge.
   1.448 +      /// \brief Return a unique integer id for the given edge.
   1.449        ///
   1.450 -      /// Gives back an unique integer id for the Edge.
   1.451 +      /// This function returns a unique integer id for the given edge.
   1.452 +      int id(const Edge&) const { return -1; }
   1.453 +
   1.454 +      /// \brief Return the edge by its unique id.
   1.455        ///
   1.456 -      int id(const Edge&) const { return -1;}
   1.457 +      /// This function returns the edge by its unique id.
   1.458 +      /// If the graph does not contain an edge with the given id,
   1.459 +      /// then the result of the function is undefined.
   1.460 +      Edge edgeFromId(int) const { return INVALID; }
   1.461  
   1.462 -      /// \brief Gives back the edge by the unique id.
   1.463 +      /// \brief Return an integer greater or equal to the maximum
   1.464 +      /// edge id.
   1.465        ///
   1.466 -      /// Gives back the edge by the unique id.  If the
   1.467 -      /// graph does not contain arc with the given id then the
   1.468 -      /// result of the function is undetermined.
   1.469 -      Edge edgeFromId(int) const { return INVALID;}
   1.470 -
   1.471 -      /// \brief Gives back an integer greater or equal to the maximum
   1.472 -      /// Edge id.
   1.473 -      ///
   1.474 -      /// Gives back an integer greater or equal to the maximum Edge
   1.475 -      /// id.
   1.476 -      int maxEdgeId() const { return -1;}
   1.477 +      /// This function returns an integer greater or equal to the
   1.478 +      /// maximum edge id.
   1.479 +      int maxEdgeId() const { return -1; }
   1.480  
   1.481        template <typename _Graph>
   1.482        struct Constraints {
   1.483  
   1.484          void constraints() {
   1.485 -          checkConcept<Base, _Graph >();
   1.486            checkConcept<IDableDigraphComponent<Base>, _Graph >();
   1.487            typename _Graph::Edge edge;
   1.488            int ueid = graph.id(edge);
   1.489 @@ -420,59 +420,71 @@
   1.490        };
   1.491      };
   1.492  
   1.493 -    /// \brief Skeleton class for graph NodeIt and ArcIt
   1.494 +    /// \brief Concept class for \c NodeIt, \c ArcIt and \c EdgeIt types.
   1.495      ///
   1.496 -    /// Skeleton class for graph NodeIt and ArcIt.
   1.497 -    ///
   1.498 +    /// This class describes the concept of \c NodeIt, \c ArcIt and 
   1.499 +    /// \c EdgeIt subtypes of digraph and graph types.
   1.500      template <typename GR, typename Item>
   1.501      class GraphItemIt : public Item {
   1.502      public:
   1.503        /// \brief Default constructor.
   1.504        ///
   1.505 -      /// @warning The default constructor sets the iterator
   1.506 -      /// to an undefined value.
   1.507 +      /// Default constructor.
   1.508 +      /// \warning The default constructor is not required to set
   1.509 +      /// the iterator to some well-defined value. So you should consider it
   1.510 +      /// as uninitialized.
   1.511        GraphItemIt() {}
   1.512 +
   1.513        /// \brief Copy constructor.
   1.514        ///
   1.515        /// Copy constructor.
   1.516 +      GraphItemIt(const GraphItemIt& it) : Item(it) {}
   1.517 +
   1.518 +      /// \brief Constructor that sets the iterator to the first item.
   1.519        ///
   1.520 -      GraphItemIt(const GraphItemIt& ) {}
   1.521 -      /// \brief Sets the iterator to the first item.
   1.522 +      /// Constructor that sets the iterator to the first item.
   1.523 +      explicit GraphItemIt(const GR&) {}
   1.524 +
   1.525 +      /// \brief Constructor for conversion from \c INVALID.
   1.526        ///
   1.527 -      /// Sets the iterator to the first item of \c the graph.
   1.528 -      ///
   1.529 -      explicit GraphItemIt(const GR&) {}
   1.530 -      /// \brief Invalid constructor \& conversion.
   1.531 -      ///
   1.532 -      /// This constructor initializes the item to be invalid.
   1.533 +      /// Constructor for conversion from \c INVALID.
   1.534 +      /// It initializes the iterator to be invalid.
   1.535        /// \sa Invalid for more details.
   1.536        GraphItemIt(Invalid) {}
   1.537 -      /// \brief Assign operator for items.
   1.538 +
   1.539 +      /// \brief Assignment operator.
   1.540        ///
   1.541 -      /// The items are assignable.
   1.542 +      /// Assignment operator for the iterator.
   1.543 +      GraphItemIt& operator=(const GraphItemIt&) { return *this; }
   1.544 +
   1.545 +      /// \brief Increment the iterator.
   1.546        ///
   1.547 -      GraphItemIt& operator=(const GraphItemIt&) { return *this; }
   1.548 -      /// \brief Next item.
   1.549 -      ///
   1.550 -      /// Assign the iterator to the next item.
   1.551 -      ///
   1.552 +      /// This operator increments the iterator, i.e. assigns it to the
   1.553 +      /// next item.
   1.554        GraphItemIt& operator++() { return *this; }
   1.555 + 
   1.556        /// \brief Equality operator
   1.557        ///
   1.558 +      /// Equality operator.
   1.559        /// Two iterators are equal if and only if they point to the
   1.560        /// same object or both are invalid.
   1.561        bool operator==(const GraphItemIt&) const { return true;}
   1.562 +
   1.563        /// \brief Inequality operator
   1.564        ///
   1.565 -      /// \sa operator==(Node n)
   1.566 -      ///
   1.567 +      /// Inequality operator.
   1.568 +      /// Two iterators are equal if and only if they point to the
   1.569 +      /// same object or both are invalid.
   1.570        bool operator!=(const GraphItemIt&) const { return true;}
   1.571  
   1.572        template<typename _GraphItemIt>
   1.573        struct Constraints {
   1.574          void constraints() {
   1.575 +          checkConcept<GraphItem<>, _GraphItemIt>();
   1.576            _GraphItemIt it1(g);
   1.577            _GraphItemIt it2;
   1.578 +          _GraphItemIt it3 = it1;
   1.579 +          _GraphItemIt it4 = INVALID;
   1.580  
   1.581            it2 = ++it1;
   1.582            ++it2 = it1;
   1.583 @@ -481,16 +493,20 @@
   1.584            Item bi = it1;
   1.585            bi = it2;
   1.586          }
   1.587 -        GR& g;
   1.588 +        const GR& g;
   1.589        };
   1.590      };
   1.591  
   1.592 -    /// \brief Skeleton class for graph InArcIt and OutArcIt
   1.593 +    /// \brief Concept class for \c InArcIt, \c OutArcIt and 
   1.594 +    /// \c IncEdgeIt types.
   1.595      ///
   1.596 -    /// \note Because InArcIt and OutArcIt may not inherit from the same
   1.597 -    /// base class, the \c sel is a additional template parameter (selector).
   1.598 -    /// For InArcIt you should instantiate it with character 'i' and for
   1.599 -    /// OutArcIt with 'o'.
   1.600 +    /// This class describes the concept of \c InArcIt, \c OutArcIt 
   1.601 +    /// and \c IncEdgeIt subtypes of digraph and graph types.
   1.602 +    ///
   1.603 +    /// \note Since these iterator classes do not inherit from the same
   1.604 +    /// base class, there is an additional template parameter (selector)
   1.605 +    /// \c sel. For \c InArcIt you should instantiate it with character 
   1.606 +    /// \c 'i', for \c OutArcIt with \c 'o' and for \c IncEdgeIt with \c 'e'.
   1.607      template <typename GR,
   1.608                typename Item = typename GR::Arc,
   1.609                typename Base = typename GR::Node,
   1.610 @@ -499,47 +515,54 @@
   1.611      public:
   1.612        /// \brief Default constructor.
   1.613        ///
   1.614 -      /// @warning The default constructor sets the iterator
   1.615 -      /// to an undefined value.
   1.616 +      /// Default constructor.
   1.617 +      /// \warning The default constructor is not required to set
   1.618 +      /// the iterator to some well-defined value. So you should consider it
   1.619 +      /// as uninitialized.
   1.620        GraphIncIt() {}
   1.621 +
   1.622        /// \brief Copy constructor.
   1.623        ///
   1.624        /// Copy constructor.
   1.625 +      GraphIncIt(const GraphIncIt& it) : Item(it) {}
   1.626 +
   1.627 +      /// \brief Constructor that sets the iterator to the first 
   1.628 +      /// incoming or outgoing arc.
   1.629        ///
   1.630 -      GraphIncIt(GraphIncIt const& gi) : Item(gi) {}
   1.631 -      /// \brief Sets the iterator to the first arc incoming into or outgoing
   1.632 -      /// from the node.
   1.633 +      /// Constructor that sets the iterator to the first arc 
   1.634 +      /// incoming to or outgoing from the given node.
   1.635 +      explicit GraphIncIt(const GR&, const Base&) {}
   1.636 +
   1.637 +      /// \brief Constructor for conversion from \c INVALID.
   1.638        ///
   1.639 -      /// Sets the iterator to the first arc incoming into or outgoing
   1.640 -      /// from the node.
   1.641 -      ///
   1.642 -      explicit GraphIncIt(const GR&, const Base&) {}
   1.643 -      /// \brief Invalid constructor \& conversion.
   1.644 -      ///
   1.645 -      /// This constructor initializes the item to be invalid.
   1.646 +      /// Constructor for conversion from \c INVALID.
   1.647 +      /// It initializes the iterator to be invalid.
   1.648        /// \sa Invalid for more details.
   1.649        GraphIncIt(Invalid) {}
   1.650 -      /// \brief Assign operator for iterators.
   1.651 +
   1.652 +      /// \brief Assignment operator.
   1.653        ///
   1.654 -      /// The iterators are assignable.
   1.655 +      /// Assignment operator for the iterator.
   1.656 +      GraphIncIt& operator=(const GraphIncIt&) { return *this; }
   1.657 +
   1.658 +      /// \brief Increment the iterator.
   1.659        ///
   1.660 -      GraphIncIt& operator=(GraphIncIt const&) { return *this; }
   1.661 -      /// \brief Next item.
   1.662 -      ///
   1.663 -      /// Assign the iterator to the next item.
   1.664 -      ///
   1.665 +      /// This operator increments the iterator, i.e. assigns it to the
   1.666 +      /// next arc incoming to or outgoing from the given node.
   1.667        GraphIncIt& operator++() { return *this; }
   1.668  
   1.669        /// \brief Equality operator
   1.670        ///
   1.671 +      /// Equality operator.
   1.672        /// Two iterators are equal if and only if they point to the
   1.673        /// same object or both are invalid.
   1.674        bool operator==(const GraphIncIt&) const { return true;}
   1.675  
   1.676        /// \brief Inequality operator
   1.677        ///
   1.678 -      /// \sa operator==(Node n)
   1.679 -      ///
   1.680 +      /// Inequality operator.
   1.681 +      /// Two iterators are equal if and only if they point to the
   1.682 +      /// same object or both are invalid.
   1.683        bool operator!=(const GraphIncIt&) const { return true;}
   1.684  
   1.685        template <typename _GraphIncIt>
   1.686 @@ -548,27 +571,25 @@
   1.687            checkConcept<GraphItem<sel>, _GraphIncIt>();
   1.688            _GraphIncIt it1(graph, node);
   1.689            _GraphIncIt it2;
   1.690 +          _GraphIncIt it3 = it1;
   1.691 +          _GraphIncIt it4 = INVALID;
   1.692  
   1.693            it2 = ++it1;
   1.694            ++it2 = it1;
   1.695            ++(++it1);
   1.696            Item e = it1;
   1.697            e = it2;
   1.698 -
   1.699          }
   1.700 -
   1.701 -        Item arc;
   1.702 -        Base node;
   1.703 -        GR graph;
   1.704 -        _GraphIncIt it;
   1.705 +        const Base& node;
   1.706 +        const GR& graph;
   1.707        };
   1.708      };
   1.709  
   1.710 -
   1.711 -    /// \brief An empty iterable digraph class.
   1.712 +    /// \brief Skeleton class for iterable directed graphs.
   1.713      ///
   1.714 -    /// This class provides beside the core digraph features
   1.715 -    /// iterator based iterable interface for the digraph structure.
   1.716 +    /// This class describes the interface of iterable directed
   1.717 +    /// graphs. It extends \ref BaseDigraphComponent with the core
   1.718 +    /// iterable interface.
   1.719      /// This concept is part of the Digraph concept.
   1.720      template <typename BAS = BaseDigraphComponent>
   1.721      class IterableDigraphComponent : public BAS {
   1.722 @@ -583,68 +604,59 @@
   1.723  
   1.724        /// \name Base iteration
   1.725        ///
   1.726 -      /// This interface provides functions for iteration on digraph items
   1.727 +      /// This interface provides functions for iteration on digraph items.
   1.728        ///
   1.729        /// @{
   1.730  
   1.731 -      /// \brief Gives back the first node in the iterating order.
   1.732 +      /// \brief Return the first node.
   1.733        ///
   1.734 -      /// Gives back the first node in the iterating order.
   1.735 -      ///
   1.736 +      /// This function gives back the first node in the iteration order.
   1.737        void first(Node&) const {}
   1.738  
   1.739 -      /// \brief Gives back the next node in the iterating order.
   1.740 +      /// \brief Return the next node.
   1.741        ///
   1.742 -      /// Gives back the next node in the iterating order.
   1.743 -      ///
   1.744 +      /// This function gives back the next node in the iteration order.
   1.745        void next(Node&) const {}
   1.746  
   1.747 -      /// \brief Gives back the first arc in the iterating order.
   1.748 +      /// \brief Return the first arc.
   1.749        ///
   1.750 -      /// Gives back the first arc in the iterating order.
   1.751 -      ///
   1.752 +      /// This function gives back the first arc in the iteration order.
   1.753        void first(Arc&) const {}
   1.754  
   1.755 -      /// \brief Gives back the next arc in the iterating order.
   1.756 +      /// \brief Return the next arc.
   1.757        ///
   1.758 -      /// Gives back the next arc in the iterating order.
   1.759 -      ///
   1.760 +      /// This function gives back the next arc in the iteration order.
   1.761        void next(Arc&) const {}
   1.762  
   1.763 -
   1.764 -      /// \brief Gives back the first of the arcs point to the given
   1.765 -      /// node.
   1.766 +      /// \brief Return the first arc incomming to the given node.
   1.767        ///
   1.768 -      /// Gives back the first of the arcs point to the given node.
   1.769 -      ///
   1.770 +      /// This function gives back the first arc incomming to the
   1.771 +      /// given node.
   1.772        void firstIn(Arc&, const Node&) const {}
   1.773  
   1.774 -      /// \brief Gives back the next of the arcs points to the given
   1.775 -      /// node.
   1.776 +      /// \brief Return the next arc incomming to the given node.
   1.777        ///
   1.778 -      /// Gives back the next of the arcs points to the given node.
   1.779 -      ///
   1.780 +      /// This function gives back the next arc incomming to the
   1.781 +      /// given node.
   1.782        void nextIn(Arc&) const {}
   1.783  
   1.784 -      /// \brief Gives back the first of the arcs start from the
   1.785 +      /// \brief Return the first arc outgoing form the given node.
   1.786 +      ///
   1.787 +      /// This function gives back the first arc outgoing form the
   1.788        /// given node.
   1.789 -      ///
   1.790 -      /// Gives back the first of the arcs start from the given node.
   1.791 -      ///
   1.792        void firstOut(Arc&, const Node&) const {}
   1.793  
   1.794 -      /// \brief Gives back the next of the arcs start from the given
   1.795 -      /// node.
   1.796 +      /// \brief Return the next arc outgoing form the given node.
   1.797        ///
   1.798 -      /// Gives back the next of the arcs start from the given node.
   1.799 -      ///
   1.800 +      /// This function gives back the next arc outgoing form the
   1.801 +      /// given node.
   1.802        void nextOut(Arc&) const {}
   1.803  
   1.804        /// @}
   1.805  
   1.806        /// \name Class based iteration
   1.807        ///
   1.808 -      /// This interface provides functions for iteration on digraph items
   1.809 +      /// This interface provides iterator classes for digraph items.
   1.810        ///
   1.811        /// @{
   1.812  
   1.813 @@ -654,15 +666,15 @@
   1.814        ///
   1.815        typedef GraphItemIt<Digraph, Node> NodeIt;
   1.816  
   1.817 -      /// \brief This iterator goes through each node.
   1.818 +      /// \brief This iterator goes through each arc.
   1.819        ///
   1.820 -      /// This iterator goes through each node.
   1.821 +      /// This iterator goes through each arc.
   1.822        ///
   1.823        typedef GraphItemIt<Digraph, Arc> ArcIt;
   1.824  
   1.825        /// \brief This iterator goes trough the incoming arcs of a node.
   1.826        ///
   1.827 -      /// This iterator goes trough the \e inccoming arcs of a certain node
   1.828 +      /// This iterator goes trough the \e incoming arcs of a certain node
   1.829        /// of a digraph.
   1.830        typedef GraphIncIt<Digraph, Arc, Node, 'i'> InArcIt;
   1.831  
   1.832 @@ -674,26 +686,26 @@
   1.833  
   1.834        /// \brief The base node of the iterator.
   1.835        ///
   1.836 -      /// Gives back the base node of the iterator.
   1.837 -      /// It is always the target of the pointed arc.
   1.838 +      /// This function gives back the base node of the iterator.
   1.839 +      /// It is always the target node of the pointed arc.
   1.840        Node baseNode(const InArcIt&) const { return INVALID; }
   1.841  
   1.842        /// \brief The running node of the iterator.
   1.843        ///
   1.844 -      /// Gives back the running node of the iterator.
   1.845 -      /// It is always the source of the pointed arc.
   1.846 +      /// This function gives back the running node of the iterator.
   1.847 +      /// It is always the source node of the pointed arc.
   1.848        Node runningNode(const InArcIt&) const { return INVALID; }
   1.849  
   1.850        /// \brief The base node of the iterator.
   1.851        ///
   1.852 -      /// Gives back the base node of the iterator.
   1.853 -      /// It is always the source of the pointed arc.
   1.854 +      /// This function gives back the base node of the iterator.
   1.855 +      /// It is always the source node of the pointed arc.
   1.856        Node baseNode(const OutArcIt&) const { return INVALID; }
   1.857  
   1.858        /// \brief The running node of the iterator.
   1.859        ///
   1.860 -      /// Gives back the running node of the iterator.
   1.861 -      /// It is always the target of the pointed arc.
   1.862 +      /// This function gives back the running node of the iterator.
   1.863 +      /// It is always the target node of the pointed arc.
   1.864        Node runningNode(const OutArcIt&) const { return INVALID; }
   1.865  
   1.866        /// @}
   1.867 @@ -735,25 +747,25 @@
   1.868                typename _Digraph::Node, 'o'>, typename _Digraph::OutArcIt>();
   1.869  
   1.870              typename _Digraph::Node n;
   1.871 -            typename _Digraph::InArcIt ieit(INVALID);
   1.872 -            typename _Digraph::OutArcIt oeit(INVALID);
   1.873 -            n = digraph.baseNode(ieit);
   1.874 -            n = digraph.runningNode(ieit);
   1.875 -            n = digraph.baseNode(oeit);
   1.876 -            n = digraph.runningNode(oeit);
   1.877 +            const typename _Digraph::InArcIt iait(INVALID);
   1.878 +            const typename _Digraph::OutArcIt oait(INVALID);
   1.879 +            n = digraph.baseNode(iait);
   1.880 +            n = digraph.runningNode(iait);
   1.881 +            n = digraph.baseNode(oait);
   1.882 +            n = digraph.runningNode(oait);
   1.883              ignore_unused_variable_warning(n);
   1.884            }
   1.885          }
   1.886  
   1.887          const _Digraph& digraph;
   1.888 -
   1.889        };
   1.890      };
   1.891  
   1.892 -    /// \brief An empty iterable undirected graph class.
   1.893 +    /// \brief Skeleton class for iterable undirected graphs.
   1.894      ///
   1.895 -    /// This class provides beside the core graph features iterator
   1.896 -    /// based iterable interface for the undirected graph structure.
   1.897 +    /// This class describes the interface of iterable undirected
   1.898 +    /// graphs. It extends \ref IterableDigraphComponent with the core
   1.899 +    /// iterable interface of undirected graphs.
   1.900      /// This concept is part of the Graph concept.
   1.901      template <typename BAS = BaseGraphComponent>
   1.902      class IterableGraphComponent : public IterableDigraphComponent<BAS> {
   1.903 @@ -769,42 +781,36 @@
   1.904  
   1.905        /// \name Base iteration
   1.906        ///
   1.907 -      /// This interface provides functions for iteration on graph items
   1.908 +      /// This interface provides functions for iteration on edges.
   1.909 +      ///
   1.910        /// @{
   1.911  
   1.912        using IterableDigraphComponent<Base>::first;
   1.913        using IterableDigraphComponent<Base>::next;
   1.914  
   1.915 -      /// \brief Gives back the first edge in the iterating
   1.916 -      /// order.
   1.917 +      /// \brief Return the first edge.
   1.918        ///
   1.919 -      /// Gives back the first edge in the iterating order.
   1.920 -      ///
   1.921 +      /// This function gives back the first edge in the iteration order.
   1.922        void first(Edge&) const {}
   1.923  
   1.924 -      /// \brief Gives back the next edge in the iterating
   1.925 -      /// order.
   1.926 +      /// \brief Return the next edge.
   1.927        ///
   1.928 -      /// Gives back the next edge in the iterating order.
   1.929 -      ///
   1.930 +      /// This function gives back the next edge in the iteration order.
   1.931        void next(Edge&) const {}
   1.932  
   1.933 -
   1.934 -      /// \brief Gives back the first of the edges from the
   1.935 +      /// \brief Return the first edge incident to the given node.
   1.936 +      ///
   1.937 +      /// This function gives back the first edge incident to the given 
   1.938 +      /// node. The bool parameter gives back the direction for which the
   1.939 +      /// source node of the directed arc representing the edge is the 
   1.940        /// given node.
   1.941 -      ///
   1.942 -      /// Gives back the first of the edges from the given
   1.943 -      /// node. The bool parameter gives back that direction which
   1.944 -      /// gives a good direction of the edge so the source of the
   1.945 -      /// directed arc is the given node.
   1.946        void firstInc(Edge&, bool&, const Node&) const {}
   1.947  
   1.948        /// \brief Gives back the next of the edges from the
   1.949        /// given node.
   1.950        ///
   1.951 -      /// Gives back the next of the edges from the given
   1.952 -      /// node. The bool parameter should be used as the \c firstInc()
   1.953 -      /// use it.
   1.954 +      /// This function gives back the next edge incident to the given 
   1.955 +      /// node. The bool parameter should be used as \c firstInc() use it.
   1.956        void nextInc(Edge&, bool&) const {}
   1.957  
   1.958        using IterableDigraphComponent<Base>::baseNode;
   1.959 @@ -814,28 +820,30 @@
   1.960  
   1.961        /// \name Class based iteration
   1.962        ///
   1.963 -      /// This interface provides functions for iteration on graph items
   1.964 +      /// This interface provides iterator classes for edges.
   1.965        ///
   1.966        /// @{
   1.967  
   1.968 -      /// \brief This iterator goes through each node.
   1.969 +      /// \brief This iterator goes through each edge.
   1.970        ///
   1.971 -      /// This iterator goes through each node.
   1.972 +      /// This iterator goes through each edge.
   1.973        typedef GraphItemIt<Graph, Edge> EdgeIt;
   1.974 -      /// \brief This iterator goes trough the incident arcs of a
   1.975 +
   1.976 +      /// \brief This iterator goes trough the incident edges of a
   1.977        /// node.
   1.978        ///
   1.979 -      /// This iterator goes trough the incident arcs of a certain
   1.980 +      /// This iterator goes trough the incident edges of a certain
   1.981        /// node of a graph.
   1.982 -      typedef GraphIncIt<Graph, Edge, Node, 'u'> IncEdgeIt;
   1.983 +      typedef GraphIncIt<Graph, Edge, Node, 'e'> IncEdgeIt;
   1.984 +
   1.985        /// \brief The base node of the iterator.
   1.986        ///
   1.987 -      /// Gives back the base node of the iterator.
   1.988 +      /// This function gives back the base node of the iterator.
   1.989        Node baseNode(const IncEdgeIt&) const { return INVALID; }
   1.990  
   1.991        /// \brief The running node of the iterator.
   1.992        ///
   1.993 -      /// Gives back the running node of the iterator.
   1.994 +      /// This function gives back the running node of the iterator.
   1.995        Node runningNode(const IncEdgeIt&) const { return INVALID; }
   1.996  
   1.997        /// @}
   1.998 @@ -864,12 +872,12 @@
   1.999              checkConcept<GraphItemIt<_Graph, typename _Graph::Edge>,
  1.1000                typename _Graph::EdgeIt >();
  1.1001              checkConcept<GraphIncIt<_Graph, typename _Graph::Edge,
  1.1002 -              typename _Graph::Node, 'u'>, typename _Graph::IncEdgeIt>();
  1.1003 +              typename _Graph::Node, 'e'>, typename _Graph::IncEdgeIt>();
  1.1004  
  1.1005              typename _Graph::Node n;
  1.1006 -            typename _Graph::IncEdgeIt ueit(INVALID);
  1.1007 -            n = graph.baseNode(ueit);
  1.1008 -            n = graph.runningNode(ueit);
  1.1009 +            const typename _Graph::IncEdgeIt ieit(INVALID);
  1.1010 +            n = graph.baseNode(ieit);
  1.1011 +            n = graph.runningNode(ieit);
  1.1012            }
  1.1013          }
  1.1014  
  1.1015 @@ -877,13 +885,14 @@
  1.1016        };
  1.1017      };
  1.1018  
  1.1019 -    /// \brief An empty alteration notifier digraph class.
  1.1020 +    /// \brief Skeleton class for alterable directed graphs.
  1.1021      ///
  1.1022 -    /// This class provides beside the core digraph features alteration
  1.1023 -    /// notifier interface for the digraph structure.  This implements
  1.1024 +    /// This class describes the interface of alterable directed
  1.1025 +    /// graphs. It extends \ref BaseDigraphComponent with the alteration
  1.1026 +    /// notifier interface. It implements
  1.1027      /// an observer-notifier pattern for each digraph item. More
  1.1028      /// obsevers can be registered into the notifier and whenever an
  1.1029 -    /// alteration occured in the digraph all the observers will
  1.1030 +    /// alteration occured in the digraph all the observers will be
  1.1031      /// notified about it.
  1.1032      template <typename BAS = BaseDigraphComponent>
  1.1033      class AlterableDigraphComponent : public BAS {
  1.1034 @@ -894,23 +903,23 @@
  1.1035        typedef typename Base::Arc Arc;
  1.1036  
  1.1037  
  1.1038 -      /// The node observer registry.
  1.1039 +      /// Node alteration notifier class.
  1.1040        typedef AlterationNotifier<AlterableDigraphComponent, Node>
  1.1041        NodeNotifier;
  1.1042 -      /// The arc observer registry.
  1.1043 +      /// Arc alteration notifier class.
  1.1044        typedef AlterationNotifier<AlterableDigraphComponent, Arc>
  1.1045        ArcNotifier;
  1.1046  
  1.1047 -      /// \brief Gives back the node alteration notifier.
  1.1048 +      /// \brief Return the node alteration notifier.
  1.1049        ///
  1.1050 -      /// Gives back the node alteration notifier.
  1.1051 +      /// This function gives back the node alteration notifier.
  1.1052        NodeNotifier& notifier(Node) const {
  1.1053 -        return NodeNotifier();
  1.1054 +         return NodeNotifier();
  1.1055        }
  1.1056  
  1.1057 -      /// \brief Gives back the arc alteration notifier.
  1.1058 +      /// \brief Return the arc alteration notifier.
  1.1059        ///
  1.1060 -      /// Gives back the arc alteration notifier.
  1.1061 +      /// This function gives back the arc alteration notifier.
  1.1062        ArcNotifier& notifier(Arc) const {
  1.1063          return ArcNotifier();
  1.1064        }
  1.1065 @@ -930,18 +939,17 @@
  1.1066          }
  1.1067  
  1.1068          const _Digraph& digraph;
  1.1069 -
  1.1070        };
  1.1071 -
  1.1072      };
  1.1073  
  1.1074 -    /// \brief An empty alteration notifier undirected graph class.
  1.1075 +    /// \brief Skeleton class for alterable undirected graphs.
  1.1076      ///
  1.1077 -    /// This class provides beside the core graph features alteration
  1.1078 -    /// notifier interface for the graph structure.  This implements
  1.1079 -    /// an observer-notifier pattern for each graph item. More
  1.1080 +    /// This class describes the interface of alterable undirected
  1.1081 +    /// graphs. It extends \ref AlterableDigraphComponent with the alteration
  1.1082 +    /// notifier interface of undirected graphs. It implements
  1.1083 +    /// an observer-notifier pattern for the edges. More
  1.1084      /// obsevers can be registered into the notifier and whenever an
  1.1085 -    /// alteration occured in the graph all the observers will
  1.1086 +    /// alteration occured in the graph all the observers will be
  1.1087      /// notified about it.
  1.1088      template <typename BAS = BaseGraphComponent>
  1.1089      class AlterableGraphComponent : public AlterableDigraphComponent<BAS> {
  1.1090 @@ -951,13 +959,13 @@
  1.1091        typedef typename Base::Edge Edge;
  1.1092  
  1.1093  
  1.1094 -      /// The arc observer registry.
  1.1095 +      /// Edge alteration notifier class.
  1.1096        typedef AlterationNotifier<AlterableGraphComponent, Edge>
  1.1097        EdgeNotifier;
  1.1098  
  1.1099 -      /// \brief Gives back the arc alteration notifier.
  1.1100 +      /// \brief Return the edge alteration notifier.
  1.1101        ///
  1.1102 -      /// Gives back the arc alteration notifier.
  1.1103 +      /// This function gives back the edge alteration notifier.
  1.1104        EdgeNotifier& notifier(Edge) const {
  1.1105          return EdgeNotifier();
  1.1106        }
  1.1107 @@ -965,7 +973,7 @@
  1.1108        template <typename _Graph>
  1.1109        struct Constraints {
  1.1110          void constraints() {
  1.1111 -          checkConcept<AlterableGraphComponent<Base>, _Graph>();
  1.1112 +          checkConcept<AlterableDigraphComponent<Base>, _Graph>();
  1.1113            typename _Graph::EdgeNotifier& uen
  1.1114              = graph.notifier(typename _Graph::Edge());
  1.1115            ignore_unused_variable_warning(uen);
  1.1116 @@ -975,11 +983,11 @@
  1.1117        };
  1.1118      };
  1.1119  
  1.1120 -    /// \brief Class describing the concept of graph maps
  1.1121 +    /// \brief Concept class for standard graph maps.
  1.1122      ///
  1.1123 -    /// This class describes the common interface of the graph maps
  1.1124 -    /// (NodeMap, ArcMap), that is maps that can be used to
  1.1125 -    /// associate data to graph descriptors (nodes or arcs).
  1.1126 +    /// This class describes the concept of standard graph maps, i.e.
  1.1127 +    /// the \c NodeMap, \c ArcMap and \c EdgeMap subtypes of digraph and 
  1.1128 +    /// graph types, which can be used for associating data to graph items.
  1.1129      template <typename GR, typename K, typename V>
  1.1130      class GraphMap : public ReadWriteMap<K, V> {
  1.1131      public:
  1.1132 @@ -999,7 +1007,7 @@
  1.1133        explicit GraphMap(const Graph&) {}
  1.1134        /// \brief Construct a new map with default value.
  1.1135        ///
  1.1136 -      /// Construct a new map for the graph and initalise the values.
  1.1137 +      /// Construct a new map for the graph and initalize the values.
  1.1138        GraphMap(const Graph&, const Value&) {}
  1.1139  
  1.1140      private:
  1.1141 @@ -1008,9 +1016,9 @@
  1.1142        /// Copy Constructor.
  1.1143        GraphMap(const GraphMap&) : Parent() {}
  1.1144  
  1.1145 -      /// \brief Assign operator.
  1.1146 +      /// \brief Assignment operator.
  1.1147        ///
  1.1148 -      /// Assign operator. It does not mofify the underlying graph,
  1.1149 +      /// Assignment operator. It does not mofify the underlying graph,
  1.1150        /// it just iterates on the current item set and set the  map
  1.1151        /// with the value returned by the assigned map.
  1.1152        template <typename CMap>
  1.1153 @@ -1024,32 +1032,33 @@
  1.1154        struct Constraints {
  1.1155          void constraints() {
  1.1156            checkConcept<ReadWriteMap<Key, Value>, _Map >();
  1.1157 -          // Construction with a graph parameter
  1.1158 -          _Map a(g);
  1.1159 -          // Constructor with a graph and a default value parameter
  1.1160 -          _Map a2(g,t);
  1.1161 -          // Copy constructor.
  1.1162 -          // _Map b(c);
  1.1163 +          _Map m1(g);
  1.1164 +          _Map m2(g,t);
  1.1165 +          
  1.1166 +          // Copy constructor
  1.1167 +          // _Map m3(m);
  1.1168  
  1.1169 +          // Assignment operator
  1.1170            // ReadMap<Key, Value> cmap;
  1.1171 -          // b = cmap;
  1.1172 +          // m3 = cmap;
  1.1173  
  1.1174 -          ignore_unused_variable_warning(a);
  1.1175 -          ignore_unused_variable_warning(a2);
  1.1176 -          // ignore_unused_variable_warning(b);
  1.1177 +          ignore_unused_variable_warning(m1);
  1.1178 +          ignore_unused_variable_warning(m2);
  1.1179 +          // ignore_unused_variable_warning(m3);
  1.1180          }
  1.1181  
  1.1182 -        const _Map &c;
  1.1183 +        const _Map &m;
  1.1184          const Graph &g;
  1.1185          const typename GraphMap::Value &t;
  1.1186        };
  1.1187  
  1.1188      };
  1.1189  
  1.1190 -    /// \brief An empty mappable digraph class.
  1.1191 +    /// \brief Skeleton class for mappable directed graphs.
  1.1192      ///
  1.1193 -    /// This class provides beside the core digraph features
  1.1194 -    /// map interface for the digraph structure.
  1.1195 +    /// This class describes the interface of mappable directed graphs.
  1.1196 +    /// It extends \ref BaseDigraphComponent with the standard digraph 
  1.1197 +    /// map classes, namely \c NodeMap and \c ArcMap.
  1.1198      /// This concept is part of the Digraph concept.
  1.1199      template <typename BAS = BaseDigraphComponent>
  1.1200      class MappableDigraphComponent : public BAS  {
  1.1201 @@ -1061,12 +1070,11 @@
  1.1202  
  1.1203        typedef MappableDigraphComponent Digraph;
  1.1204  
  1.1205 -      /// \brief ReadWrite map of the nodes.
  1.1206 +      /// \brief Standard graph map for the nodes.
  1.1207        ///
  1.1208 -      /// ReadWrite map of the nodes.
  1.1209 -      ///
  1.1210 +      /// Standard graph map for the nodes.
  1.1211        template <typename V>
  1.1212 -      class NodeMap : public GraphMap<Digraph, Node, V> {
  1.1213 +      class NodeMap : public GraphMap<MappableDigraphComponent, Node, V> {
  1.1214        public:
  1.1215          typedef GraphMap<MappableDigraphComponent, Node, V> Parent;
  1.1216  
  1.1217 @@ -1078,7 +1086,7 @@
  1.1218  
  1.1219          /// \brief Construct a new map with default value.
  1.1220          ///
  1.1221 -        /// Construct a new map for the digraph and initalise the values.
  1.1222 +        /// Construct a new map for the digraph and initalize the values.
  1.1223          NodeMap(const MappableDigraphComponent& digraph, const V& value)
  1.1224            : Parent(digraph, value) {}
  1.1225  
  1.1226 @@ -1088,9 +1096,9 @@
  1.1227          /// Copy Constructor.
  1.1228          NodeMap(const NodeMap& nm) : Parent(nm) {}
  1.1229  
  1.1230 -        /// \brief Assign operator.
  1.1231 +        /// \brief Assignment operator.
  1.1232          ///
  1.1233 -        /// Assign operator.
  1.1234 +        /// Assignment operator.
  1.1235          template <typename CMap>
  1.1236          NodeMap& operator=(const CMap&) {
  1.1237            checkConcept<ReadMap<Node, V>, CMap>();
  1.1238 @@ -1099,12 +1107,11 @@
  1.1239  
  1.1240        };
  1.1241  
  1.1242 -      /// \brief ReadWrite map of the arcs.
  1.1243 +      /// \brief Standard graph map for the arcs.
  1.1244        ///
  1.1245 -      /// ReadWrite map of the arcs.
  1.1246 -      ///
  1.1247 +      /// Standard graph map for the arcs.
  1.1248        template <typename V>
  1.1249 -      class ArcMap : public GraphMap<Digraph, Arc, V> {
  1.1250 +      class ArcMap : public GraphMap<MappableDigraphComponent, Arc, V> {
  1.1251        public:
  1.1252          typedef GraphMap<MappableDigraphComponent, Arc, V> Parent;
  1.1253  
  1.1254 @@ -1116,7 +1123,7 @@
  1.1255  
  1.1256          /// \brief Construct a new map with default value.
  1.1257          ///
  1.1258 -        /// Construct a new map for the digraph and initalise the values.
  1.1259 +        /// Construct a new map for the digraph and initalize the values.
  1.1260          ArcMap(const MappableDigraphComponent& digraph, const V& value)
  1.1261            : Parent(digraph, value) {}
  1.1262  
  1.1263 @@ -1126,9 +1133,9 @@
  1.1264          /// Copy Constructor.
  1.1265          ArcMap(const ArcMap& nm) : Parent(nm) {}
  1.1266  
  1.1267 -        /// \brief Assign operator.
  1.1268 +        /// \brief Assignment operator.
  1.1269          ///
  1.1270 -        /// Assign operator.
  1.1271 +        /// Assignment operator.
  1.1272          template <typename CMap>
  1.1273          ArcMap& operator=(const CMap&) {
  1.1274            checkConcept<ReadMap<Arc, V>, CMap>();
  1.1275 @@ -1178,14 +1185,15 @@
  1.1276            }
  1.1277          }
  1.1278  
  1.1279 -        _Digraph& digraph;
  1.1280 +        const _Digraph& digraph;
  1.1281        };
  1.1282      };
  1.1283  
  1.1284 -    /// \brief An empty mappable base bipartite graph class.
  1.1285 +    /// \brief Skeleton class for mappable undirected graphs.
  1.1286      ///
  1.1287 -    /// This class provides beside the core graph features
  1.1288 -    /// map interface for the graph structure.
  1.1289 +    /// This class describes the interface of mappable undirected graphs.
  1.1290 +    /// It extends \ref MappableDigraphComponent with the standard graph 
  1.1291 +    /// map class for edges (\c EdgeMap).
  1.1292      /// This concept is part of the Graph concept.
  1.1293      template <typename BAS = BaseGraphComponent>
  1.1294      class MappableGraphComponent : public MappableDigraphComponent<BAS>  {
  1.1295 @@ -1196,12 +1204,11 @@
  1.1296  
  1.1297        typedef MappableGraphComponent Graph;
  1.1298  
  1.1299 -      /// \brief ReadWrite map of the edges.
  1.1300 +      /// \brief Standard graph map for the edges.
  1.1301        ///
  1.1302 -      /// ReadWrite map of the edges.
  1.1303 -      ///
  1.1304 +      /// Standard graph map for the edges.
  1.1305        template <typename V>
  1.1306 -      class EdgeMap : public GraphMap<Graph, Edge, V> {
  1.1307 +      class EdgeMap : public GraphMap<MappableGraphComponent, Edge, V> {
  1.1308        public:
  1.1309          typedef GraphMap<MappableGraphComponent, Edge, V> Parent;
  1.1310  
  1.1311 @@ -1213,7 +1220,7 @@
  1.1312  
  1.1313          /// \brief Construct a new map with default value.
  1.1314          ///
  1.1315 -        /// Construct a new map for the graph and initalise the values.
  1.1316 +        /// Construct a new map for the graph and initalize the values.
  1.1317          EdgeMap(const MappableGraphComponent& graph, const V& value)
  1.1318            : Parent(graph, value) {}
  1.1319  
  1.1320 @@ -1223,9 +1230,9 @@
  1.1321          /// Copy Constructor.
  1.1322          EdgeMap(const EdgeMap& nm) : Parent(nm) {}
  1.1323  
  1.1324 -        /// \brief Assign operator.
  1.1325 +        /// \brief Assignment operator.
  1.1326          ///
  1.1327 -        /// Assign operator.
  1.1328 +        /// Assignment operator.
  1.1329          template <typename CMap>
  1.1330          EdgeMap& operator=(const CMap&) {
  1.1331            checkConcept<ReadMap<Edge, V>, CMap>();
  1.1332 @@ -1245,7 +1252,7 @@
  1.1333          };
  1.1334  
  1.1335          void constraints() {
  1.1336 -          checkConcept<MappableGraphComponent<Base>, _Graph>();
  1.1337 +          checkConcept<MappableDigraphComponent<Base>, _Graph>();
  1.1338  
  1.1339            { // int map test
  1.1340              typedef typename _Graph::template EdgeMap<int> IntEdgeMap;
  1.1341 @@ -1262,16 +1269,16 @@
  1.1342            }
  1.1343          }
  1.1344  
  1.1345 -        _Graph& graph;
  1.1346 +        const _Graph& graph;
  1.1347        };
  1.1348      };
  1.1349  
  1.1350 -    /// \brief An empty extendable digraph class.
  1.1351 +    /// \brief Skeleton class for extendable directed graphs.
  1.1352      ///
  1.1353 -    /// This class provides beside the core digraph features digraph
  1.1354 -    /// extendable interface for the digraph structure.  The main
  1.1355 -    /// difference between the base and this interface is that the
  1.1356 -    /// digraph alterations should handled already on this level.
  1.1357 +    /// This class describes the interface of extendable directed graphs.
  1.1358 +    /// It extends \ref BaseDigraphComponent with functions for adding 
  1.1359 +    /// nodes and arcs to the digraph.
  1.1360 +    /// This concept requires \ref AlterableDigraphComponent.
  1.1361      template <typename BAS = BaseDigraphComponent>
  1.1362      class ExtendableDigraphComponent : public BAS {
  1.1363      public:
  1.1364 @@ -1280,17 +1287,17 @@
  1.1365        typedef typename Base::Node Node;
  1.1366        typedef typename Base::Arc Arc;
  1.1367  
  1.1368 -      /// \brief Adds a new node to the digraph.
  1.1369 +      /// \brief Add a new node to the digraph.
  1.1370        ///
  1.1371 -      /// Adds a new node to the digraph.
  1.1372 -      ///
  1.1373 +      /// This function adds a new node to the digraph.
  1.1374        Node addNode() {
  1.1375          return INVALID;
  1.1376        }
  1.1377  
  1.1378 -      /// \brief Adds a new arc connects the given two nodes.
  1.1379 +      /// \brief Add a new arc connecting the given two nodes.
  1.1380        ///
  1.1381 -      /// Adds a new arc connects the the given two nodes.
  1.1382 +      /// This function adds a new arc connecting the given two nodes
  1.1383 +      /// of the digraph.
  1.1384        Arc addArc(const Node&, const Node&) {
  1.1385          return INVALID;
  1.1386        }
  1.1387 @@ -1310,13 +1317,12 @@
  1.1388        };
  1.1389      };
  1.1390  
  1.1391 -    /// \brief An empty extendable base undirected graph class.
  1.1392 +    /// \brief Skeleton class for extendable undirected graphs.
  1.1393      ///
  1.1394 -    /// This class provides beside the core undirected graph features
  1.1395 -    /// core undircted graph extend interface for the graph structure.
  1.1396 -    /// The main difference between the base and this interface is
  1.1397 -    /// that the graph alterations should handled already on this
  1.1398 -    /// level.
  1.1399 +    /// This class describes the interface of extendable undirected graphs.
  1.1400 +    /// It extends \ref BaseGraphComponent with functions for adding 
  1.1401 +    /// nodes and edges to the graph.
  1.1402 +    /// This concept requires \ref AlterableGraphComponent.
  1.1403      template <typename BAS = BaseGraphComponent>
  1.1404      class ExtendableGraphComponent : public BAS {
  1.1405      public:
  1.1406 @@ -1325,18 +1331,18 @@
  1.1407        typedef typename Base::Node Node;
  1.1408        typedef typename Base::Edge Edge;
  1.1409  
  1.1410 -      /// \brief Adds a new node to the graph.
  1.1411 +      /// \brief Add a new node to the digraph.
  1.1412        ///
  1.1413 -      /// Adds a new node to the graph.
  1.1414 -      ///
  1.1415 +      /// This function adds a new node to the digraph.
  1.1416        Node addNode() {
  1.1417          return INVALID;
  1.1418        }
  1.1419  
  1.1420 -      /// \brief Adds a new arc connects the given two nodes.
  1.1421 +      /// \brief Add a new edge connecting the given two nodes.
  1.1422        ///
  1.1423 -      /// Adds a new arc connects the the given two nodes.
  1.1424 -      Edge addArc(const Node&, const Node&) {
  1.1425 +      /// This function adds a new edge connecting the given two nodes
  1.1426 +      /// of the graph.
  1.1427 +      Edge addEdge(const Node&, const Node&) {
  1.1428          return INVALID;
  1.1429        }
  1.1430  
  1.1431 @@ -1355,12 +1361,12 @@
  1.1432        };
  1.1433      };
  1.1434  
  1.1435 -    /// \brief An empty erasable digraph class.
  1.1436 +    /// \brief Skeleton class for erasable directed graphs.
  1.1437      ///
  1.1438 -    /// This class provides beside the core digraph features core erase
  1.1439 -    /// functions for the digraph structure. The main difference between
  1.1440 -    /// the base and this interface is that the digraph alterations
  1.1441 -    /// should handled already on this level.
  1.1442 +    /// This class describes the interface of erasable directed graphs.
  1.1443 +    /// It extends \ref BaseDigraphComponent with functions for removing 
  1.1444 +    /// nodes and arcs from the digraph.
  1.1445 +    /// This concept requires \ref AlterableDigraphComponent.
  1.1446      template <typename BAS = BaseDigraphComponent>
  1.1447      class ErasableDigraphComponent : public BAS {
  1.1448      public:
  1.1449 @@ -1371,23 +1377,22 @@
  1.1450  
  1.1451        /// \brief Erase a node from the digraph.
  1.1452        ///
  1.1453 -      /// Erase a node from the digraph. This function should
  1.1454 -      /// erase all arcs connecting to the node.
  1.1455 +      /// This function erases the given node from the digraph and all arcs 
  1.1456 +      /// connected to the node.
  1.1457        void erase(const Node&) {}
  1.1458  
  1.1459        /// \brief Erase an arc from the digraph.
  1.1460        ///
  1.1461 -      /// Erase an arc from the digraph.
  1.1462 -      ///
  1.1463 +      /// This function erases the given arc from the digraph.
  1.1464        void erase(const Arc&) {}
  1.1465  
  1.1466        template <typename _Digraph>
  1.1467        struct Constraints {
  1.1468          void constraints() {
  1.1469            checkConcept<Base, _Digraph>();
  1.1470 -          typename _Digraph::Node node;
  1.1471 +          const typename _Digraph::Node node(INVALID);
  1.1472            digraph.erase(node);
  1.1473 -          typename _Digraph::Arc arc;
  1.1474 +          const typename _Digraph::Arc arc(INVALID);
  1.1475            digraph.erase(arc);
  1.1476          }
  1.1477  
  1.1478 @@ -1395,12 +1400,12 @@
  1.1479        };
  1.1480      };
  1.1481  
  1.1482 -    /// \brief An empty erasable base undirected graph class.
  1.1483 +    /// \brief Skeleton class for erasable undirected graphs.
  1.1484      ///
  1.1485 -    /// This class provides beside the core undirected graph features
  1.1486 -    /// core erase functions for the undirceted graph structure. The
  1.1487 -    /// main difference between the base and this interface is that
  1.1488 -    /// the graph alterations should handled already on this level.
  1.1489 +    /// This class describes the interface of erasable undirected graphs.
  1.1490 +    /// It extends \ref BaseGraphComponent with functions for removing 
  1.1491 +    /// nodes and edges from the graph.
  1.1492 +    /// This concept requires \ref AlterableGraphComponent.
  1.1493      template <typename BAS = BaseGraphComponent>
  1.1494      class ErasableGraphComponent : public BAS {
  1.1495      public:
  1.1496 @@ -1411,23 +1416,22 @@
  1.1497  
  1.1498        /// \brief Erase a node from the graph.
  1.1499        ///
  1.1500 -      /// Erase a node from the graph. This function should erase
  1.1501 -      /// arcs connecting to the node.
  1.1502 +      /// This function erases the given node from the graph and all edges
  1.1503 +      /// connected to the node.
  1.1504        void erase(const Node&) {}
  1.1505  
  1.1506 -      /// \brief Erase an arc from the graph.
  1.1507 +      /// \brief Erase an edge from the digraph.
  1.1508        ///
  1.1509 -      /// Erase an arc from the graph.
  1.1510 -      ///
  1.1511 +      /// This function erases the given edge from the digraph.
  1.1512        void erase(const Edge&) {}
  1.1513  
  1.1514        template <typename _Graph>
  1.1515        struct Constraints {
  1.1516          void constraints() {
  1.1517            checkConcept<Base, _Graph>();
  1.1518 -          typename _Graph::Node node;
  1.1519 +          const typename _Graph::Node node(INVALID);
  1.1520            graph.erase(node);
  1.1521 -          typename _Graph::Edge edge;
  1.1522 +          const typename _Graph::Edge edge(INVALID);
  1.1523            graph.erase(edge);
  1.1524          }
  1.1525  
  1.1526 @@ -1435,12 +1439,12 @@
  1.1527        };
  1.1528      };
  1.1529  
  1.1530 -    /// \brief An empty clearable base digraph class.
  1.1531 +    /// \brief Skeleton class for clearable directed graphs.
  1.1532      ///
  1.1533 -    /// This class provides beside the core digraph features core clear
  1.1534 -    /// functions for the digraph structure. The main difference between
  1.1535 -    /// the base and this interface is that the digraph alterations
  1.1536 -    /// should handled already on this level.
  1.1537 +    /// This class describes the interface of clearable directed graphs.
  1.1538 +    /// It extends \ref BaseDigraphComponent with a function for clearing
  1.1539 +    /// the digraph.
  1.1540 +    /// This concept requires \ref AlterableDigraphComponent.
  1.1541      template <typename BAS = BaseDigraphComponent>
  1.1542      class ClearableDigraphComponent : public BAS {
  1.1543      public:
  1.1544 @@ -1449,8 +1453,7 @@
  1.1545  
  1.1546        /// \brief Erase all nodes and arcs from the digraph.
  1.1547        ///
  1.1548 -      /// Erase all nodes and arcs from the digraph.
  1.1549 -      ///
  1.1550 +      /// This function erases all nodes and arcs from the digraph.
  1.1551        void clear() {}
  1.1552  
  1.1553        template <typename _Digraph>
  1.1554 @@ -1460,29 +1463,35 @@
  1.1555            digraph.clear();
  1.1556          }
  1.1557  
  1.1558 -        _Digraph digraph;
  1.1559 +        _Digraph& digraph;
  1.1560        };
  1.1561      };
  1.1562  
  1.1563 -    /// \brief An empty clearable base undirected graph class.
  1.1564 +    /// \brief Skeleton class for clearable undirected graphs.
  1.1565      ///
  1.1566 -    /// This class provides beside the core undirected graph features
  1.1567 -    /// core clear functions for the undirected graph structure. The
  1.1568 -    /// main difference between the base and this interface is that
  1.1569 -    /// the graph alterations should handled already on this level.
  1.1570 +    /// This class describes the interface of clearable undirected graphs.
  1.1571 +    /// It extends \ref BaseGraphComponent with a function for clearing
  1.1572 +    /// the graph.
  1.1573 +    /// This concept requires \ref AlterableGraphComponent.
  1.1574      template <typename BAS = BaseGraphComponent>
  1.1575      class ClearableGraphComponent : public ClearableDigraphComponent<BAS> {
  1.1576      public:
  1.1577  
  1.1578        typedef BAS Base;
  1.1579  
  1.1580 +      /// \brief Erase all nodes and edges from the graph.
  1.1581 +      ///
  1.1582 +      /// This function erases all nodes and edges from the graph.
  1.1583 +      void clear() {}
  1.1584 +
  1.1585        template <typename _Graph>
  1.1586        struct Constraints {
  1.1587          void constraints() {
  1.1588 -          checkConcept<ClearableGraphComponent<Base>, _Graph>();
  1.1589 +          checkConcept<Base, _Graph>();
  1.1590 +          graph.clear();
  1.1591          }
  1.1592  
  1.1593 -        _Graph graph;
  1.1594 +        _Graph& graph;
  1.1595        };
  1.1596      };
  1.1597