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