lemon/concepts/bpgraph.h
author Alpar Juttner <alpar@cs.elte.hu>
Wed, 07 Aug 2013 07:08:38 +0200
changeset 1262 dd1443e4a34c
parent 1217 7bf489cf624e
child 1270 dceba191c00d
permissions -rw-r--r--
Further ignore_unused_variable_warning() explicit namespaces (#294)
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@1194
    51
    /// nodes can be iterated with the RedNodeIt and BlueNodeIt in the
deba@1194
    52
    /// two node sets. With RedNodeMap and BlueNodeMap values can be
deba@1194
    53
    /// assigned to 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
      };
deba@1186
   153
deba@1186
   154
      /// Class to represent blue nodes.
deba@1186
   155
deba@1186
   156
      /// This class represents the blue nodes of the graph. It does
deba@1186
   157
      /// not supposed to be used directly, because the nodes can be
deba@1186
   158
      /// represented as Node instances. This class can be used as
deba@1186
   159
      /// template parameter for special map classes.
deba@1186
   160
      class BlueNode : public Node {
deba@1186
   161
      public:
deba@1186
   162
        /// Default constructor
deba@1186
   163
deba@1186
   164
        /// Default constructor.
deba@1186
   165
        /// \warning It sets the object to an undefined value.
deba@1186
   166
        BlueNode() { }
deba@1186
   167
        /// Copy constructor.
deba@1186
   168
deba@1186
   169
        /// Copy constructor.
deba@1186
   170
        ///
deba@1186
   171
        BlueNode(const BlueNode&) : Node() { }
deba@1186
   172
deba@1186
   173
        /// %Invalid constructor \& conversion.
deba@1186
   174
deba@1186
   175
        /// Initializes the object to be invalid.
deba@1186
   176
        /// \sa Invalid for more details.
deba@1186
   177
        BlueNode(Invalid) { }
deba@1186
   178
deba@1186
   179
      };
deba@1186
   180
deba@1186
   181
      /// Iterator class for the red nodes.
deba@1186
   182
deba@1186
   183
      /// This iterator goes through each red node of the graph.
deba@1186
   184
      /// Its usage is quite simple, for example, you can count the number
deba@1186
   185
      /// of red nodes in a graph \c g of type \c %BpGraph like this:
deba@1186
   186
      ///\code
deba@1186
   187
      /// int count=0;
deba@1186
   188
      /// for (BpGraph::RedNodeIt n(g); n!=INVALID; ++n) ++count;
deba@1186
   189
      ///\endcode
deba@1194
   190
      class RedNodeIt : public RedNode {
deba@1186
   191
      public:
deba@1186
   192
        /// Default constructor
deba@1186
   193
deba@1186
   194
        /// Default constructor.
deba@1186
   195
        /// \warning It sets the iterator to an undefined value.
deba@1194
   196
        RedNodeIt() { }
deba@1186
   197
        /// Copy constructor.
deba@1186
   198
deba@1186
   199
        /// Copy constructor.
deba@1186
   200
        ///
deba@1194
   201
        RedNodeIt(const RedNodeIt& n) : RedNode(n) { }
deba@1186
   202
        /// %Invalid constructor \& conversion.
deba@1186
   203
deba@1186
   204
        /// Initializes the iterator to be invalid.
deba@1186
   205
        /// \sa Invalid for more details.
deba@1194
   206
        RedNodeIt(Invalid) { }
deba@1186
   207
        /// Sets the iterator to the first red node.
deba@1186
   208
deba@1186
   209
        /// Sets the iterator to the first red node of the given
deba@1186
   210
        /// digraph.
deba@1194
   211
        explicit RedNodeIt(const BpGraph&) { }
deba@1186
   212
        /// Sets the iterator to the given red node.
deba@1186
   213
deba@1186
   214
        /// Sets the iterator to the given red node of the given
deba@1186
   215
        /// digraph.
deba@1194
   216
        RedNodeIt(const BpGraph&, const RedNode&) { }
deba@1186
   217
        /// Next node.
deba@1186
   218
deba@1186
   219
        /// Assign the iterator to the next red node.
deba@1186
   220
        ///
deba@1194
   221
        RedNodeIt& operator++() { return *this; }
deba@1186
   222
      };
deba@1186
   223
deba@1186
   224
      /// Iterator class for the blue nodes.
deba@1186
   225
deba@1186
   226
      /// This iterator goes through each blue node of the graph.
deba@1186
   227
      /// Its usage is quite simple, for example, you can count the number
deba@1186
   228
      /// of blue nodes in a graph \c g of type \c %BpGraph like this:
deba@1186
   229
      ///\code
deba@1186
   230
      /// int count=0;
deba@1186
   231
      /// for (BpGraph::BlueNodeIt n(g); n!=INVALID; ++n) ++count;
deba@1186
   232
      ///\endcode
deba@1194
   233
      class BlueNodeIt : public BlueNode {
deba@1186
   234
      public:
deba@1186
   235
        /// Default constructor
deba@1186
   236
deba@1186
   237
        /// Default constructor.
deba@1186
   238
        /// \warning It sets the iterator to an undefined value.
deba@1194
   239
        BlueNodeIt() { }
deba@1186
   240
        /// Copy constructor.
deba@1186
   241
deba@1186
   242
        /// Copy constructor.
deba@1186
   243
        ///
deba@1194
   244
        BlueNodeIt(const BlueNodeIt& n) : BlueNode(n) { }
deba@1186
   245
        /// %Invalid constructor \& conversion.
deba@1186
   246
deba@1186
   247
        /// Initializes the iterator to be invalid.
deba@1186
   248
        /// \sa Invalid for more details.
deba@1194
   249
        BlueNodeIt(Invalid) { }
deba@1186
   250
        /// Sets the iterator to the first blue node.
deba@1186
   251
deba@1186
   252
        /// Sets the iterator to the first blue node of the given
deba@1186
   253
        /// digraph.
deba@1194
   254
        explicit BlueNodeIt(const BpGraph&) { }
deba@1186
   255
        /// Sets the iterator to the given blue node.
deba@1186
   256
deba@1186
   257
        /// Sets the iterator to the given blue node of the given
deba@1186
   258
        /// digraph.
deba@1194
   259
        BlueNodeIt(const BpGraph&, const BlueNode&) { }
deba@1186
   260
        /// Next node.
deba@1186
   261
deba@1186
   262
        /// Assign the iterator to the next blue node.
deba@1186
   263
        ///
deba@1194
   264
        BlueNodeIt& operator++() { return *this; }
deba@1186
   265
      };
