lemon/concepts/graph.h
author Alpar Juttner <alpar@cs.elte.hu>
Tue, 28 Jul 2020 21:23:36 +0200
changeset 1432 da87dbdf3daf
parent 1336 0759d974de81
permissions -rw-r--r--
Resolve deprecation warnings of gcc 9 (#633)
alpar@209
     1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
deba@57
     2
 *
alpar@209
     3
 * This file is a part of LEMON, a generic C++ optimization library.
deba@57
     4
 *
alpar@1270
     5
 * Copyright (C) 2003-2013
deba@57
     6
 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
deba@57
     7
 * (Egervary Research Group on Combinatorial Optimization, EGRES).
deba@57
     8
 *
deba@57
     9
 * Permission to use, modify and distribute this software is granted
deba@57
    10
 * provided that this copyright notice appears in all copies. For
deba@57
    11
 * precise terms see the accompanying LICENSE file.
deba@57
    12
 *
deba@57
    13
 * This software is provided "AS IS" with no warranty of any kind,
deba@57
    14
 * express or implied, and with no claim as to its suitability for any
deba@57
    15
 * purpose.
deba@57
    16
 *
deba@57
    17
 */
deba@57
    18
deba@57
    19
///\ingroup graph_concepts
deba@57
    20
///\file
kpeter@781
    21
///\brief The concept of undirected graphs.
deba@57
    22
deba@576
    23
#ifndef LEMON_CONCEPTS_GRAPH_H
deba@576
    24
#define LEMON_CONCEPTS_GRAPH_H
deba@57
    25
deba@57
    26
#include <lemon/concepts/graph_components.h>
kpeter@781
    27
#include <lemon/concepts/maps.h>
kpeter@781
    28
#include <lemon/concept_check.h>
deba@220
    29
#include <lemon/core.h>
ggab90@1336
    30
#include <lemon/bits/stl_iterators.h>
deba@57
    31
deba@57
    32
namespace lemon {
deba@57
    33
  namespace concepts {
deba@57
    34
deba@57
    35
    /// \ingroup graph_concepts
deba@57
    36
    ///
kpeter@781
    37
    /// \brief Class describing the concept of undirected graphs.
deba@57
    38
    ///
kpeter@781
    39
    /// This class describes the common interface of all undirected
kpeter@781
    40
    /// graphs.
deba@57
    41
    ///
kpeter@781
    42
    /// Like all concept classes, it only provides an interface
kpeter@781
    43
    /// without any sensible implementation. So any general algorithm for
kpeter@781
    44
    /// undirected graphs should compile with this class, but it will not
deba@57
    45
    /// run properly, of course.
kpeter@781
    46
    /// An actual graph implementation like \ref ListGraph or
alpar@956
    47
    /// \ref SmartGraph may have additional functionality.
deba@57
    48
    ///
kpeter@781
    49
    /// The undirected graphs also fulfill the concept of \ref Digraph
kpeter@781
    50
    /// "directed graphs", since each edge can also be regarded as two
kpeter@781
    51
    /// oppositely directed arcs.
kpeter@781
    52
    /// Undirected graphs provide an Edge type for the undirected edges and
kpeter@781
    53
    /// an Arc type for the directed arcs. The Arc type is convertible to
kpeter@781
    54
    /// Edge or inherited from it, i.e. the corresponding edge can be
kpeter@781
    55
    /// obtained from an arc.
kpeter@781
    56
    /// EdgeIt and EdgeMap classes can be used for the edges, while ArcIt
kpeter@781
    57
    /// and ArcMap classes can be used for the arcs (just like in digraphs).
kpeter@781
    58
    /// Both InArcIt and OutArcIt iterates on the same edges but with
kpeter@781
    59
    /// opposite direction. IncEdgeIt also iterates on the same edges
kpeter@781
    60
    /// as OutArcIt and InArcIt, but it is not convertible to Arc,
kpeter@781
    61
    /// only to Edge.
deba@57
    62
    ///
kpeter@781
    63
    /// In LEMON, each undirected edge has an inherent orientation.
kpeter@781
    64
    /// Thus it can defined if an arc is forward or backward oriented in
kpeter@781
    65
    /// an undirected graph with respect to this default oriantation of
kpeter@781
    66
    /// the represented edge.
kpeter@781
    67
    /// With the direction() and direct() functions the direction
kpeter@781
    68
    /// of an arc can be obtained and set, respectively.
deba@57
    69
    ///
kpeter@781
    70
    /// Only nodes and edges can be added to or removed from an undirected
kpeter@781
    71
    /// graph and the corresponding arcs are added or removed automatically.
kpeter@781
    72
    ///
kpeter@781
    73
    /// \sa Digraph
deba@57
    74
    class Graph {
kpeter@781
    75
    private:
deba@1186
    76
      /// Graphs are \e not copy constructible. Use GraphCopy instead.
kpeter@781
    77
      Graph(const Graph&) {}
kpeter@781
    78
      /// \brief Assignment of a graph to another one is \e not allowed.
deba@1186
    79
      /// Use GraphCopy instead.
kpeter@781
    80
      void operator=(const Graph&) {}
kpeter@781
    81
deba@57
    82
    public:
kpeter@781
    83
      /// Default constructor.
kpeter@781
    84
      Graph() {}
kpeter@781
    85
kpeter@781
    86
      /// \brief Undirected graphs should be tagged with \c UndirectedTag.
deba@57
    87
      ///
kpeter@781
    88
      /// Undirected graphs should be tagged with \c UndirectedTag.
alpar@956
    89
      ///
kpeter@781
    90
      /// This tag helps the \c enable_if technics to make compile time
alpar@209
    91
      /// specializations for undirected graphs.
deba@57
    92
      typedef True UndirectedTag;
deba@57
    93
kpeter@781
    94
      /// The node type of the graph
kpeter@781
    95
kpeter@781
    96
      /// This class identifies a node of the graph. It also serves
kpeter@781
    97
      /// as a base class of the node iterators,
kpeter@781
    98
      /// thus they convert to this type.
deba@57
    99
      class Node {
deba@57
   100
      public:
deba@57
   101
        /// Default constructor
deba@57
   102
kpeter@781
   103
        /// Default constructor.
kpeter@781
   104
        /// \warning It sets the object to an undefined value.
deba@57
   105
        Node() { }
deba@57
   106
        /// Copy constructor.
deba@57
   107
deba@57
   108
        /// Copy constructor.
deba@57
   109
        ///
deba@57
   110
        Node(const Node&) { }
alpar@1432
   111
        /// Assignment operator
alpar@1432
   112
alpar@1432
   113
        /// Assignment operator.
alpar@1432
   114
        ///
alpar@1432
   115
        const Node &operator=(const Node&) { return *this; }
deba@57
   116
kpeter@781
   117
        /// %Invalid constructor \& conversion.
deba@57
   118
kpeter@781
   119
        /// Initializes the object to be invalid.
deba@57
   120
        /// \sa Invalid for more details.
deba@57
   121
        Node(Invalid) { }
deba@57
   122
        /// Equality operator
deba@57
   123
kpeter@781
   124
        /// Equality operator.
kpeter@781
   125
        ///
deba@57
   126
        /// Two iterators are equal if and only if they point to the
kpeter@781
   127
        /// same object or both are \c INVALID.
deba@57
   128
        bool operator==(Node) const { return true; }
deba@57
   129
deba@57
   130
        /// Inequality operator
alpar@209
   131
kpeter@781
   132
        /// Inequality operator.
deba@57
   133
        bool operator!=(Node) const { return true; }
deba@57
   134
alpar@209
   135
        /// Artificial ordering operator.
alpar@209
   136
kpeter@781
   137
        /// Artificial ordering operator.
alpar@209
   138
        ///
kpeter@781
   139
        /// \note This operator only has to define some strict ordering of
alpar@209
   140
        /// the items; this order has nothing to do with the iteration
alpar@209
   141
        /// ordering of the items.
alpar@209
   142
        bool operator<(Node) const { return false; }
deba@57
   143
deba@57
   144
      };
alpar@209
   145
kpeter@781
   146
      /// Iterator class for the nodes.
deba@57
   147
kpeter@781
   148
      /// This iterator goes through each node of the graph.
kpeter@833
   149
      /// Its usage is quite simple, for example, you can count the number
kpeter@781
   150
      /// of nodes in a graph \c g of type \c %Graph like this:
deba@57
   151
      ///\code
deba@57
   152
      /// int count=0;
deba@57
   153
      /// for (Graph::NodeIt n(g); n!=INVALID; ++n) ++count;
deba@57
   154
      ///\endcode
deba@57
   155
      class NodeIt : public Node {
deba@57
   156
      public:
deba@57
   157
        /// Default constructor
deba@57
   158
kpeter@781
   159
        /// Default constructor.
kpeter@781
   160
        /// \warning It sets the iterator to an undefined value.
deba@57
   161
        NodeIt() { }
deba@57
   162
        /// Copy constructor.
alpar@209
   163
deba@57
   164
        /// Copy constructor.
deba@57
   165
        ///
deba@57
   166
        NodeIt(const NodeIt& n) : Node(n) { }
alpar@1432
   167
        /// Assignment operator
alpar@1432
   168
alpar@1432
   169
        /// Assignment operator.
alpar@1432
   170
        ///
alpar@1432
   171
        const NodeIt &operator=(const NodeIt&) { return *this; }
alpar@1432
   172
kpeter@781
   173
        /// %Invalid constructor \& conversion.
deba@57
   174
kpeter@781
   175
        /// Initializes the iterator to be invalid.
deba@57
   176
        /// \sa Invalid for more details.
deba@57
   177
        NodeIt(Invalid) { }
deba@57
   178
        /// Sets the iterator to the first node.
deba@57
   179
kpeter@781
   180
        /// Sets the iterator to the first node of the given digraph.
deba@57
   181
        ///
kpeter@781
   182
        explicit NodeIt(const Graph&) { }
kpeter@781
   183
        /// Sets the iterator to the given node.
deba@57
   184
kpeter@781
   185
        /// Sets the iterator to the given node of the given digraph.
kpeter@781
   186
        ///
deba@57
   187
        NodeIt(const Graph&, const Node&) { }
deba@57
   188
        /// Next node.
deba@57
   189
deba@57
   190
        /// Assign the iterator to the next node.
deba@57
   191
        ///
deba@57
   192
        NodeIt& operator++() { return *this; }
deba@57
   193
      };
alpar@209
   194
ggab90@1336
   195
      /// \brief Gets the collection of the nodes of the graph.
ggab90@1336
   196
      ///
ggab90@1336
   197
      /// This function can be used for iterating on
ggab90@1336
   198
      /// the nodes of the graph. It returns a wrapped NodeIt, which looks
ggab90@1336
   199
      /// like an STL container (by having begin() and end())
ggab90@1336
   200
      /// which you can use in range-based for loops, STL algorithms, etc.
ggab90@1336
   201
      /// For example you can write:
ggab90@1336
   202
      ///\code
ggab90@1336
   203
      /// ListGraph g;
ggab90@1336
   204
      /// for(auto v: g.nodes())
ggab90@1336
   205
      ///   doSomething(v);
ggab90@1336
   206
      ///
ggab90@1336
   207
      /// //Using an STL algorithm:
ggab90@1336
   208
      /// copy(g.nodes().begin(), g.nodes().end(), vect.begin());
ggab90@1336
   209
      ///\endcode
ggab90@1336
   210
      LemonRangeWrapper1<NodeIt, Graph> nodes() const {
ggab90@1336
   211
        return LemonRangeWrapper1<NodeIt, Graph>(*this);
ggab90@1336
   212
      }
ggab90@1336
   213
alpar@209
   214
kpeter@781
   215
      /// The edge type of the graph
deba@57
   216
kpeter@781
   217
      /// This class identifies an edge of the graph. It also serves
kpeter@781
   218
      /// as a base class of the edge iterators,
kpeter@781
   219
      /// thus they will convert to this type.
deba@57
   220
      class Edge {
deba@57
   221
      public:
deba@57
   222
        /// Default constructor
deba@57
   223
kpeter@781
   224
        /// Default constructor.
kpeter@781
   225
        /// \warning It sets the object to an undefined value.
deba@57
   226
        Edge() { }
deba@57
   227
        /// Copy constructor.
deba@57
   228
deba@57
   229
        /// Copy constructor.
deba@57
   230
        ///
deba@57
   231
        Edge(const Edge&) { }
alpar@1432
   232
        /// Assignment operator
alpar@1432
   233
alpar@1432
   234
        /// Assignment operator.
alpar@1432
   235
        ///
alpar@1432
   236
        const Edge &operator=(const Edge&) { return *this; }
alpar@1432
   237
kpeter@781
   238
        /// %Invalid constructor \& conversion.
deba@57
   239
kpeter@781
   240
        /// Initializes the object to be invalid.
kpeter@781
   241
        /// \sa Invalid for more details.
deba@57
   242
        Edge(Invalid) { }
deba@57
   243
        /// Equality operator
deba@57
   244
kpeter@781
   245
        /// Equality operator.
kpeter@781
   246
        ///
deba@57
   247
        /// Two iterators are equal if and only if they point to the
kpeter@781
   248
        /// same object or both are \c INVALID.
deba@57
   249
        bool operator==(Edge) const { return true; }
deba@57
   250
        /// Inequality operator
deba@57
   251
kpeter@781
   252
        /// Inequality operator.
deba@57
   253
        bool operator!=(Edge) const { return true; }
deba@57
   254
alpar@209
   255
        /// Artificial ordering operator.
alpar@209
   256
kpeter@781
   257
        /// Artificial ordering operator.
alpar@209
   258
        ///
kpeter@781
   259
        /// \note This operator only has to define some strict ordering of
kpeter@781
   260
        /// the edges; this order has nothing to do with the iteration
kpeter@781
   261
        /// ordering of the edges.
alpar@209
   262
        bool operator<(Edge) const { return false; }
deba@57
   263
      };
deba@57
   264
kpeter@781
   265
      /// Iterator class for the edges.
deba@57
   266
kpeter@781
   267
      /// This iterator goes through each edge of the graph.
kpeter@833
   268
      /// Its usage is quite simple, for example, you can count the number
kpeter@781
   269
      /// of edges in a graph \c g of type \c %Graph as follows:
deba@57
   270
      ///\code
deba@57
   271
      /// int count=0;
deba@57
   272
      /// for(Graph::EdgeIt e(g); e!=INVALID; ++e) ++count;
deba@57
   273
      ///\endcode
deba@57
   274
      class EdgeIt : public Edge {
deba@57
   275
      public:
deba@57
   276
        /// Default constructor
deba@57
   277
kpeter@781
   278
        /// Default constructor.
kpeter@781
   279
        /// \warning It sets the iterator to an undefined value.
deba@57
   280
        EdgeIt() { }
deba@57
   281
        /// Copy constructor.
deba@57
   282
deba@57
   283
        /// Copy constructor.
deba@57
   284
        ///
deba@57
   285
        EdgeIt(const EdgeIt& e) : Edge(e) { }
alpar@1432
   286
        /// Assignment operator
alpar@1432
   287
alpar@1432
   288
        /// Assignment operator.
alpar@1432
   289
        ///
alpar@1432
   290
        const EdgeIt &operator=(const EdgeIt&) { return *this; }
alpar@1432
   291
kpeter@781
   292
        /// %Invalid constructor \& conversion.
deba@57
   293
kpeter@781
   294
        /// Initializes the iterator to be invalid.
kpeter@781
   295
        /// \sa Invalid for more details.
kpeter@781
   296
        EdgeIt(Invalid) { }
kpeter@781
   297
        /// Sets the iterator to the first edge.
kpeter@781
   298
kpeter@781
   299
        /// Sets the iterator to the first edge of the given graph.
deba@57
   300
        ///
kpeter@781
   301
        explicit EdgeIt(const Graph&) { }
kpeter@781
   302
        /// Sets the iterator to the given edge.
alpar@209
   303
kpeter@781
   304
        /// Sets the iterator to the given edge of the given graph.
kpeter@781
   305
        ///
alpar@209
   306
        EdgeIt(const Graph&, const Edge&) { }
deba@57
   307
        /// Next edge
alpar@209
   308
deba@57
   309
        /// Assign the iterator to the next edge.
kpeter@781
   310
        ///
deba@57
   311
        EdgeIt& operator++() { return *this; }
deba@57
   312
      };
deba@57
   313
ggab90@1336
   314
      /// \brief Gets the collection of the edges of the graph.
ggab90@1336
   315
      ///
ggab90@1336
   316
      /// This function can be used for iterating on the
ggab90@1336
   317
      /// edges of the graph. It returns a wrapped
ggab90@1336
   318
      /// EdgeIt, which looks like an STL container
ggab90@1336
   319
      /// (by having begin() and end()) which you can use in range-based
ggab90@1336
   320
      /// for loops, STL algorithms, etc.
ggab90@1336
   321
      /// For example you can write:
ggab90@1336
   322
      ///\code
ggab90@1336
   323
      /// ListGraph g;
ggab90@1336
   324
      /// for(auto e: g.edges())
ggab90@1336
   325
      ///   doSomething(e);
ggab90@1336
   326
      ///
ggab90@1336
   327
      /// //Using an STL algorithm:
ggab90@1336
   328
      /// copy(g.edges().begin(), g.edges().end(), vect.begin());
ggab90@1336
   329
      ///\endcode
ggab90@1336
   330
      LemonRangeWrapper1<EdgeIt, Graph> edges() const {
ggab90@1336
   331
        return LemonRangeWrapper1<EdgeIt, Graph>(*this);
ggab90@1336
   332
      }
ggab90@1336
   333
ggab90@1336
   334
kpeter@781
   335
      /// Iterator class for the incident edges of a node.
kpeter@781
   336
kpeter@781
   337
      /// This iterator goes trough the incident undirected edges
kpeter@781
   338
      /// of a certain node of a graph.
kpeter@833
   339
      /// Its usage is quite simple, for example, you can compute the
kpeter@781
   340
      /// degree (i.e. the number of incident edges) of a node \c n
kpeter@781
   341
      /// in a graph \c g of type \c %Graph as follows.
deba@57
   342
      ///
deba@57
   343
      ///\code
deba@57
   344
      /// int count=0;
deba@78
   345
      /// for(Graph::IncEdgeIt e(g, n); e!=INVALID; ++e) ++count;
deba@57
   346
      ///\endcode
kpeter@781
   347
      ///
kpeter@781
   348
      /// \warning Loop edges will be iterated twice.
deba@78
   349
      class IncEdgeIt : public Edge {
deba@57
   350
      public:
deba@57
   351
        /// Default constructor
deba@57
   352
kpeter@781
   353
        /// Default constructor.
kpeter@781
   354
        /// \warning It sets the iterator to an undefined value.
deba@78
   355
        IncEdgeIt() { }
deba@57
   356
        /// Copy constructor.
deba@57
   357
deba@57
   358
        /// Copy constructor.
deba@57
   359
        ///
deba@78
   360
        IncEdgeIt(const IncEdgeIt& e) : Edge(e) { }
alpar@1432
   361
        /// Assignment operator
alpar@1432
   362
alpar@1432
   363
        /// Assignment operator.
alpar@1432
   364
        ///
alpar@1432
   365
        const IncEdgeIt &operator=(const IncEdgeIt&) { return *this; }
alpar@1432
   366
kpeter@781
   367
        /// %Invalid constructor \& conversion.
deba@57
   368
kpeter@781
   369
        /// Initializes the iterator to be invalid.
kpeter@781
   370
        /// \sa Invalid for more details.
kpeter@781
   371
        IncEdgeIt(Invalid) { }
kpeter@781
   372
        /// Sets the iterator to the first incident edge.
kpeter@781
   373
kpeter@781
   374
        /// Sets the iterator to the first incident edge of the given node.
deba@57
   375
        ///
kpeter@781
   376
        IncEdgeIt(const Graph&, const Node&) { }
kpeter@781
   377
        /// Sets the iterator to the given edge.
alpar@209
   378
kpeter@781
   379
        /// Sets the iterator to the given edge of the given graph.
kpeter@781
   380
        ///
kpeter@781
   381
        IncEdgeIt(const Graph&, const Edge&) { }
kpeter@781
   382
        /// Next incident edge
deba@57
   383
kpeter@781
   384
        /// Assign the iterator to the next incident edge
alpar@209
   385
        /// of the corresponding node.
deba@78
   386
        IncEdgeIt& operator++() { return *this; }
deba@57
   387
      };
deba@57
   388
ggab90@1336
   389
      /// \brief Gets the collection of the incident undirected edges
ggab90@1336
   390
      ///  of a certain node of the graph.
ggab90@1336
   391
      ///
ggab90@1336
   392
      /// This function can be used for iterating on the
ggab90@1336
   393
      /// incident undirected edges of a certain node of the graph.
ggab90@1336
   394
      /// It returns a wrapped
ggab90@1336
   395
      /// IncEdgeIt, which looks like an STL container
ggab90@1336
   396
      /// (by having begin() and end()) which you can use in range-based
ggab90@1336
   397
      /// for loops, STL algorithms, etc.
ggab90@1336
   398
      /// For example if g is a Graph and u is a Node, you can write:
ggab90@1336
   399
      ///\code
ggab90@1336
   400
      /// for(auto e: g.incEdges(u))
ggab90@1336
   401
      ///   doSomething(e);
ggab90@1336
   402
      ///
ggab90@1336
   403
      /// //Using an STL algorithm:
ggab90@1336
   404
      /// copy(g.incEdges(u).begin(), g.incEdges(u).end(), vect.begin());
ggab90@1336
   405
      ///\endcode
ggab90@1336
   406
      LemonRangeWrapper2<IncEdgeIt, Graph, Node> incEdges(const Node& u) const {
ggab90@1336
   407
        return LemonRangeWrapper2<IncEdgeIt, Graph, Node>(*this, u);
ggab90@1336
   408
      }
ggab90@1336
   409
ggab90@1336
   410
kpeter@781
   411
      /// The arc type of the graph
deba@57
   412
kpeter@781
   413
      /// This class identifies a directed arc of the graph. It also serves
kpeter@781
   414
      /// as a base class of the arc iterators,
kpeter@781
   415
      /// thus they will convert to this type.
kpeter@704
   416
      class Arc {
deba@57
   417
      public:
deba@57
   418
        /// Default constructor
deba@57
   419
kpeter@781
   420
        /// Default constructor.
kpeter@781
   421
        /// \warning It sets the object to an undefined value.
deba@57
   422
        Arc() { }
deba@57
   423
        /// Copy constructor.
deba@57
   424
deba@57
   425
        /// Copy constructor.
deba@57
   426
        ///
kpeter@704
   427
        Arc(const Arc&) { }
alpar@1432
   428
        /// Assignment operator
alpar@1432
   429
alpar@1432
   430
        /// Assignment operator.
alpar@1432
   431
        ///
alpar@1432
   432
        const Arc &operator=(const Arc&) { return *this; }
alpar@1432
   433
kpeter@781
   434
        /// %Invalid constructor \& conversion.
deba@57
   435
kpeter@781
   436
        /// Initializes the object to be invalid.
kpeter@781
   437
        /// \sa Invalid for more details.
deba@57
   438
        Arc(Invalid) { }
deba@57
   439
        /// Equality operator
deba@57
   440
kpeter@781
   441
        /// Equality operator.
kpeter@781
   442
        ///
deba@57
   443
        /// Two iterators are equal if and only if they point to the
kpeter@781
   444
        /// same object or both are \c INVALID.
deba@57
   445
        bool operator==(Arc) const { return true; }
deba@57
   446
        /// Inequality operator
deba@57
   447
kpeter@781
   448
        /// Inequality operator.
deba@57
   449
        bool operator!=(Arc) const { return true; }
deba@57
   450
alpar@209
   451
        /// Artificial ordering operator.
alpar@209
   452
kpeter@781
   453
        /// Artificial ordering operator.
alpar@209
   454
        ///
kpeter@781
   455
        /// \note This operator only has to define some strict ordering of
kpeter@781
   456
        /// the arcs; this order has nothing to do with the iteration
kpeter@781
   457
        /// ordering of the arcs.
alpar@209
   458
        bool operator<(Arc) const { return false; }
alpar@209
   459
kpeter@781
   460
        /// Converison to \c Edge
alpar@956
   461
kpeter@781
   462
        /// Converison to \c Edge.
kpeter@781
   463
        ///
kpeter@704
   464
        operator Edge() const { return Edge(); }
alpar@209
   465
      };
deba@57
   466
kpeter@781
   467
      /// Iterator class for the arcs.
kpeter@781
   468
kpeter@781
   469
      /// This iterator goes through each directed arc of the graph.
kpeter@833
   470
      /// Its usage is quite simple, for example, you can count the number
kpeter@781
   471
      /// of arcs in a graph \c g of type \c %Graph as follows:
deba@57
   472
      ///\code
deba@57
   473
      /// int count=0;
kpeter@781
   474
      /// for(Graph::ArcIt a(g); a!=INVALID; ++a) ++count;
deba@57
   475
      ///\endcode
deba@57
   476
      class ArcIt : public Arc {
deba@57
   477
      public:
deba@57
   478
        /// Default constructor
deba@57
   479
kpeter@781
   480
        /// Default constructor.
kpeter@781
   481
        /// \warning It sets the iterator to an undefined value.
deba@57
   482
        ArcIt() { }
deba@57
   483
        /// Copy constructor.
deba@57
   484
deba@57
   485
        /// Copy constructor.
deba@57
   486
        ///
deba@57
   487
        ArcIt(const ArcIt& e) : Arc(e) { }
alpar@1432
   488
        /// Assignment operator
alpar@1432
   489
alpar@1432
   490
        /// Assignment operator.
alpar@1432
   491
        ///
alpar@1432
   492
        const ArcIt &operator=(const ArcIt&) { return *this; }
alpar@1432
   493
kpeter@781
   494
        /// %Invalid constructor \& conversion.
deba@57
   495
kpeter@781
   496
        /// Initializes the iterator to be invalid.
kpeter@781
   497
        /// \sa Invalid for more details.
kpeter@781
   498
        ArcIt(Invalid) { }
kpeter@781
   499
        /// Sets the iterator to the first arc.
kpeter@781
   500
kpeter@781
   501
        /// Sets the iterator to the first arc of the given graph.
deba@57
   502
        ///
alpar@1271
   503
        explicit ArcIt(const Graph &g) {
alpar@1271
   504
          ::lemon::ignore_unused_variable_warning(g);
alpar@1271
   505
        }
kpeter@781
   506
        /// Sets the iterator to the given arc.
alpar@209
   507
kpeter@781
   508
        /// Sets the iterator to the given arc of the given graph.
kpeter@781
   509
        ///
alpar@209
   510
        ArcIt(const Graph&, const Arc&) { }
kpeter@781
   511
        /// Next arc
alpar@209
   512
deba@57
   513
        /// Assign the iterator to the next arc.
kpeter@781
   514
        ///
deba@57
   515
        ArcIt& operator++() { return *this; }
deba@57
   516
      };
alpar@209
   517
ggab90@1336
   518
      /// \brief Gets the collection of the directed arcs of the graph.
ggab90@1336
   519
      ///
ggab90@1336
   520
      /// This function can be used for iterating on the
ggab90@1336
   521
      /// arcs of the graph. It returns a wrapped
ggab90@1336
   522
      /// ArcIt, which looks like an STL container
ggab90@1336
   523
      /// (by having begin() and end()) which you can use in range-based
ggab90@1336
   524
      /// for loops, STL algorithms, etc.
ggab90@1336
   525
      /// For example you can write:
ggab90@1336
   526
      ///\code
ggab90@1336
   527
      /// ListGraph g;
ggab90@1336
   528
      /// for(auto a: g.arcs())
ggab90@1336
   529
      ///   doSomething(a);
ggab90@1336
   530
      ///
ggab90@1336
   531
      /// //Using an STL algorithm:
ggab90@1336
   532
      /// copy(g.arcs().begin(), g.arcs().end(), vect.begin());
ggab90@1336
   533
      ///\endcode
ggab90@1336
   534
      LemonRangeWrapper1<ArcIt, Graph> arcs() const {
ggab90@1336
   535
        return LemonRangeWrapper1<ArcIt, Graph>(*this);
ggab90@1336
   536
      }
ggab90@1336
   537
ggab90@1336
   538
kpeter@781
   539
      /// Iterator class for the outgoing arcs of a node.
deba@57
   540
kpeter@781
   541
      /// This iterator goes trough the \e outgoing directed arcs of a
kpeter@781
   542
      /// certain node of a graph.
kpeter@833
   543
      /// Its usage is quite simple, for example, you can count the number
deba@57
   544
      /// of outgoing arcs of a node \c n
kpeter@781
   545
      /// in a graph \c g of type \c %Graph as follows.
deba@57
   546
      ///\code
deba@57
   547
      /// int count=0;
kpeter@781
   548
      /// for (Digraph::OutArcIt a(g, n); a!=INVALID; ++a) ++count;
deba@57
   549
      ///\endcode
deba@57
   550
      class OutArcIt : public Arc {
deba@57
   551
      public:
deba@57
   552
        /// Default constructor
deba@57
   553
kpeter@781
   554
        /// Default constructor.
kpeter@781
   555
        /// \warning It sets the iterator to an undefined value.
deba@57
   556
        OutArcIt() { }
deba@57
   557
        /// Copy constructor.
deba@57
   558
deba@57
   559
        /// Copy constructor.
deba@57
   560
        ///
deba@57
   561
        OutArcIt(const OutArcIt& e) : Arc(e) { }
alpar@1432
   562
        /// Assignment operator
alpar@1432
   563
alpar@1432
   564
        /// Assignment operator.
alpar@1432
   565
        ///
alpar@1432
   566
        const OutArcIt &operator=(const OutArcIt&) { return *this; }
alpar@1432
   567
kpeter@781
   568
        /// %Invalid constructor \& conversion.
deba@57
   569
kpeter@781
   570
        /// Initializes the iterator to be invalid.
kpeter@781
   571
        /// \sa Invalid for more details.
kpeter@781
   572
        OutArcIt(Invalid) { }
kpeter@781
   573
        /// Sets the iterator to the first outgoing arc.
kpeter@781
   574
kpeter@781
   575
        /// Sets the iterator to the first outgoing arc of the given node.
deba@57
   576
        ///
deba@57
   577
        OutArcIt(const Graph& n, const Node& g) {
alpar@1257
   578
          ::lemon::ignore_unused_variable_warning(n);
alpar@1257
   579
          ::lemon::ignore_unused_variable_warning(g);
alpar@209
   580
        }
kpeter@781
   581
        /// Sets the iterator to the given arc.
deba@57
   582
kpeter@781
   583
        /// Sets the iterator to the given arc of the given graph.
kpeter@781
   584
        ///
deba@57
   585
        OutArcIt(const Graph&, const Arc&) { }
kpeter@781
   586
        /// Next outgoing arc
alpar@209
   587
alpar@209
   588
        /// Assign the iterator to the next
deba@57
   589
        /// outgoing arc of the corresponding node.
deba@57
   590
        OutArcIt& operator++() { return *this; }
deba@57
   591
      };
deba@57
   592
ggab90@1336
   593
      /// \brief Gets the collection of the outgoing directed arcs of a
ggab90@1336
   594
      /// certain node of the graph.
ggab90@1336
   595
      ///
ggab90@1336
   596
      /// This function can be used for iterating on the
ggab90@1336
   597
      /// outgoing arcs of a certain node of the graph. It returns a wrapped
ggab90@1336
   598
      /// OutArcIt, which looks like an STL container
ggab90@1336
   599
      /// (by having begin() and end()) which you can use in range-based
ggab90@1336
   600
      /// for loops, STL algorithms, etc.
ggab90@1336
   601
      /// For example if g is a Graph and u is a Node, you can write:
ggab90@1336
   602
      ///\code
ggab90@1336
   603
      /// for(auto a: g.outArcs(u))
ggab90@1336
   604
      ///   doSomething(a);
ggab90@1336
   605
      ///
ggab90@1336
   606
      /// //Using an STL algorithm:
ggab90@1336
   607
      /// copy(g.outArcs(u).begin(), g.outArcs(u).end(), vect.begin());
ggab90@1336
   608
      ///\endcode
ggab90@1336
   609
      LemonRangeWrapper2<OutArcIt, Graph, Node> outArcs(const Node& u) const {
ggab90@1336
   610
        return LemonRangeWrapper2<OutArcIt, Graph, Node>(*this, u);
ggab90@1336
   611
      }
ggab90@1336
   612
ggab90@1336
   613
kpeter@781
   614
      /// Iterator class for the incoming arcs of a node.
deba@57
   615
kpeter@781
   616
      /// This iterator goes trough the \e incoming directed arcs of a
kpeter@781
   617
      /// certain node of a graph.
kpeter@833
   618
      /// Its usage is quite simple, for example, you can count the number
kpeter@781
   619
      /// of incoming arcs of a node \c n
kpeter@781
   620
      /// in a graph \c g of type \c %Graph as follows.
deba@57
   621
      ///\code
deba@57
   622
      /// int count=0;
kpeter@781
   623
      /// for (Digraph::InArcIt a(g, n); a!=INVALID; ++a) ++count;
deba@57
   624
      ///\endcode
deba@57
   625
      class InArcIt : public Arc {
deba@57
   626
      public:
deba@57
   627
        /// Default constructor
deba@57
   628
kpeter@781
   629
        /// Default constructor.
kpeter@781
   630
        /// \warning It sets the iterator to an undefined value.
deba@57
   631
        InArcIt() { }
deba@57
   632
        /// Copy constructor.
deba@57
   633
deba@57
   634
        /// Copy constructor.
deba@57
   635
        ///
deba@57
   636
        InArcIt(const InArcIt& e) : Arc(e) { }
alpar@1432
   637
        /// Assignment operator
alpar@1432
   638
alpar@1432
   639
        /// Assignment operator.
alpar@1432
   640
        ///
alpar@1432
   641
        const InArcIt &operator=(const InArcIt&) { return *this; }
alpar@1432
   642
kpeter@781
   643
        /// %Invalid constructor \& conversion.
deba@57
   644
kpeter@781
   645
        /// Initializes the iterator to be invalid.
kpeter@781
   646
        /// \sa Invalid for more details.
kpeter@781
   647
        InArcIt(Invalid) { }
kpeter@781
   648
        /// Sets the iterator to the first incoming arc.
kpeter@781
   649
kpeter@781
   650
        /// Sets the iterator to the first incoming arc of the given node.
deba@57
   651
        ///
alpar@209
   652
        InArcIt(const Graph& g, const Node& n) {
alpar@1257
   653
          ::lemon::ignore_unused_variable_warning(n);
alpar@1257
   654
          ::lemon::ignore_unused_variable_warning(g);
alpar@209
   655
        }
kpeter@781
   656
        /// Sets the iterator to the given arc.
deba@57
   657
kpeter@781
   658
        /// Sets the iterator to the given arc of the given graph.
kpeter@781
   659
        ///
deba@57
   660
        InArcIt(const Graph&, const Arc&) { }
deba@57
   661
        /// Next incoming arc
deba@57
   662
kpeter@781
   663
        /// Assign the iterator to the next
kpeter@781
   664
        /// incoming arc of the corresponding node.
deba@57
   665
        InArcIt& operator++() { return *this; }
deba@57
   666
      };
deba@57
   667
ggab90@1336
   668
      /// \brief Gets the collection of the incoming directed arcs of
ggab90@1336
   669
      /// a certain node of the graph.
ggab90@1336
   670
      ///
ggab90@1336
   671
      /// This function can be used for iterating on the
ggab90@1336
   672
      /// incoming directed arcs of a certain node of the graph. It returns
ggab90@1336
   673
      /// a wrapped InArcIt, which looks like an STL container
ggab90@1336
   674
      /// (by having begin() and end()) which you can use in range-based
ggab90@1336
   675
      /// for loops, STL algorithms, etc.
ggab90@1336
   676
      /// For example if g is a Graph and u is a Node, you can write:
ggab90@1336
   677
      ///\code
ggab90@1336
   678
      /// for(auto a: g.inArcs(u))
ggab90@1336
   679
      ///   doSomething(a);
ggab90@1336
   680
      ///
ggab90@1336
   681
      /// //Using an STL algorithm:
ggab90@1336
   682
      /// copy(g.inArcs(u).begin(), g.inArcs(u).end(), vect.begin());
ggab90@1336
   683
      ///\endcode
ggab90@1336
   684
      LemonRangeWrapper2<InArcIt, Graph, Node> inArcs(const Node& u) const {
ggab90@1336
   685
        return LemonRangeWrapper2<InArcIt, Graph, Node>(*this, u);
ggab90@1336
   686
      }
ggab90@1336
   687
kpeter@781
   688
      /// \brief Standard graph map type for the nodes.
alpar@209
   689
      ///
kpeter@781
   690
      /// Standard graph map type for the nodes.
kpeter@781
   691
      /// It conforms to the ReferenceMap concept.
alpar@209
   692
      template<class T>
kpeter@627
   693
      class NodeMap : public ReferenceMap<Node, T, T&, const T&>
deba@57
   694
      {
deba@57
   695
      public:
deba@57
   696
kpeter@781
   697
        /// Constructor
kpeter@781
   698
        explicit NodeMap(const Graph&) { }
kpeter@781
   699
        /// Constructor with given initial value
deba@57
   700
        NodeMap(const Graph&, T) { }
deba@57
   701
kpeter@263
   702
      private:
deba@57
   703
        ///Copy constructor
kpeter@627
   704
        NodeMap(const NodeMap& nm) :
kpeter@627
   705
          ReferenceMap<Node, T, T&, const T&>(nm) { }
deba@57
   706
        ///Assignment operator
alpar@1432
   707
        NodeMap& operator=(const NodeMap&) {
alpar@1432
   708
          return *this;
alpar@1432
   709
        }
alpar@1432
   710
        ///Template Assignment operator
deba@57
   711
        template <typename CMap>
alpar@209
   712
        NodeMap& operator=(const CMap&) {
deba@57
   713
          checkConcept<ReadMap<Node, T>, CMap>();
alpar@209
   714
          return *this;
deba@57
   715
        }
deba@57
   716
      };
deba@57
   717
kpeter@781
   718
      /// \brief Standard graph map type for the arcs.
deba@57
   719
      ///
kpeter@781
   720
      /// Standard graph map type for the arcs.
kpeter@781
   721
      /// It conforms to the ReferenceMap concept.
alpar@209
   722
      template<class T>
kpeter@627
   723
      class ArcMap : public ReferenceMap<Arc, T, T&, const T&>
deba@57
   724
      {
deba@57
   725
      public:
deba@57
   726
kpeter@781
   727
        /// Constructor
kpeter@781
   728
        explicit ArcMap(const Graph&) { }
kpeter@781
   729
        /// Constructor with given initial value
deba@57
   730
        ArcMap(const Graph&, T) { }
kpeter@781
   731
kpeter@263
   732
      private:
deba@57
   733
        ///Copy constructor
kpeter@627
   734
        ArcMap(const ArcMap& em) :
kpeter@627
   735
          ReferenceMap<Arc, T, T&, const T&>(em) { }
deba@57
   736
        ///Assignment operator
alpar@1432
   737
        ArcMap& operator=(const ArcMap&) {
alpar@1432
   738
          return *this;
alpar@1432
   739
        }
alpar@1432
   740
        ///Template Assignment operator
deba@57
   741
        template <typename CMap>
alpar@209
   742
        ArcMap& operator=(const CMap&) {
deba@57
   743
          checkConcept<ReadMap<Arc, T>, CMap>();
alpar@209
   744
          return *this;
deba@57
   745
        }
deba@57
   746
      };
deba@57
   747
kpeter@781
   748
      /// \brief Standard graph map type for the edges.
kpeter@781
   749
      ///
kpeter@781
   750
      /// Standard graph map type for the edges.
kpeter@781
   751
      /// It conforms to the ReferenceMap concept.
alpar@209
   752
      template<class T>
kpeter@627
   753
      class EdgeMap : public ReferenceMap<Edge, T, T&, const T&>
deba@57
   754
      {
deba@57
   755
      public:
deba@57
   756
kpeter@781
   757
        /// Constructor
kpeter@781
   758
        explicit EdgeMap(const Graph&) { }
kpeter@781
   759
        /// Constructor with given initial value
deba@57
   760
        EdgeMap(const Graph&, T) { }
kpeter@781
   761
kpeter@263
   762
      private:
deba@57
   763
        ///Copy constructor
kpeter@627
   764
        EdgeMap(const EdgeMap& em) :
kpeter@627
   765
          ReferenceMap<Edge, T, T&, const T&>(em) {}
deba@57
   766
        ///Assignment operator
alpar@1432
   767
        EdgeMap& operator=(const EdgeMap&) {
alpar@1432
   768
          return *this;
alpar@1432
   769
        }
alpar@1432
   770
        ///Template Assignment operator
deba@57
   771
        template <typename CMap>
alpar@209
   772
        EdgeMap& operator=(const CMap&) {
deba@57
   773
          checkConcept<ReadMap<Edge, T>, CMap>();
alpar@209
   774
          return *this;
deba@57
   775
        }
deba@57
   776
      };
deba@57
   777
kpeter@781
   778
      /// \brief The first node of the edge.
deba@57
   779
      ///
kpeter@781
   780
      /// Returns the first node of the given edge.
deba@57
   781
      ///
kpeter@833
   782
      /// Edges don't have source and target nodes, however, methods
kpeter@781
   783
      /// u() and v() are used to query the two end-nodes of an edge.
kpeter@781
   784
      /// The orientation of an edge that arises this way is called
kpeter@781
   785
      /// the inherent direction, it is used to define the default
kpeter@781
   786
      /// direction for the corresponding arcs.
kpeter@606
   787
      /// \sa v()
kpeter@606
   788
      /// \sa direction()
deba@57
   789
      Node u(Edge) const { return INVALID; }
deba@57
   790
kpeter@781
   791
      /// \brief The second node of the edge.
kpeter@606
   792
      ///
kpeter@781
   793
      /// Returns the second node of the given edge.
kpeter@606
   794
      ///
kpeter@833
   795
      /// Edges don't have source and target nodes, however, methods
kpeter@781
   796
      /// u() and v() are used to query the two end-nodes of an edge.
kpeter@781
   797
      /// The orientation of an edge that arises this way is called
kpeter@781
   798
      /// the inherent direction, it is used to define the default
kpeter@781
   799
      /// direction for the corresponding arcs.
kpeter@606
   800
      /// \sa u()
kpeter@606
   801
      /// \sa direction()
deba@57
   802
      Node v(Edge) const { return INVALID; }
deba@57
   803
kpeter@781
   804
      /// \brief The source node of the arc.
kpeter@781
   805
      ///
kpeter@781
   806
      /// Returns the source node of the given arc.
deba@57
   807
      Node source(Arc) const { return INVALID; }
deba@57
   808
kpeter@781
   809
      /// \brief The target node of the arc.
kpeter@781
   810
      ///
kpeter@781
   811
      /// Returns the target node of the given arc.
deba@57
   812
      Node target(Arc) const { return INVALID; }
deba@57
   813
kpeter@781
   814
      /// \brief The ID of the node.
kpeter@781
   815
      ///
kpeter@781
   816
      /// Returns the ID of the given node.
alpar@209
   817
      int id(Node) const { return -1; }
deba@61
   818
kpeter@781
   819
      /// \brief The ID of the edge.
kpeter@781
   820
      ///
kpeter@781
   821
      /// Returns the ID of the given edge.
alpar@209
   822
      int id(Edge) const { return -1; }
deba@61
   823
kpeter@781
   824
      /// \brief The ID of the arc.
kpeter@781
   825
      ///
kpeter@781
   826
      /// Returns the ID of the given arc.
alpar@209
   827
      int id(Arc) const { return -1; }
deba@61
   828
kpeter@781
   829
      /// \brief The node with the given ID.
deba@61
   830
      ///
kpeter@781
   831
      /// Returns the node with the given ID.
kpeter@781
   832
      /// \pre The argument should be a valid node ID in the graph.
alpar@209
   833
      Node nodeFromId(int) const { return INVALID; }
deba@61
   834
kpeter@781
   835
      /// \brief The edge with the given ID.
deba@61
   836
      ///
kpeter@781
   837
      /// Returns the edge with the given ID.
kpeter@781
   838
      /// \pre The argument should be a valid edge ID in the graph.
alpar@209
   839
      Edge edgeFromId(int) const { return INVALID; }
deba@61
   840
kpeter@781
   841
      /// \brief The arc with the given ID.
deba@61
   842
      ///
kpeter@781
   843
      /// Returns the arc with the given ID.
kpeter@781
   844
      /// \pre The argument should be a valid arc ID in the graph.
alpar@209
   845
      Arc arcFromId(int) const { return INVALID; }
deba@61
   846
kpeter@781
   847
      /// \brief An upper bound on the node IDs.
kpeter@781
   848
      ///
kpeter@781
   849
      /// Returns an upper bound on the node IDs.
alpar@209
   850
      int maxNodeId() const { return -1; }
deba@61
   851
kpeter@781
   852
      /// \brief An upper bound on the edge IDs.
kpeter@781
   853
      ///
kpeter@781
   854
      /// Returns an upper bound on the edge IDs.
alpar@209
   855
      int maxEdgeId() const { return -1; }
deba@61
   856
kpeter@781
   857
      /// \brief An upper bound on the arc IDs.
kpeter@781
   858
      ///
kpeter@781
   859
      /// Returns an upper bound on the arc IDs.
alpar@209
   860
      int maxArcId() const { return -1; }
deba@61
   861
kpeter@781
   862
      /// \brief The direction of the arc.
kpeter@781
   863
      ///
kpeter@781
   864
      /// Returns \c true if the direction of the given arc is the same as
kpeter@781
   865
      /// the inherent orientation of the represented edge.
kpeter@781
   866
      bool direction(Arc) const { return true; }
kpeter@781
   867
kpeter@781
   868
      /// \brief Direct the edge.
kpeter@781
   869
      ///
kpeter@781
   870
      /// Direct the given edge. The returned arc
kpeter@781
   871
      /// represents the given edge and its direction comes
kpeter@781
   872
      /// from the bool parameter. If it is \c true, then the direction
kpeter@781
   873
      /// of the arc is the same as the inherent orientation of the edge.
kpeter@781
   874
      Arc direct(Edge, bool) const {
kpeter@781
   875
        return INVALID;
kpeter@781
   876
      }
kpeter@781
   877
kpeter@781
   878
      /// \brief Direct the edge.
kpeter@781
   879
      ///
kpeter@781
   880
      /// Direct the given edge. The returned arc represents the given
kpeter@781
   881
      /// edge and its source node is the given node.
kpeter@781
   882
      Arc direct(Edge, Node) const {
kpeter@781
   883
        return INVALID;
kpeter@781
   884
      }
kpeter@781
   885
kpeter@781
   886
      /// \brief The oppositely directed arc.
kpeter@781
   887
      ///
kpeter@781
   888
      /// Returns the oppositely directed arc representing the same edge.
kpeter@781
   889
      Arc oppositeArc(Arc) const { return INVALID; }
kpeter@781
   890
kpeter@781
   891
      /// \brief The opposite node on the edge.
kpeter@781
   892
      ///
kpeter@781
   893
      /// Returns the opposite node on the given edge.
kpeter@781
   894
      Node oppositeNode(Node, Edge) const { return INVALID; }
kpeter@781
   895
deba@57
   896
      void first(Node&) const {}
deba@57
   897
      void next(Node&) const {}
deba@57
   898
deba@57
   899
      void first(Edge&) const {}
deba@57
   900
      void next(Edge&) const {}
deba@57
   901
deba@57
   902
      void first(Arc&) const {}
deba@57
   903
      void next(Arc&) const {}
deba@57
   904
deba@57
   905
      void firstOut(Arc&, Node) const {}
deba@57
   906
      void nextOut(Arc&) const {}
deba@57
   907
deba@57
   908
      void firstIn(Arc&, Node) const {}
deba@57
   909
      void nextIn(Arc&) const {}
deba@57
   910
deba@57
   911
      void firstInc(Edge &, bool &, const Node &) const {}
deba@57
   912
      void nextInc(Edge &, bool &) const {}
deba@57
   913
deba@61
   914
      // The second parameter is dummy.
deba@61
   915
      Node fromId(int, Node) const { return INVALID; }
deba@61
   916
      // The second parameter is dummy.
deba@61
   917
      Edge fromId(int, Edge) const { return INVALID; }
deba@61
   918
      // The second parameter is dummy.
deba@61
   919
      Arc fromId(int, Arc) const { return INVALID; }
deba@61
   920
deba@61
   921
      // Dummy parameter.
alpar@209
   922
      int maxId(Node) const { return -1; }
deba@61
   923
      // Dummy parameter.
alpar@209
   924
      int maxId(Edge) const { return -1; }
deba@61
   925
      // Dummy parameter.
alpar@209
   926
      int maxId(Arc) const { return -1; }
deba@61
   927
kpeter@781
   928
      /// \brief The base node of the iterator.
deba@57
   929
      ///
kpeter@781
   930
      /// Returns the base node of the given incident edge iterator.
kpeter@781
   931
      Node baseNode(IncEdgeIt) const { return INVALID; }
kpeter@781
   932
kpeter@781
   933
      /// \brief The running node of the iterator.
deba@57
   934
      ///
kpeter@781
   935
      /// Returns the running node of the given incident edge iterator.
kpeter@781
   936
      Node runningNode(IncEdgeIt) const { return INVALID; }
deba@57
   937
kpeter@781
   938
      /// \brief The base node of the iterator.
deba@57
   939
      ///
kpeter@781
   940
      /// Returns the base node of the given outgoing arc iterator
kpeter@781
   941
      /// (i.e. the source node of the corresponding arc).
kpeter@781
   942
      Node baseNode(OutArcIt) const { return INVALID; }
kpeter@781
   943
kpeter@781
   944
      /// \brief The running node of the iterator.
deba@57
   945
      ///
kpeter@781
   946
      /// Returns the running node of the given outgoing arc iterator
kpeter@781
   947
      /// (i.e. the target node of the corresponding arc).
kpeter@781
   948
      Node runningNode(OutArcIt) const { return INVALID; }
deba@57
   949
kpeter@781
   950
      /// \brief The base node of the iterator.
deba@57
   951
      ///
kpeter@1217
   952
      /// Returns the base node of the given incoming arc iterator
kpeter@781
   953
      /// (i.e. the target node of the corresponding arc).
kpeter@781
   954
      Node baseNode(InArcIt) const { return INVALID; }
alpar@209
   955
kpeter@781
   956
      /// \brief The running node of the iterator.
deba@57
   957
      ///
kpeter@1217
   958
      /// Returns the running node of the given incoming arc iterator
kpeter@781
   959
      /// (i.e. the source node of the corresponding arc).
kpeter@781
   960
      Node runningNode(InArcIt) const { return INVALID; }
deba@57
   961
deba@125
   962
      template <typename _Graph>
deba@57
   963
      struct Constraints {
alpar@209
   964
        void constraints() {
kpeter@627
   965
          checkConcept<BaseGraphComponent, _Graph>();
alpar@209
   966
          checkConcept<IterableGraphComponent<>, _Graph>();
alpar@209
   967
          checkConcept<IDableGraphComponent<>, _Graph>();
alpar@209
   968
          checkConcept<MappableGraphComponent<>, _Graph>();
alpar@209
   969
        }
deba@57
   970
      };
deba@57
   971
deba@57
   972
    };
deba@57
   973
deba@57
   974
  }
deba@57
   975
deba@57
   976
}
deba@57
   977
deba@57
   978
#endif