lemon/concepts/digraph.h
changeset 784 1a7fe3bef514
parent 580 2313edd0db0b
child 786 e20173729589
     1.1 --- a/lemon/concepts/digraph.h	Fri Oct 16 10:21:37 2009 +0200
     1.2 +++ b/lemon/concepts/digraph.h	Thu Nov 05 15:50:01 2009 +0100
     1.3 @@ -2,7 +2,7 @@
     1.4   *
     1.5   * This file is a part of LEMON, a generic C++ optimization library.
     1.6   *
     1.7 - * Copyright (C) 2003-2008
     1.8 + * Copyright (C) 2003-2009
     1.9   * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    1.10   * (Egervary Research Group on Combinatorial Optimization, EGRES).
    1.11   *
    1.12 @@ -16,8 +16,8 @@
    1.13   *
    1.14   */
    1.15  
    1.16 -#ifndef LEMON_CONCEPT_DIGRAPH_H
    1.17 -#define LEMON_CONCEPT_DIGRAPH_H
    1.18 +#ifndef LEMON_CONCEPTS_DIGRAPH_H
    1.19 +#define LEMON_CONCEPTS_DIGRAPH_H
    1.20  
    1.21  ///\ingroup graph_concepts
    1.22  ///\file
    1.23 @@ -35,46 +35,40 @@
    1.24      ///
    1.25      /// \brief Class describing the concept of directed graphs.
    1.26      ///
    1.27 -    /// This class describes the \ref concept "concept" of the
    1.28 -    /// immutable directed digraphs.
    1.29 +    /// This class describes the common interface of all directed
    1.30 +    /// graphs (digraphs).
    1.31      ///
    1.32 -    /// Note that actual digraph implementation like @ref ListDigraph or
    1.33 -    /// @ref SmartDigraph may have several additional functionality.
    1.34 +    /// Like all concept classes, it only provides an interface
    1.35 +    /// without any sensible implementation. So any general algorithm for
    1.36 +    /// directed graphs should compile with this class, but it will not
    1.37 +    /// run properly, of course.
    1.38 +    /// An actual digraph implementation like \ref ListDigraph or
    1.39 +    /// \ref SmartDigraph may have additional functionality.
    1.40      ///
    1.41 -    /// \sa concept
    1.42 +    /// \sa Graph
    1.43      class Digraph {
    1.44      private:
    1.45 -      ///Digraphs are \e not copy constructible. Use DigraphCopy() instead.
    1.46 +      /// Diraphs are \e not copy constructible. Use DigraphCopy instead.
    1.47 +      Digraph(const Digraph &) {}
    1.48 +      /// \brief Assignment of a digraph to another one is \e not allowed.
    1.49 +      /// Use DigraphCopy instead.
    1.50 +      void operator=(const Digraph &) {}
    1.51  
    1.52 -      ///Digraphs are \e not copy constructible. Use DigraphCopy() instead.
    1.53 -      ///
    1.54 -      Digraph(const Digraph &) {};
    1.55 -      ///\brief Assignment of \ref Digraph "Digraph"s to another ones are
    1.56 -      ///\e not allowed. Use DigraphCopy() instead.
    1.57 +    public:
    1.58 +      /// Default constructor.
    1.59 +      Digraph() { }
    1.60  
    1.61 -      ///Assignment of \ref Digraph "Digraph"s to another ones are
    1.62 -      ///\e not allowed.  Use DigraphCopy() instead.
    1.63 -
    1.64 -      void operator=(const Digraph &) {}
    1.65 -    public:
    1.66 -      ///\e
    1.67 -
    1.68 -      /// Defalult constructor.
    1.69 -
    1.70 -      /// Defalult constructor.
    1.71 -      ///
    1.72 -      Digraph() { }
    1.73 -      /// Class for identifying a node of the digraph
    1.74 +      /// The node type of the digraph
    1.75  
    1.76        /// This class identifies a node of the digraph. It also serves
    1.77        /// as a base class of the node iterators,
    1.78 -      /// thus they will convert to this type.
    1.79 +      /// thus they convert to this type.
    1.80        class Node {
    1.81        public:
    1.82          /// Default constructor
    1.83  
    1.84 -        /// @warning The default constructor sets the iterator
    1.85 -        /// to an undefined value.
    1.86 +        /// Default constructor.
    1.87 +        /// \warning It sets the object to an undefined value.
    1.88          Node() { }
    1.89          /// Copy constructor.
    1.90  
    1.91 @@ -82,40 +76,39 @@
    1.92          ///
    1.93          Node(const Node&) { }
    1.94  
    1.95 -        /// Invalid constructor \& conversion.
    1.96 +        /// %Invalid constructor \& conversion.
    1.97  
    1.98 -        /// This constructor initializes the iterator to be invalid.
    1.99 +        /// Initializes the object to be invalid.
   1.100          /// \sa Invalid for more details.
   1.101          Node(Invalid) { }
   1.102          /// Equality operator
   1.103  
   1.104 +        /// Equality operator.
   1.105 +        ///
   1.106          /// Two iterators are equal if and only if they point to the
   1.107 -        /// same object or both are invalid.
   1.108 +        /// same object or both are \c INVALID.
   1.109          bool operator==(Node) const { return true; }
   1.110  
   1.111          /// Inequality operator
   1.112  
   1.113 -        /// \sa operator==(Node n)
   1.114 -        ///
   1.115 +        /// Inequality operator.
   1.116          bool operator!=(Node) const { return true; }
   1.117  
   1.118          /// Artificial ordering operator.
   1.119  
   1.120 -        /// To allow the use of digraph descriptors as key type in std::map or
   1.121 -        /// similar associative container we require this.
   1.122 +        /// Artificial ordering operator.
   1.123          ///
   1.124 -        /// \note This operator only have to define some strict ordering of
   1.125 -        /// the items; this order has nothing to do with the iteration
   1.126 -        /// ordering of the items.
   1.127 +        /// \note This operator only has to define some strict ordering of
   1.128 +        /// the nodes; this order has nothing to do with the iteration
   1.129 +        /// ordering of the nodes.
   1.130          bool operator<(Node) const { return false; }
   1.131 -
   1.132        };
   1.133  
   1.134 -      /// This iterator goes through each node.
   1.135 +      /// Iterator class for the nodes.
   1.136  
   1.137 -      /// This iterator goes through each node.
   1.138 +      /// This iterator goes through each node of the digraph.
   1.139        /// Its usage is quite simple, for example you can count the number
   1.140 -      /// of nodes in digraph \c g of type \c Digraph like this:
   1.141 +      /// of nodes in a digraph \c g of type \c %Digraph like this:
   1.142        ///\code
   1.143        /// int count=0;
   1.144        /// for (Digraph::NodeIt n(g); n!=INVALID; ++n) ++count;
   1.145 @@ -124,30 +117,28 @@
   1.146        public:
   1.147          /// Default constructor
   1.148  
   1.149 -        /// @warning The default constructor sets the iterator
   1.150 -        /// to an undefined value.
   1.151 +        /// Default constructor.
   1.152 +        /// \warning It sets the iterator to an undefined value.
   1.153          NodeIt() { }
   1.154          /// Copy constructor.
   1.155  
   1.156          /// Copy constructor.
   1.157          ///
   1.158          NodeIt(const NodeIt& n) : Node(n) { }
   1.159 -        /// Invalid constructor \& conversion.
   1.160 +        /// %Invalid constructor \& conversion.
   1.161  
   1.162 -        /// Initialize the iterator to be invalid.
   1.163 +        /// Initializes the iterator to be invalid.
   1.164          /// \sa Invalid for more details.
   1.165          NodeIt(Invalid) { }
   1.166          /// Sets the iterator to the first node.
   1.167  
   1.168 -        /// Sets the iterator to the first node of \c g.
   1.169 +        /// Sets the iterator to the first node of the given digraph.
   1.170          ///
   1.171 -        NodeIt(const Digraph&) { }
   1.172 -        /// Node -> NodeIt conversion.
   1.173 +        explicit NodeIt(const Digraph&) { }
   1.174 +        /// Sets the iterator to the given node.
   1.175  
   1.176 -        /// Sets the iterator to the node of \c the digraph pointed by
   1.177 -        /// the trivial iterator.
   1.178 -        /// This feature necessitates that each time we
   1.179 -        /// iterate the arc-set, the iteration order is the same.
   1.180 +        /// Sets the iterator to the given node of the given digraph.
   1.181 +        ///
   1.182          NodeIt(const Digraph&, const Node&) { }
   1.183          /// Next node.
   1.184  
   1.185 @@ -157,7 +148,7 @@
   1.186        };
   1.187  
   1.188  
   1.189 -      /// Class for identifying an arc of the digraph
   1.190 +      /// The arc type of the digraph
   1.191  
   1.192        /// This class identifies an arc of the digraph. It also serves
   1.193        /// as a base class of the arc iterators,
   1.194 @@ -166,207 +157,214 @@
   1.195        public:
   1.196          /// Default constructor
   1.197  
   1.198 -        /// @warning The default constructor sets the iterator
   1.199 -        /// to an undefined value.
   1.200 +        /// Default constructor.
   1.201 +        /// \warning It sets the object to an undefined value.
   1.202          Arc() { }
   1.203          /// Copy constructor.
   1.204  
   1.205          /// Copy constructor.
   1.206          ///
   1.207          Arc(const Arc&) { }
   1.208 -        /// Initialize the iterator to be invalid.
   1.209 +        /// %Invalid constructor \& conversion.
   1.210  
   1.211 -        /// Initialize the iterator to be invalid.
   1.212 -        ///
   1.213 +        /// Initializes the object to be invalid.
   1.214 +        /// \sa Invalid for more details.
   1.215          Arc(Invalid) { }
   1.216          /// Equality operator
   1.217  
   1.218 +        /// Equality operator.
   1.219 +        ///
   1.220          /// Two iterators are equal if and only if they point to the
   1.221 -        /// same object or both are invalid.
   1.222 +        /// same object or both are \c INVALID.
   1.223          bool operator==(Arc) const { return true; }
   1.224          /// Inequality operator
   1.225  
   1.226 -        /// \sa operator==(Arc n)
   1.227 -        ///
   1.228 +        /// Inequality operator.
   1.229          bool operator!=(Arc) const { return true; }
   1.230  
   1.231          /// Artificial ordering operator.
   1.232  
   1.233 -        /// To allow the use of digraph descriptors as key type in std::map or
   1.234 -        /// similar associative container we require this.
   1.235 +        /// Artificial ordering operator.
   1.236          ///
   1.237 -        /// \note This operator only have to define some strict ordering of
   1.238 -        /// the items; this order has nothing to do with the iteration
   1.239 -        /// ordering of the items.
   1.240 +        /// \note This operator only has to define some strict ordering of
   1.241 +        /// the arcs; this order has nothing to do with the iteration
   1.242 +        /// ordering of the arcs.
   1.243          bool operator<(Arc) const { return false; }
   1.244        };
   1.245  
   1.246 -      /// This iterator goes trough the outgoing arcs of a node.
   1.247 +      /// Iterator class for the outgoing arcs of a node.
   1.248  
   1.249        /// This iterator goes trough the \e outgoing arcs of a certain node
   1.250        /// of a digraph.
   1.251        /// Its usage is quite simple, for example you can count the number
   1.252        /// of outgoing arcs of a node \c n
   1.253 -      /// in digraph \c g of type \c Digraph as follows.
   1.254 +      /// in a digraph \c g of type \c %Digraph as follows.
   1.255        ///\code
   1.256        /// int count=0;
   1.257 -      /// for (Digraph::OutArcIt e(g, n); e!=INVALID; ++e) ++count;
   1.258 +      /// for (Digraph::OutArcIt a(g, n); a!=INVALID; ++a) ++count;
   1.259        ///\endcode
   1.260 -
   1.261        class OutArcIt : public Arc {
   1.262        public:
   1.263          /// Default constructor
   1.264  
   1.265 -        /// @warning The default constructor sets the iterator
   1.266 -        /// to an undefined value.
   1.267 +        /// Default constructor.
   1.268 +        /// \warning It sets the iterator to an undefined value.
   1.269          OutArcIt() { }
   1.270          /// Copy constructor.
   1.271  
   1.272          /// Copy constructor.
   1.273          ///
   1.274          OutArcIt(const OutArcIt& e) : Arc(e) { }
   1.275 -        /// Initialize the iterator to be invalid.
   1.276 +        /// %Invalid constructor \& conversion.
   1.277  
   1.278 -        /// Initialize the iterator to be invalid.
   1.279 +        /// Initializes the iterator to be invalid.
   1.280 +        /// \sa Invalid for more details.
   1.281 +        OutArcIt(Invalid) { }
   1.282 +        /// Sets the iterator to the first outgoing arc.
   1.283 +
   1.284 +        /// Sets the iterator to the first outgoing arc of the given node.
   1.285          ///
   1.286 -        OutArcIt(Invalid) { }
   1.287 -        /// This constructor sets the iterator to the first outgoing arc.
   1.288 +        OutArcIt(const Digraph&, const Node&) { }
   1.289 +        /// Sets the iterator to the given arc.
   1.290  
   1.291 -        /// This constructor sets the iterator to the first outgoing arc of
   1.292 -        /// the node.
   1.293 -        OutArcIt(const Digraph&, const Node&) { }
   1.294 -        /// Arc -> OutArcIt conversion
   1.295 -
   1.296 -        /// Sets the iterator to the value of the trivial iterator.
   1.297 -        /// This feature necessitates that each time we
   1.298 -        /// iterate the arc-set, the iteration order is the same.
   1.299 +        /// Sets the iterator to the given arc of the given digraph.
   1.300 +        ///
   1.301          OutArcIt(const Digraph&, const Arc&) { }
   1.302 -        ///Next outgoing arc
   1.303 +        /// Next outgoing arc
   1.304  
   1.305          /// Assign the iterator to the next
   1.306          /// outgoing arc of the corresponding node.
   1.307          OutArcIt& operator++() { return *this; }
   1.308        };
   1.309  
   1.310 -      /// This iterator goes trough the incoming arcs of a node.
   1.311 +      /// Iterator class for the incoming arcs of a node.
   1.312  
   1.313        /// This iterator goes trough the \e incoming arcs of a certain node
   1.314        /// of a digraph.
   1.315        /// Its usage is quite simple, for example you can count the number
   1.316 -      /// of outgoing arcs of a node \c n
   1.317 -      /// in digraph \c g of type \c Digraph as follows.
   1.318 +      /// of incoming arcs of a node \c n
   1.319 +      /// in a digraph \c g of type \c %Digraph as follows.
   1.320        ///\code
   1.321        /// int count=0;
   1.322 -      /// for(Digraph::InArcIt e(g, n); e!=INVALID; ++e) ++count;
   1.323 +      /// for(Digraph::InArcIt a(g, n); a!=INVALID; ++a) ++count;
   1.324        ///\endcode
   1.325 -
   1.326        class InArcIt : public Arc {
   1.327        public:
   1.328          /// Default constructor
   1.329  
   1.330 -        /// @warning The default constructor sets the iterator
   1.331 -        /// to an undefined value.
   1.332 +        /// Default constructor.
   1.333 +        /// \warning It sets the iterator to an undefined value.
   1.334          InArcIt() { }
   1.335          /// Copy constructor.
   1.336  
   1.337          /// Copy constructor.
   1.338          ///
   1.339          InArcIt(const InArcIt& e) : Arc(e) { }
   1.340 -        /// Initialize the iterator to be invalid.
   1.341 +        /// %Invalid constructor \& conversion.
   1.342  
   1.343 -        /// Initialize the iterator to be invalid.
   1.344 +        /// Initializes the iterator to be invalid.
   1.345 +        /// \sa Invalid for more details.
   1.346 +        InArcIt(Invalid) { }
   1.347 +        /// Sets the iterator to the first incoming arc.
   1.348 +
   1.349 +        /// Sets the iterator to the first incoming arc of the given node.
   1.350          ///
   1.351 -        InArcIt(Invalid) { }
   1.352 -        /// This constructor sets the iterator to first incoming arc.
   1.353 +        InArcIt(const Digraph&, const Node&) { }
   1.354 +        /// Sets the iterator to the given arc.
   1.355  
   1.356 -        /// This constructor set the iterator to the first incoming arc of
   1.357 -        /// the node.
   1.358 -        InArcIt(const Digraph&, const Node&) { }
   1.359 -        /// Arc -> InArcIt conversion
   1.360 -
   1.361 -        /// Sets the iterator to the value of the trivial iterator \c e.
   1.362 -        /// This feature necessitates that each time we
   1.363 -        /// iterate the arc-set, the iteration order is the same.
   1.364 +        /// Sets the iterator to the given arc of the given digraph.
   1.365 +        ///
   1.366          InArcIt(const Digraph&, const Arc&) { }
   1.367          /// Next incoming arc
   1.368  
   1.369 -        /// Assign the iterator to the next inarc of the corresponding node.
   1.370 -        ///
   1.371 +        /// Assign the iterator to the next
   1.372 +        /// incoming arc of the corresponding node.
   1.373          InArcIt& operator++() { return *this; }
   1.374        };
   1.375 -      /// This iterator goes through each arc.
   1.376  
   1.377 -      /// This iterator goes through each arc of a digraph.
   1.378 +      /// Iterator class for the arcs.
   1.379 +
   1.380 +      /// This iterator goes through each arc of the digraph.
   1.381        /// Its usage is quite simple, for example you can count the number
   1.382 -      /// of arcs in a digraph \c g of type \c Digraph as follows:
   1.383 +      /// of arcs in a digraph \c g of type \c %Digraph as follows:
   1.384        ///\code
   1.385        /// int count=0;
   1.386 -      /// for(Digraph::ArcIt e(g); e!=INVALID; ++e) ++count;
   1.387 +      /// for(Digraph::ArcIt a(g); a!=INVALID; ++a) ++count;
   1.388        ///\endcode
   1.389        class ArcIt : public Arc {
   1.390        public:
   1.391          /// Default constructor
   1.392  
   1.393 -        /// @warning The default constructor sets the iterator
   1.394 -        /// to an undefined value.
   1.395 +        /// Default constructor.
   1.396 +        /// \warning It sets the iterator to an undefined value.
   1.397          ArcIt() { }
   1.398          /// Copy constructor.
   1.399  
   1.400          /// Copy constructor.
   1.401          ///
   1.402          ArcIt(const ArcIt& e) : Arc(e) { }
   1.403 -        /// Initialize the iterator to be invalid.
   1.404 +        /// %Invalid constructor \& conversion.
   1.405  
   1.406 -        /// Initialize the iterator to be invalid.
   1.407 +        /// Initializes the iterator to be invalid.
   1.408 +        /// \sa Invalid for more details.
   1.409 +        ArcIt(Invalid) { }
   1.410 +        /// Sets the iterator to the first arc.
   1.411 +
   1.412 +        /// Sets the iterator to the first arc of the given digraph.
   1.413          ///
   1.414 -        ArcIt(Invalid) { }
   1.415 -        /// This constructor sets the iterator to the first arc.
   1.416 +        explicit ArcIt(const Digraph& g) { ignore_unused_variable_warning(g); }
   1.417 +        /// Sets the iterator to the given arc.
   1.418  
   1.419 -        /// This constructor sets the iterator to the first arc of \c g.
   1.420 -        ///@param g the digraph
   1.421 -        ArcIt(const Digraph& g) { ignore_unused_variable_warning(g); }
   1.422 -        /// Arc -> ArcIt conversion
   1.423 -
   1.424 -        /// Sets the iterator to the value of the trivial iterator \c e.
   1.425 -        /// This feature necessitates that each time we
   1.426 -        /// iterate the arc-set, the iteration order is the same.
   1.427 +        /// Sets the iterator to the given arc of the given digraph.
   1.428 +        ///
   1.429          ArcIt(const Digraph&, const Arc&) { }
   1.430 -        ///Next arc
   1.431 +        /// Next arc
   1.432  
   1.433          /// Assign the iterator to the next arc.
   1.434 +        ///
   1.435          ArcIt& operator++() { return *this; }
   1.436        };
   1.437 -      ///Gives back the target node of an arc.
   1.438  
   1.439 -      ///Gives back the target node of an arc.
   1.440 +      /// \brief The source node of the arc.
   1.441        ///
   1.442 -      Node target(Arc) const { return INVALID; }
   1.443 -      ///Gives back the source node of an arc.
   1.444 -
   1.445 -      ///Gives back the source node of an arc.
   1.446 -      ///
   1.447 +      /// Returns the source node of the given arc.
   1.448        Node source(Arc) const { return INVALID; }
   1.449  
   1.450 -      /// \brief Returns the ID of the node.
   1.451 +      /// \brief The target node of the arc.
   1.452 +      ///
   1.453 +      /// Returns the target node of the given arc.
   1.454 +      Node target(Arc) const { return INVALID; }
   1.455 +
   1.456 +      /// \brief The ID of the node.
   1.457 +      ///
   1.458 +      /// Returns the ID of the given node.
   1.459        int id(Node) const { return -1; }
   1.460  
   1.461 -      /// \brief Returns the ID of the arc.
   1.462 +      /// \brief The ID of the arc.
   1.463 +      ///
   1.464 +      /// Returns the ID of the given arc.
   1.465        int id(Arc) const { return -1; }
   1.466  
   1.467 -      /// \brief Returns the node with the given ID.
   1.468 +      /// \brief The node with the given ID.
   1.469        ///
   1.470 -      /// \pre The argument should be a valid node ID in the graph.
   1.471 +      /// Returns the node with the given ID.
   1.472 +      /// \pre The argument should be a valid node ID in the digraph.
   1.473        Node nodeFromId(int) const { return INVALID; }
   1.474  
   1.475 -      /// \brief Returns the arc with the given ID.
   1.476 +      /// \brief The arc with the given ID.
   1.477        ///
   1.478 -      /// \pre The argument should be a valid arc ID in the graph.
   1.479 +      /// Returns the arc with the given ID.
   1.480 +      /// \pre The argument should be a valid arc ID in the digraph.
   1.481        Arc arcFromId(int) const { return INVALID; }
   1.482  
   1.483 -      /// \brief Returns an upper bound on the node IDs.
   1.484 +      /// \brief An upper bound on the node IDs.
   1.485 +      ///
   1.486 +      /// Returns an upper bound on the node IDs.
   1.487        int maxNodeId() const { return -1; }
   1.488  
   1.489 -      /// \brief Returns an upper bound on the arc IDs.
   1.490 +      /// \brief An upper bound on the arc IDs.
   1.491 +      ///
   1.492 +      /// Returns an upper bound on the arc IDs.
   1.493        int maxArcId() const { return -1; }
   1.494  
   1.495        void first(Node&) const {}
   1.496 @@ -392,51 +390,52 @@
   1.497        // Dummy parameter.
   1.498        int maxId(Arc) const { return -1; }
   1.499  
   1.500 +      /// \brief The opposite node on the arc.
   1.501 +      ///
   1.502 +      /// Returns the opposite node on the given arc.
   1.503 +      Node oppositeNode(Node, Arc) const { return INVALID; }
   1.504 +
   1.505        /// \brief The base node of the iterator.
   1.506        ///
   1.507 -      /// Gives back the base node of the iterator.
   1.508 -      /// It is always the target of the pointed arc.
   1.509 -      Node baseNode(const InArcIt&) const { return INVALID; }
   1.510 +      /// Returns the base node of the given outgoing arc iterator
   1.511 +      /// (i.e. the source node of the corresponding arc).
   1.512 +      Node baseNode(OutArcIt) const { return INVALID; }
   1.513  
   1.514        /// \brief The running node of the iterator.
   1.515        ///
   1.516 -      /// Gives back the running node of the iterator.
   1.517 -      /// It is always the source of the pointed arc.
   1.518 -      Node runningNode(const InArcIt&) const { return INVALID; }
   1.519 +      /// Returns the running node of the given outgoing arc iterator
   1.520 +      /// (i.e. the target node of the corresponding arc).
   1.521 +      Node runningNode(OutArcIt) const { return INVALID; }
   1.522  
   1.523        /// \brief The base node of the iterator.
   1.524        ///
   1.525 -      /// Gives back the base node of the iterator.
   1.526 -      /// It is always the source of the pointed arc.
   1.527 -      Node baseNode(const OutArcIt&) const { return INVALID; }
   1.528 +      /// Returns the base node of the given incomming arc iterator
   1.529 +      /// (i.e. the target node of the corresponding arc).
   1.530 +      Node baseNode(InArcIt) const { return INVALID; }
   1.531  
   1.532        /// \brief The running node of the iterator.
   1.533        ///
   1.534 -      /// Gives back the running node of the iterator.
   1.535 -      /// It is always the target of the pointed arc.
   1.536 -      Node runningNode(const OutArcIt&) const { return INVALID; }
   1.537 +      /// Returns the running node of the given incomming arc iterator
   1.538 +      /// (i.e. the source node of the corresponding arc).
   1.539 +      Node runningNode(InArcIt) const { return INVALID; }
   1.540  
   1.541 -      /// \brief The opposite node on the given arc.
   1.542 +      /// \brief Standard graph map type for the nodes.
   1.543        ///
   1.544 -      /// Gives back the opposite node on the given arc.
   1.545 -      Node oppositeNode(const Node&, const Arc&) const { return INVALID; }
   1.546 -
   1.547 -      /// \brief Read write map of the nodes to type \c T.
   1.548 -      ///
   1.549 -      /// ReadWrite map of the nodes to type \c T.
   1.550 -      /// \sa Reference
   1.551 +      /// Standard graph map type for the nodes.
   1.552 +      /// It conforms to the ReferenceMap concept.
   1.553        template<class T>
   1.554 -      class NodeMap : public ReadWriteMap< Node, T > {
   1.555 +      class NodeMap : public ReferenceMap<Node, T, T&, const T&> {
   1.556        public:
   1.557  
   1.558 -        ///\e
   1.559 -        NodeMap(const Digraph&) { }
   1.560 -        ///\e
   1.561 +        /// Constructor
   1.562 +        explicit NodeMap(const Digraph&) { }
   1.563 +        /// Constructor with given initial value
   1.564          NodeMap(const Digraph&, T) { }
   1.565  
   1.566        private:
   1.567          ///Copy constructor
   1.568 -        NodeMap(const NodeMap& nm) : ReadWriteMap< Node, T >(nm) { }
   1.569 +        NodeMap(const NodeMap& nm) : 
   1.570 +          ReferenceMap<Node, T, T&, const T&>(nm) { }
   1.571          ///Assignment operator
   1.572          template <typename CMap>
   1.573          NodeMap& operator=(const CMap&) {
   1.574 @@ -445,21 +444,23 @@
   1.575          }
   1.576        };
   1.577  
   1.578 -      /// \brief Read write map of the arcs to type \c T.
   1.579 +      /// \brief Standard graph map type for the arcs.
   1.580        ///
   1.581 -      /// Reference map of the arcs to type \c T.
   1.582 -      /// \sa Reference
   1.583 +      /// Standard graph map type for the arcs.
   1.584 +      /// It conforms to the ReferenceMap concept.
   1.585        template<class T>
   1.586 -      class ArcMap : public ReadWriteMap<Arc,T> {
   1.587 +      class ArcMap : public ReferenceMap<Arc, T, T&, const T&> {
   1.588        public:
   1.589  
   1.590 -        ///\e
   1.591 -        ArcMap(const Digraph&) { }
   1.592 -        ///\e
   1.593 +        /// Constructor
   1.594 +        explicit ArcMap(const Digraph&) { }
   1.595 +        /// Constructor with given initial value
   1.596          ArcMap(const Digraph&, T) { }
   1.597 +
   1.598        private:
   1.599          ///Copy constructor
   1.600 -        ArcMap(const ArcMap& em) : ReadWriteMap<Arc,T>(em) { }
   1.601 +        ArcMap(const ArcMap& em) :
   1.602 +          ReferenceMap<Arc, T, T&, const T&>(em) { }
   1.603          ///Assignment operator
   1.604          template <typename CMap>
   1.605          ArcMap& operator=(const CMap&) {
   1.606 @@ -471,6 +472,7 @@
   1.607        template <typename _Digraph>
   1.608        struct Constraints {
   1.609          void constraints() {
   1.610 +          checkConcept<BaseDigraphComponent, _Digraph>();
   1.611            checkConcept<IterableDigraphComponent<>, _Digraph>();
   1.612            checkConcept<IDableDigraphComponent<>, _Digraph>();
   1.613            checkConcept<MappableDigraphComponent<>, _Digraph>();
   1.614 @@ -484,4 +486,4 @@
   1.615  
   1.616  
   1.617  
   1.618 -#endif // LEMON_CONCEPT_DIGRAPH_H
   1.619 +#endif