deba@1186
   266
deba@1186
   267
      /// Iterator class for the nodes.
deba@1186
   268
deba@1186
   269
      /// This iterator goes through each node of the graph.
deba@1186
   270
      /// Its usage is quite simple, for example, you can count the number
deba@1186
   271
      /// of nodes in a graph \c g of type \c %BpGraph like this:
deba@1186
   272
      ///\code
deba@1186
   273
      /// int count=0;
deba@1186
   274
      /// for (BpGraph::NodeIt n(g); n!=INVALID; ++n) ++count;
deba@1186
   275
      ///\endcode
deba@1186
   276
      class NodeIt : public Node {
deba@1186
   277
      public:
deba@1186
   278
        /// Default constructor
deba@1186
   279
deba@1186
   280
        /// Default constructor.
deba@1186
   281
        /// \warning It sets the iterator to an undefined value.
deba@1186
   282
        NodeIt() { }
deba@1186
   283
        /// Copy constructor.
deba@1186
   284
deba@1186
   285
        /// Copy constructor.
deba@1186
   286
        ///
deba@1186
   287
        NodeIt(const NodeIt& n) : Node(n) { }
deba@1186
   288
        /// %Invalid constructor \& conversion.
deba@1186
   289
deba@1186
   290
        /// Initializes the iterator to be invalid.
deba@1186
   291
        /// \sa Invalid for more details.
deba@1186
   292
        NodeIt(Invalid) { }
deba@1186
   293
        /// Sets the iterator to the first node.
deba@1186
   294
deba@1186
   295
        /// Sets the iterator to the first node of the given digraph.
deba@1186
   296
        ///
deba@1186
   297
        explicit NodeIt(const BpGraph&) { }
deba@1186
   298
        /// Sets the iterator to the given node.
deba@1186
   299
deba@1186
   300
        /// Sets the iterator to the given node of the given digraph.
deba@1186
   301
        ///
deba@1186
   302
        NodeIt(const BpGraph&, const Node&) { }
deba@1186
   303
        /// Next node.
deba@1186
   304
deba@1186
   305
        /// Assign the iterator to the next node.
deba@1186
   306
        ///
deba@1186
   307
        NodeIt& operator++() { return *this; }
deba@1186
   308
      };
deba@1186
   309
deba@1186
   310
deba@1186
   311
      /// The edge type of the graph
deba@1186
   312
deba@1186
   313
      /// This class identifies an edge of the graph. It also serves
deba@1186
   314
      /// as a base class of the edge iterators,
deba@1186
   315
      /// thus they will convert to this type.
deba@1186
   316
      class Edge {
deba@1186
   317
      public:
deba@1186
   318
        /// Default constructor
deba@1186
   319
deba@1186
   320
        /// Default constructor.
deba@1186
   321
        /// \warning It sets the object to an undefined value.
deba@1186
   322
        Edge() { }
deba@1186
   323
        /// Copy constructor.
deba@1186
   324
deba@1186
   325
        /// Copy constructor.
deba@1186
   326
        ///
deba@1186
   327
        Edge(const Edge&) { }
deba@1186
   328
        /// %Invalid constructor \& conversion.
deba@1186
   329
deba@1186
   330
        /// Initializes the object to be invalid.
deba@1186
   331
        /// \sa Invalid for more details.
deba@1186
   332
        Edge(Invalid) { }
deba@1186
   333
        /// Equality operator
deba@1186
   334
deba@1186
   335
        /// Equality operator.
deba@1186
   336
        ///
deba@1186
   337
        /// Two iterators are equal if and only if they point to the
deba@1186
   338
        /// same object or both are \c INVALID.
deba@1186
   339
        bool operator==(Edge) const { return true; }
deba@1186
   340
        /// Inequality operator
deba@1186
   341
deba@1186
   342
        /// Inequality operator.
deba@1186
   343
        bool operator!=(Edge) const { return true; }
deba@1186
   344
deba@1186
   345
        /// Artificial ordering operator.
deba@1186
   346
deba@1186
   347
        /// Artificial ordering operator.
deba@1186
   348
        ///
deba@1186
   349
        /// \note This operator only has to define some strict ordering of
deba@1186
   350
        /// the edges; this order has nothing to do with the iteration
deba@1186
   351
        /// ordering of the edges.
deba@1186
   352
        bool operator<(Edge) const { return false; }
deba@1186
   353
      };
deba@1186
   354
deba@1186
   355
      /// Iterator class for the edges.
deba@1186
   356
deba@1186
   357
      /// This iterator goes through each edge of the graph.
deba@1186
   358
      /// Its usage is quite simple, for example, you can count the number
deba@1186
   359
      /// of edges in a graph \c g of type \c %BpGraph as follows:
deba@1186
   360
      ///\code
deba@1186
   361
      /// int count=0;
deba@1186
   362
      /// for(BpGraph::EdgeIt e(g); e!=INVALID; ++e) ++count;
deba@1186
   363
      ///\endcode
deba@1186
   364
      class EdgeIt : public Edge {
deba@1186
   365
      public:
deba@1186
   366
        /// Default constructor
deba@1186
   367
deba@1186
   368
        /// Default constructor.
deba@1186
   369
        /// \warning It sets the iterator to an undefined value.
deba@1186
   370
        EdgeIt() { }
deba@1186
   371
        /// Copy constructor.
deba@1186
   372
deba@1186
   373
        /// Copy constructor.
deba@1186
   374
        ///
deba@1186
   375
        EdgeIt(const EdgeIt& e) : Edge(e) { }
deba@1186
   376
        /// %Invalid constructor \& conversion.
deba@1186
   377
deba@1186
   378
        /// Initializes the iterator to be invalid.
deba@1186
   379
        /// \sa Invalid for more details.
deba@1186
   380
        EdgeIt(Invalid) { }
deba@1186
   381
        /// Sets the iterator to the first edge.
deba@1186
   382
deba@1186
   383
        /// Sets the iterator to the first edge of the given graph.
deba@1186
   384
        ///
deba@1186
   385
        explicit EdgeIt(const BpGraph&) { }
deba@1186
   386
        /// Sets the iterator to the given edge.
deba@1186
   387
deba@1186
   388
        /// Sets the iterator to the given edge of the given graph.
deba@1186
   389
        ///
deba@1186
   390
        EdgeIt(const BpGraph&, const Edge&) { }
deba@1186
   391
        /// Next edge
deba@1186
   392
deba@1186
   393
        /// Assign the iterator to the next edge.
deba@1186
   394
        ///
deba@1186
   395
        EdgeIt& operator++() { return *this; }
deba@1186
   396
      };
deba@1186
   397
deba@1186
   398
      /// Iterator class for the incident edges of a node.
deba@1186
   399
deba@1186
   400
      /// This iterator goes trough the incident undirected edges
deba@1186
   401
      /// of a certain node of a graph.
deba@1186
   402
      /// Its usage is quite simple, for example, you can compute the
deba@1186
   403
      /// degree (i.e. the number of incident edges) of a node \c n
deba@1186
   404
      /// in a graph \c g of type \c %BpGraph as follows.
deba@1186
   405
      ///
deba@1186
   406
      ///\code
deba@1186
   407
      /// int count=0;
deba@1186
   408
      /// for(BpGraph::IncEdgeIt e(g, n); e!=INVALID; ++e) ++count;
deba@1186
   409
      ///\endcode
deba@1186
   410
      ///
deba@1186
   411
      /// \warning Loop edges will be iterated twice.
deba@1186
   412
      class IncEdgeIt : public Edge {
deba@1186
   413
      public:
deba@1186
   414
        /// Default constructor
deba@1186
   415
deba@1186
   416
        /// Default constructor.
deba@1186
   417
        /// \warning It sets the iterator to an undefined value.
deba@1186
   418
        IncEdgeIt() { }
deba@1186
   419
        /// Copy constructor.
deba@1186
   420
deba@1186
   421
        /// Copy constructor.
deba@1186
   422
        ///
deba@1186
   423
        IncEdgeIt(const IncEdgeIt& e) : Edge(e) { }
deba@1186
   424
        /// %Invalid constructor \& conversion.
deba@1186
   425
deba@1186
   426
        /// Initializes the iterator to be invalid.
deba@1186
   427
        /// \sa Invalid for more details.
deba@1186
   428
        IncEdgeIt(Invalid) { }
deba@1186
   429
        /// Sets the iterator to the first incident edge.
deba@1186
   430
deba@1186
   431
        /// Sets the iterator to the first incident edge of the given node.
deba@1186
   432
        ///
deba@1186
   433
        IncEdgeIt(const BpGraph&, const Node&) { }
deba@1186
   434
        /// Sets the iterator to the given edge.
deba@1186
   435
deba@1186
   436
        /// Sets the iterator to the given edge of the given graph.
deba@1186
   437
        ///
deba@1186
   438
        IncEdgeIt(const BpGraph&, const Edge&) { }
deba@1186
   439
        /// Next incident edge
deba@1186
   440
deba@1186
   441
        /// Assign the iterator to the next incident edge
deba@1186
   442
        /// of the corresponding node.
deba@1186
   443
        IncEdgeIt& operator++() { return *this; }
deba@1186
   444
      };
deba@1186
   445
deba@1186
   446
      /// The arc type of the graph
deba@1186
   447
deba@1186
   448
      /// This class identifies a directed arc of the graph. It also serves
deba@1186
   449
      /// as a base class of the arc iterators,
deba@1186
   450
      /// thus they will convert to this type.
deba@1186
   451
      class Arc {
deba@1186
   452
      public:
deba@1186
   453
        /// Default constructor
deba@1186
   454
deba@1186
   455
        /// Default constructor.
deba@1186
   456
        /// \warning It sets the object to an undefined value.
deba@1186
   457
        Arc() { }
deba@1186
   458
        /// Copy constructor.
deba@1186
   459
deba@1186
   460
        /// Copy constructor.
deba@1186
   461
        ///
deba@1186
   462
        Arc(const Arc&) { }
deba@1186
   463
        /// %Invalid constructor \& conversion.
deba@1186
   464
deba@1186
   465
        /// Initializes the object to be invalid.
deba@1186
   466
        /// \sa Invalid for more details.
deba@1186
   467
        Arc(Invalid) { }
deba@1186
   468
        /// Equality operator
deba@1186
   469
deba@1186
   470
        /// Equality operator.
deba@1186
   471
        ///
deba@1186
   472
        /// Two iterators are equal if and only if they point to the
deba@1186
   473
        /// same object or both are \c INVALID.
deba@1186
   474
        bool operator==(Arc) const { return true; }
deba@1186
   475
        /// Inequality operator
deba@1186
   476
deba@1186
   477
        /// Inequality operator.
deba@1186
   478
        bool operator!=(Arc) const { return true; }
deba@1186
   479
deba@1186
   480
        /// Artificial ordering operator.
deba@1186
   481
deba@1186
   482
        /// Artificial ordering operator.
deba@1186
   483
        ///
deba@1186
   484
        /// \note This operator only has to define some strict ordering of
deba@1186
   485
        /// the arcs; this order has nothing to do with the iteration
deba@1186
   486
        /// ordering of the arcs.
deba@1186
   487
        bool operator<(Arc) const { return false; }
deba@1186
   488
deba@1186
   489
        /// Converison to \c Edge
deba@1186
   490
deba@1186
   491
        /// Converison to \c Edge.
deba@1186
   492
        ///
deba@1186
   493
        operator Edge() const { return Edge(); }
deba@1186
   494
      };
deba@1186
   495
deba@1186
   496
      /// Iterator class for the arcs.
deba@1186
   497
deba@1186
   498
      /// This iterator goes through each directed arc of the graph.
deba@1186
   499
      /// Its usage is quite simple, for example, you can count the number
deba@1186
   500
      /// of arcs in a graph \c g of type \c %BpGraph as follows:
deba@1186
   501
      ///\code
deba@1186
   502
      /// int count=0;
deba@1186
   503
      /// for(BpGraph::ArcIt a(g); a!=INVALID; ++a) ++count;
deba@1186
   504
      ///\endcode
deba@1186
   505
      class ArcIt : public Arc {
deba@1186
   506
      public:
deba@1186
   507
        /// Default constructor
deba@1186
   508
deba@1186
   509
        /// Default constructor.
deba@1186
   510
        /// \warning It sets the iterator to an undefined value.
deba@1186
   511
        ArcIt() { }
deba@1186
   512
        /// Copy constructor.
deba@1186
   513
deba@1186
   514
        /// Copy constructor.
deba@1186
   515
        ///
deba@1186
   516
        ArcIt(const ArcIt& e) : Arc(e) { }
deba@1186
   517
        /// %Invalid constructor \& conversion.
deba@1186
   518
deba@1186
   519
        /// Initializes the iterator to be invalid.
deba@1186
   520
        /// \sa Invalid for more details.
deba@1186
   521
        ArcIt(Invalid) { }
deba@1186
   522
        /// Sets the iterator to the first arc.
deba@1186
   523
deba@1186
   524
        /// Sets the iterator to the first arc of the given graph.
deba@1186
   525
        ///
alpar@1262
   526
        explicit ArcIt(const BpGraph &g)
alpar@1262
   527
        {
alpar@1262
   528
          ::lemon::ignore_unused_variable_warning(g);
alpar@1262
   529
        }
deba@1186
   530
        /// Sets the iterator to the given arc.
deba@1186
   531
deba@1186
   532
        /// Sets the iterator to the given arc of the given graph.
deba@1186
   533
        ///
deba@1186
   534
        ArcIt(const BpGraph&, const Arc&) { }
deba@1186
   535
        /// Next arc
deba@1186
   536
deba@1186
   537
        /// Assign the iterator to the next arc.
deba@1186
   538
        ///
deba@1186
   539
        ArcIt& operator++() { return *this; }
deba@1186
   540
      };
deba@1186
   541
deba@1186
   542
      /// Iterator class for the outgoing arcs of a node.
deba@1186
   543
deba@1186
   544
      /// This iterator goes trough the \e outgoing directed arcs of a
deba@1186
   545
      /// certain node of a graph.
deba@1186
   546
      /// Its usage is quite simple, for example, you can count the number
deba@1186
   547
      /// of outgoing arcs of a node \c n
deba@1186
   548
      /// in a graph \c g of type \c %BpGraph as follows.
deba@1186
   549
      ///\code
deba@1186
   550
      /// int count=0;
deba@1186
   551
      /// for (Digraph::OutArcIt a(g, n); a!=INVALID; ++a) ++count;
deba@1186
   552
      ///\endcode
deba@1186
   553
      class OutArcIt : public Arc {
deba@1186
   554
      public:
deba@1186
   555
        /// Default constructor
deba@1186
   556
deba@1186
   557
        /// Default constructor.
deba@1186
   558
        /// \warning It sets the iterator to an undefined value.
deba@1186
   559
        OutArcIt() { }
deba@1186
   560
        /// Copy constructor.
deba@1186
   561
deba@1186
   562
        /// Copy constructor.
deba@1186
   563
        ///
deba@1186
   564
        OutArcIt(const OutArcIt& e) : Arc(e) { }
deba@1186
   565
        /// %Invalid constructor \& conversion.
deba@1186
   566
deba@1186
   567
        /// Initializes the iterator to be invalid.
deba@1186
   568
        /// \sa Invalid for more details.
deba@1186
   569
        OutArcIt(Invalid) { }
deba@1186
   570
        /// Sets the iterator to the first outgoing arc.
deba@1186
   571
deba@1186
   572
        /// Sets the iterator to the first outgoing arc of the given node.
deba@1186
   573
        ///
deba@1186
   574
        OutArcIt(const BpGraph& n, const Node& g) {
alpar@1262
   575
          ::lemon::ignore_unused_variable_warning(n);
alpar@1262
   576
          ::lemon::ignore_unused_variable_warning(g);
deba@1186
   577
        }
deba@1186
   578
        /// Sets the iterator to the given arc.
deba@1186
   579
deba@1186
   580
        /// Sets the iterator to the given arc of the given graph.
deba@1186
   581
        ///
deba@1186
   582
        OutArcIt(const BpGraph&, const Arc&) { }
deba@1186
   583
        /// Next outgoing arc
deba@1186
   584
deba@1186
   585
        /// Assign the iterator to the next
deba@1186
   586
        /// outgoing arc of the corresponding node.
deba@1186
   587
        OutArcIt& operator++() { return *this; }
deba@1186
   588
      };
deba@1186
   589
deba@1186
   590
      /// Iterator class for the incoming arcs of a node.
deba@1186
   591
deba@1186
   592
      /// This iterator goes trough the \e incoming directed arcs of a
deba@1186
   593
      /// certain node of a graph.
deba@1186
   594
      /// Its usage is quite simple, for example, you can count the number
deba@1186
   595
      /// of incoming arcs of a node \c n
deba@1186
   596
      /// in a graph \c g of type \c %BpGraph as follows.
deba@1186
   597
      ///\code
deba@1186
   598
      /// int count=0;
deba@1186
   599
      /// for (Digraph::InArcIt a(g, n); a!=INVALID; ++a) ++count;
deba@1186
   600
      ///\endcode
deba@1186
   601
      class InArcIt : public Arc {
deba@1186
   602
      public:
deba@1186
   603
        /// Default constructor
deba@1186
   604
deba@1186
   605
        /// Default constructor.
deba@1186
   606
        /// \warning It sets the iterator to an undefined value.
deba@1186
   607
        InArcIt() { }
deba@1186
   608
        /// Copy constructor.
deba@1186
   609
deba@1186
   610
        /// Copy constructor.
deba@1186
   611
        ///
deba@1186
   612
        InArcIt(const InArcIt& e) : Arc(e) { }
deba@1186
   613
        /// %Invalid constructor \& conversion.
deba@1186
   614
deba@1186
   615
        /// Initializes the iterator to be invalid.
deba@1186
   616
        /// \sa Invalid for more details.
deba@1186
   617
        InArcIt(Invalid) { }
deba@1186
   618
        /// Sets the iterator to the first incoming arc.
deba@1186
   619
deba@1186
   620
        /// Sets the iterator to the first incoming arc of the given node.
deba@1186
   621
        ///
deba@1186
   622
        InArcIt(const BpGraph& g, const Node& n) {
alpar@1262
   623
          ::lemon::ignore_unused_variable_warning(n);
alpar@1262
   624
          ::lemon::ignore_unused_variable_warning(g);
deba@1186
   625
        }
deba@1186
   626
        /// Sets the iterator to the given arc.
deba@1186
   627
deba@1186
   628
        /// Sets the iterator to the given arc of the given graph.
deba@1186
   629
        ///
deba@1186
   630
        InArcIt(const BpGraph&, const Arc&) { }
deba@1186
   631
        /// Next incoming arc
deba@1186
   632
deba@1186
   633
        /// Assign the iterator to the next
deba@1186
   634
        /// incoming arc of the corresponding node.
deba@1186
   635
        InArcIt& operator++() { return *this; }
deba@1186
   636
      };
deba@1186
   637
deba@1186
   638
      /// \brief Standard graph map type for the nodes.
deba@1186
   639
      ///
deba@1186
   640
      /// Standard graph map type for the nodes.
deba@1186
   641
      /// It conforms to the ReferenceMap concept.
deba@1186
   642
      template<class T>
deba@1186
   643
      class NodeMap : public ReferenceMap<Node, T, T&, const T&>
deba@1186
   644
      {
deba@1186
   645
      public:
deba@1186
   646
deba@1186
   647
        /// Constructor
deba@1186
   648
        explicit NodeMap(const BpGraph&) { }
deba@1186
   649
        /// Constructor with given initial value
deba@1186
   650
        NodeMap(const BpGraph&, T) { }
deba@1186
   651
deba@1186
   652
      private:
deba@1186
   653
        ///Copy constructor
deba@1186
   654
        NodeMap(const NodeMap& nm) :
deba@1186
   655
          ReferenceMap<Node, T, T&, const T&>(nm) { }
deba@1186
   656
        ///Assignment operator
deba@1186
   657
        template <typename CMap>
deba@1186
   658
        NodeMap& operator=(const CMap&) {
deba@1186
   659
          checkConcept<ReadMap<Node, T>, CMap>();
deba@1186
   660
          return *this;
deba@1186
   661
        }
deba@1186
   662
      };
deba@1186
   663
deba@1186
   664
      /// \brief Standard graph map type for the red nodes.
deba@1186
   665
      ///
deba@1186
   666
      /// Standard graph map type for the red nodes.
deba@1186
   667
      /// It conforms to the ReferenceMap concept.
deba@1186
   668
      template<class T>
deba@1194
   669
      class RedNodeMap : public ReferenceMap<Node, T, T&, const T&>
deba@1186
   670
      {
deba@1186
   671
      public:
deba@1186
   672
deba@1186
   673
        /// Constructor
deba@1194
   674
        explicit RedNodeMap(const BpGraph&) { }
deba@1186
   675
        /// Constructor with given initial value
deba@1194
   676
        RedNodeMap(const BpGraph&, T) { }
deba@1186
   677
deba@1186
   678
      private:
deba@1186
   679
        ///Copy constructor
deba@1194
   680
        RedNodeMap(const RedNodeMap& nm) :
deba@1186
   681
          ReferenceMap<Node, T, T&, const T&>(nm) { }
deba@1186
   682
        ///Assignment operator
deba@1186
   683
        template <typename CMap>
deba@1194
   684
        RedNodeMap& operator=(const CMap&) {
deba@1186
   685
          checkConcept<ReadMap<Node, T>, CMap>();
deba@1186
   686
          return *this;
deba@1186
   687
        }
deba@1186
   688
      };
deba@1186
   689
deba@1186
   690
      /// \brief Standard graph map type for the blue nodes.
deba@1186
   691
      ///
deba@1186
   692
      /// Standard graph map type for the blue nodes.
deba@1186
   693
      /// It conforms to the ReferenceMap concept.
deba@1186
   694
      template<class T>
deba@1194
   695
      class BlueNodeMap : public ReferenceMap<Node, T, T&, const T&>
deba@1186
   696
      {
deba@1186
   697
      public:
deba@1186
   698
deba@1186
   699
        /// Constructor
deba@1194
   700
        explicit BlueNodeMap(const BpGraph&) { }
deba@1186
   701
        /// Constructor with given initial value
deba@1194
   702
        BlueNodeMap(const BpGraph&, T) { }
deba@1186
   703
deba@1186
   704
      private:
deba@1186
   705
        ///Copy constructor
deba@1194
   706
        BlueNodeMap(const BlueNodeMap& nm) :
deba@1186
   707
          ReferenceMap<Node, T, T&, const T&>(nm) { }
deba@1186
   708
        ///Assignment operator
deba@1186
   709
        template <typename CMap>
deba@1194
   710
        BlueNodeMap& operator=(const CMap&) {
deba@1186
   711
          checkConcept<ReadMap<Node, T>, CMap>();
deba@1186
   712
          return *this;
deba@1186
   713
        }
deba@1186
   714
      };
deba@1186
   715
deba@1186
   716
      /// \brief Standard graph map type for the arcs.
deba@1186
   717
      ///
deba@1186
   718
      /// Standard graph map type for the arcs.
deba@1186
   719
      /// It conforms to the ReferenceMap concept.
deba@1186
   720
      template<class T>
deba@1186
   721
      class ArcMap : public ReferenceMap<Arc, T, T&, const T&>
deba@1186
   722
      {
deba@1186
   723
      public:
deba@1186
   724
deba@1186
   725
        /// Constructor
deba@1186
   726
        explicit ArcMap(const BpGraph&) { }
deba@1186
   727
        /// Constructor with given initial value
deba@1186
   728
        ArcMap(const BpGraph&, T) { }
deba@1186
   729
deba@1186
   730
      private:
deba@1186
   731
        ///Copy constructor
deba@1186
   732
        ArcMap(const ArcMap& em) :
deba@1186
   733
          ReferenceMap<Arc, T, T&, const T&>(em) { }
deba@1186
   734
        ///Assignment operator
deba@1186
   735
        template <typename CMap>
deba@1186
   736
        ArcMap& operator=(const CMap&) {
deba@1186
   737
          checkConcept<ReadMap<Arc, T>, CMap>();
deba@1186
   738
          return *this;
deba@1186
   739
        }
deba@1186
   740
      };
deba@1186
   741
deba@1186
   742
      /// \brief Standard graph map type for the edges.
deba@1186
   743
      ///
deba@1186
   744
      /// Standard graph map type for the edges.
deba@1186
   745
      /// It conforms to the ReferenceMap concept.
deba@1186
   746
      template<class T>
deba@1186
   747
      class EdgeMap : public ReferenceMap<Edge, T, T&, const T&>
deba@1186
   748
      {
deba@1186
   749
      public:
deba@1186
   750
deba@1186
   751
        /// Constructor
deba@1186
   752
        explicit EdgeMap(const BpGraph&) { }
deba@1186
   753
        /// Constructor with given initial value
deba@1186
   754
        EdgeMap(const BpGraph&, T) { }
deba@1186
   755
deba@1186
   756
      private:
deba@1186
   757
        ///Copy constructor
deba@1186
   758
        EdgeMap(const EdgeMap& em) :
deba@1186
   759
          ReferenceMap<Edge, T, T&, const T&>(em) {}
deba@1186
   760
        ///Assignment operator
deba@1186
   761
        template <typename CMap>
deba@1186
   762
        EdgeMap& operator=(const CMap&) {
deba@1186
   763
          checkConcept<ReadMap<Edge, T>, CMap>();
deba@1186
   764
          return *this;
deba@1186
   765
        }
deba@1186
   766
      };
deba@1186
   767
deba@1186
   768
      /// \brief Gives back %true for red nodes.
deba@1186
   769
      ///
deba@1186
   770
      /// Gives back %true for red nodes.
deba@1186
   771
      bool red(const Node&) const { return true; }
deba@1186
   772
deba@1186
   773
      /// \brief Gives back %true for blue nodes.
deba@1186
   774
      ///
deba@1186
   775
      /// Gives back %true for blue nodes.
deba@1186
   776
      bool blue(const Node&) const { return true; }
deba@1186
   777
deba@1193
   778
      /// \brief Converts the node to red node object.
deba@1193
   779
      ///
deba@1196
   780
      /// This function converts unsafely the node to red node
deba@1193
   781
      /// object. It should be called only if the node is from the red
deba@1193
   782
      /// partition or INVALID.
deba@1193
   783
      RedNode asRedNodeUnsafe(const Node&) const { return RedNode(); }
deba@1193
   784
deba@1193
   785
      /// \brief Converts the node to blue node object.
deba@1193
   786
      ///
deba@1196
   787
      /// This function converts unsafely the node to blue node
deba@1193
   788
      /// object. It should be called only if the node is from the red
deba@1193
   789
      /// partition or INVALID.
deba@1193
   790
      BlueNode asBlueNodeUnsafe(const Node&) const { return BlueNode(); }
deba@1193
   791
deba@1193
   792
      /// \brief Converts the node to red node object.
deba@1193
   793
      ///
deba@1196
   794
      /// This function converts safely the node to red node
deba@1193
   795
      /// object. If the node is not from the red partition, then it
deba@1193
   796
      /// returns INVALID.
deba@1193
   797
      RedNode asRedNode(const Node&) const { return RedNode(); }
deba@1193
   798
deba@1193
   799
      /// \brief Converts the node to blue node object.
deba@1193
   800
      ///
deba@1196
   801
      /// This function converts unsafely the node to blue node
deba@1193
   802
      /// object. If the node is not from the blue partition, then it
deba@1193
   803
      /// returns INVALID.
deba@1193
   804
      BlueNode asBlueNode(const Node&) const { return BlueNode(); }
deba@1193
   805
deba@1186
   806
      /// \brief Gives back the red end node of the edge.
deba@1186
   807
      /// 
deba@1186
   808
      /// Gives back the red end node of the edge.
deba@1193
   809
      RedNode redNode(const Edge&) const { return RedNode(); }
deba@1186
   810
deba@1186
   811
      /// \brief Gives back the blue end node of the edge.
deba@1186
   812
      /// 
deba@1186
   813
      /// Gives back the blue end node of the edge.
deba@1193
   814
      BlueNode blueNode(const Edge&) const { return BlueNode(); }
deba@1186
   815
deba@1186
   816
      /// \brief The first node of the edge.
deba@1186
   817
      ///
deba@1186
   818
      /// It is a synonim for the \c redNode().
deba@1186
   819
      Node u(Edge) const { return INVALID; }
deba@1186
   820
deba@1186
   821
      /// \brief The second node of the edge.
deba@1186
   822
      ///
deba@1186
   823
      /// It is a synonim for the \c blueNode().
deba@1186
   824
      Node v(Edge) const { return INVALID; }
deba@1186
   825
deba@1186
   826
      /// \brief The source node of the arc.
deba@1186
   827
      ///
deba@1186
   828
      /// Returns the source node of the given arc.
deba@1186
   829
      Node source(Arc) const { return INVALID; }
deba@1186
   830
deba@1186
   831
      /// \brief The target node of the arc.
deba@1186
   832
      ///
deba@1186
   833
      /// Returns the target node of the given arc.
deba@1186
   834
      Node target(Arc) const { return INVALID; }
deba@1186
   835
deba@1186
   836
      /// \brief The ID of the node.
deba@1186
   837
      ///
deba@1186
   838
      /// Returns the ID of the given node.
deba@1186
   839
      int id(Node) const { return -1; }
deba@1186
   840
deba@1186
   841
      /// \brief The red ID of the node.
deba@1186
   842
      ///
deba@1186
   843
      /// Returns the red ID of the given node.
deba@1186
   844
      int id(RedNode) const { return -1; }
deba@1186
   845
deba@1186
   846
      /// \brief The blue ID of the node.
deba@1186
   847
      ///
deba@1186
   848
      /// Returns the blue ID of the given node.
deba@1186
   849
      int id(BlueNode) const { return -1; }
deba@1186
   850
deba@1186
   851
      /// \brief The ID of the edge.
deba@1186
   852
      ///
deba@1186
   853
      /// Returns the ID of the given edge.
deba@1186
   854
      int id(Edge) const { return -1; }
deba@1186
   855
deba@1186
   856
      /// \brief The ID of the arc.
deba@1186
   857
      ///
deba@1186
   858
      /// Returns the ID of the given arc.
deba@1186
   859
      int id(Arc) const { return -1; }
deba@1186
   860
deba@1186
   861
      /// \brief The node with the given ID.
deba@1186
   862
      ///
deba@1186
   863
      /// Returns the node with the given ID.
deba@1186
   864
      /// \pre The argument should be a valid node ID in the graph.
deba@1186
   865
      Node nodeFromId(int) const { return INVALID; }
deba@1186
   866
deba@1186
   867
      /// \brief The edge with the given ID.
deba@1186
   868
      ///
deba@1186
   869
      /// Returns the edge with the given ID.
deba@1186
   870
      /// \pre The argument should be a valid edge ID in the graph.
deba@1186
   871
      Edge edgeFromId(int) const { return INVALID; }
deba@1186
   872
deba@1186
   873
      /// \brief The arc with the given ID.
deba@1186
   874
      ///
deba@1186
   875
      /// Returns the arc with the given ID.
deba@1186
   876
      /// \pre The argument should be a valid arc ID in the graph.
deba@1186
   877
      Arc arcFromId(int) const { return INVALID; }
deba@1186
   878
deba@1186
   879
      /// \brief An upper bound on the node IDs.
deba@1186
   880
      ///
deba@1186
   881
      /// Returns an upper bound on the node IDs.
deba@1186
   882
      int maxNodeId() const { return -1; }
deba@1186
   883
deba@1186
   884
      /// \brief An upper bound on the red IDs.
deba@1186
   885
      ///
deba@1186
   886
      /// Returns an upper bound on the red IDs.
deba@1186
   887
      int maxRedId() const { return -1; }
deba@1186
   888
deba@1186
   889
      /// \brief An upper bound on the blue IDs.
deba@1186
   890
      ///
deba@1186
   891
      /// Returns an upper bound on the blue IDs.
deba@1186
   892
      int maxBlueId() const { return -1; }
deba@1186
   893
deba@1186
   894
      /// \brief An upper bound on the edge IDs.
deba@1186
   895
      ///
deba@1186
   896
      /// Returns an upper bound on the edge IDs.
deba@1186
   897
      int maxEdgeId() const { return -1; }
deba@1186
   898
deba@1186
   899
      /// \brief An upper bound on the arc IDs.
deba@1186
   900
      ///
deba@1186
   901
      /// Returns an upper bound on the arc IDs.
deba@1186
   902
      int maxArcId() const { return -1; }
deba@1186
   903
deba@1186
   904
      /// \brief The direction of the arc.
deba@1186
   905
      ///
deba@1186
   906
      /// Returns \c true if the given arc goes from a red node to a blue node.
deba@1186
   907
      bool direction(Arc) const { return true; }
deba@1186
   908
deba@1186
   909
      /// \brief Direct the edge.
deba@1186
   910
      ///
deba@1186
   911
      /// Direct the given edge. The returned arc
deba@1186
   912
      /// represents the given edge and its direction comes
deba@1186
   913
      /// from the bool parameter. If it is \c true, then the source of the node
deba@1186
   914
      /// will be a red node.
deba@1186
   915
      Arc direct(Edge, bool) const {
deba@1186
   916
        return INVALID;
deba@1186
   917
      }
deba@1186
   918
deba@1186
   919
      /// \brief Direct the edge.
deba@1186
   920
      ///
deba@1186
   921
      /// Direct the given edge. The returned arc represents the given
deba@1186
   922
      /// edge and its source node is the given node.
deba@1186
   923
      Arc direct(Edge, Node) const {
deba@1186
   924
        return INVALID;
deba@1186
   925
      }
deba@1186
   926
deba@1186
   927
      /// \brief The oppositely directed arc.
deba@1186
   928
      ///
deba@1186
   929
      /// Returns the oppositely directed arc representing the same edge.
deba@1186
   930
      Arc oppositeArc(Arc) const { return INVALID; }
deba@1186
   931
deba@1186
   932
      /// \brief The opposite node on the edge.
deba@1186
   933
      ///
deba@1186
   934
      /// Returns the opposite node on the given edge.
deba@1186
   935
      Node oppositeNode(Node, Edge) const { return INVALID; }
deba@1186
   936
deba@1186
   937
      void first(Node&) const {}
deba@1186
   938
      void next(Node&) const {}
deba@1186
   939
deba@1193
   940
      void firstRed(RedNode&) const {}
deba@1193
   941
      void nextRed(RedNode&) const {}
deba@1186
   942
deba@1193
   943
      void firstBlue(BlueNode&) const {}
deba@1193
   944
      void nextBlue(BlueNode&) const {}
deba@1186
   945
deba@1186
   946
      void first(Edge&) const {}
deba@1186
   947
      void next(Edge&) const {}
deba@1186
   948
deba@1186
   949
      void first(Arc&) const {}
deba@1186
   950
      void next(Arc&) const {}
deba@1186
   951
deba@1186
   952
      void firstOut(Arc&, Node) const {}
deba@1186
   953
      void nextOut(Arc&) const {}
deba@1186
   954
deba@1186
   955
      void firstIn(Arc&, Node) const {}
deba@1186
   956
      void nextIn(Arc&) const {}
deba@1186
   957
deba@1186
   958
      void firstInc(Edge &, bool &, const Node &) const {}
deba@1186
   959
      void nextInc(Edge &, bool &) const {}
deba@1186
   960
deba@1186
   961
      // The second parameter is dummy.
deba@1186
   962
      Node fromId(int, Node) const { return INVALID; }
deba@1186
   963
      // The second parameter is dummy.
deba@1186
   964
      Edge fromId(int, Edge) const { return INVALID; }
deba@1186
   965
      // The second parameter is dummy.
deba@1186
   966
      Arc fromId(int, Arc) const { return INVALID; }
deba@1186
   967
deba@1186
   968
      // Dummy parameter.
deba@1186
   969
      int maxId(Node) const { return -1; }
deba@1186
   970
      // Dummy parameter.
deba@1186
   971
      int maxId(RedNode) const { return -1; }
deba@1186
   972
      // Dummy parameter.
deba@1186
   973
      int maxId(BlueNode) const { return -1; }
deba@1186
   974
      // Dummy parameter.
deba@1186
   975
      int maxId(Edge) const { return -1; }
deba@1186
   976
      // Dummy parameter.
deba@1186
   977
      int maxId(Arc) const { return -1; }
deba@1186
   978
deba@1186
   979
      /// \brief The base node of the iterator.
deba@1186
   980
      ///
deba@1186
   981
      /// Returns the base node of the given incident edge iterator.
deba@1186
   982
      Node baseNode(IncEdgeIt) const { return INVALID; }
deba@1186
   983
deba@1186
   984
      /// \brief The running node of the iterator.
deba@1186
   985
      ///
deba@1186
   986
      /// Returns the running node of the given incident edge iterator.
deba@1186
   987
      Node runningNode(IncEdgeIt) const { return INVALID; }
deba@1186
   988
deba@1186
   989
      /// \brief The base node of the iterator.
deba@1186
   990
      ///
deba@1186
   991
      /// Returns the base node of the given outgoing arc iterator
deba@1186
   992
      /// (i.e. the source node of the corresponding arc).
deba@1186
   993
      Node baseNode(OutArcIt) const { return INVALID; }
deba@1186
   994
deba@1186
   995
      /// \brief The running node of the iterator.
deba@1186
   996
      ///
deba@1186
   997
      /// Returns the running node of the given outgoing arc iterator
deba@1186
   998
      /// (i.e. the target node of the corresponding arc).
deba@1186
   999
      Node runningNode(OutArcIt) const { return INVALID; }
deba@1186
  1000
deba@1186
  1001
      /// \brief The base node of the iterator.
deba@1186
  1002
      ///
kpeter@1217
  1003
      /// Returns the base node of the given incoming arc iterator
deba@1186
  1004
      /// (i.e. the target node of the corresponding arc).
deba@1186
  1005
      Node baseNode(InArcIt) const { return INVALID; }
deba@1186
  1006
deba@1186
  1007
      /// \brief The running node of the iterator.
deba@1186
  1008
      ///
kpeter@1217
  1009
      /// Returns the running node of the given incoming arc iterator
deba@1186
  1010
      /// (i.e. the source node of the corresponding arc).
deba@1186
  1011
      Node runningNode(InArcIt) const { return INVALID; }
deba@1186
  1012
deba@1186
  1013
      template <typename _BpGraph>
deba@1186
  1014
      struct Constraints {
deba@1186
  1015
        void constraints() {
deba@1186
  1016
          checkConcept<BaseBpGraphComponent, _BpGraph>();
deba@1186
  1017
          checkConcept<IterableBpGraphComponent<>, _BpGraph>();
deba@1186
  1018
          checkConcept<IDableBpGraphComponent<>, _BpGraph>();
deba@1186
  1019
          checkConcept<MappableBpGraphComponent<>, _BpGraph>();
deba@1186
  1020
        }
deba@1186
  1021
      };
deba@1186
  1022
deba@1186
  1023
    };
deba@1186
  1024
deba@1186
  1025
  }
deba@1186
  1026
deba@1186
  1027
}
deba@1186
  1028
deba@1186
  1029
#endif