1 /* -*- mode: C++; indent-tabs-mode: nil; -*-
3 * This file is a part of LEMON, a generic C++ optimization library.
5 * Copyright (C) 2003-2010
6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
7 * (Egervary Research Group on Combinatorial Optimization, EGRES).
9 * Permission to use, modify and distribute this software is granted
10 * provided that this copyright notice appears in all copies. For
11 * precise terms see the accompanying LICENSE file.
13 * This software is provided "AS IS" with no warranty of any kind,
14 * express or implied, and with no claim as to its suitability for any
19 ///\ingroup graph_concepts
21 ///\brief The concept of undirected graphs.
23 #ifndef LEMON_CONCEPTS_BPGRAPH_H
24 #define LEMON_CONCEPTS_BPGRAPH_H
26 #include <lemon/concepts/graph_components.h>
27 #include <lemon/concepts/maps.h>
28 #include <lemon/concept_check.h>
29 #include <lemon/core.h>
34 /// \ingroup graph_concepts
36 /// \brief Class describing the concept of undirected bipartite graphs.
38 /// This class describes the common interface of all undirected
41 /// Like all concept classes, it only provides an interface
42 /// without any sensible implementation. So any general algorithm for
43 /// undirected bipartite graphs should compile with this class,
44 /// but it will not run properly, of course.
45 /// An actual graph implementation like \ref ListBpGraph or
46 /// \ref SmartBpGraph may have additional functionality.
48 /// The bipartite graphs also fulfill the concept of \ref Graph
49 /// "undirected graphs". Bipartite graphs provide a bipartition of
50 /// the node set, namely a red and blue set of the nodes. The
51 /// nodes can be iterated with the RedIt and BlueIt in the two
52 /// node sets. With RedMap and BlueMap values can be assigned to
53 /// the nodes in the two sets.
55 /// The edges of the graph cannot connect two nodes of the same
56 /// set. The edges inherent orientation is from the red nodes to
62 /// BpGraphs are \e not copy constructible. Use bpGraphCopy instead.
63 BpGraph(const BpGraph&) {}
64 /// \brief Assignment of a graph to another one is \e not allowed.
65 /// Use bpGraphCopy instead.
66 void operator=(const BpGraph&) {}
69 /// Default constructor.
72 /// \brief Undirected graphs should be tagged with \c UndirectedTag.
74 /// Undirected graphs should be tagged with \c UndirectedTag.
76 /// This tag helps the \c enable_if technics to make compile time
77 /// specializations for undirected graphs.
78 typedef True UndirectedTag;
80 /// The node type of the graph
82 /// This class identifies a node of the graph. It also serves
83 /// as a base class of the node iterators,
84 /// thus they convert to this type.
87 /// Default constructor
89 /// Default constructor.
90 /// \warning It sets the object to an undefined value.
98 /// %Invalid constructor \& conversion.
100 /// Initializes the object to be invalid.
101 /// \sa Invalid for more details.
103 /// Equality operator
105 /// Equality operator.
107 /// Two iterators are equal if and only if they point to the
108 /// same object or both are \c INVALID.
109 bool operator==(Node) const { return true; }
111 /// Inequality operator
113 /// Inequality operator.
114 bool operator!=(Node) const { return true; }
116 /// Artificial ordering operator.
118 /// Artificial ordering operator.
120 /// \note This operator only has to define some strict ordering of
121 /// the items; this order has nothing to do with the iteration
122 /// ordering of the items.
123 bool operator<(Node) const { return false; }
127 /// Class to represent red nodes.
129 /// This class represents the red nodes of the graph. It does
130 /// not supposed to be used directly, because the nodes can be
131 /// represented as Node instances. This class can be used as
132 /// template parameter for special map classes.
133 class RedNode : public Node {
135 /// Default constructor
137 /// Default constructor.
138 /// \warning It sets the object to an undefined value.
140 /// Copy constructor.
142 /// Copy constructor.
144 RedNode(const RedNode&) : Node() { }
146 /// %Invalid constructor \& conversion.
148 /// Initializes the object to be invalid.
149 /// \sa Invalid for more details.
152 /// Constructor for conversion from a node.
154 /// Constructor for conversion from a node. The conversion can
155 /// be invalid, since the Node can be member of the blue
157 RedNode(const Node&) {}
160 /// Class to represent blue nodes.
162 /// This class represents the blue nodes of the graph. It does
163 /// not supposed to be used directly, because the nodes can be
164 /// represented as Node instances. This class can be used as
165 /// template parameter for special map classes.
166 class BlueNode : public Node {
168 /// Default constructor
170 /// Default constructor.
171 /// \warning It sets the object to an undefined value.
173 /// Copy constructor.
175 /// Copy constructor.
177 BlueNode(const BlueNode&) : Node() { }
179 /// %Invalid constructor \& conversion.
181 /// Initializes the object to be invalid.
182 /// \sa Invalid for more details.
183 BlueNode(Invalid) { }
185 /// Constructor for conversion from a node.
187 /// Constructor for conversion from a node. The conversion can
188 /// be invalid, since the Node can be member of the red
190 BlueNode(const Node&) {}
193 /// Iterator class for the red nodes.
195 /// This iterator goes through each red node of the graph.
196 /// Its usage is quite simple, for example, you can count the number
197 /// of red nodes in a graph \c g of type \c %BpGraph like this:
200 /// for (BpGraph::RedNodeIt n(g); n!=INVALID; ++n) ++count;
202 class RedIt : public Node {
204 /// Default constructor
206 /// Default constructor.
207 /// \warning It sets the iterator to an undefined value.
209 /// Copy constructor.
211 /// Copy constructor.
213 RedIt(const RedIt& n) : Node(n) { }
214 /// %Invalid constructor \& conversion.
216 /// Initializes the iterator to be invalid.
217 /// \sa Invalid for more details.
219 /// Sets the iterator to the first red node.
221 /// Sets the iterator to the first red node of the given
223 explicit RedIt(const BpGraph&) { }
224 /// Sets the iterator to the given red node.
226 /// Sets the iterator to the given red node of the given
228 RedIt(const BpGraph&, const Node&) { }
231 /// Assign the iterator to the next red node.
233 RedIt& operator++() { return *this; }
236 /// Iterator class for the blue nodes.
238 /// This iterator goes through each blue node of the graph.
239 /// Its usage is quite simple, for example, you can count the number
240 /// of blue nodes in a graph \c g of type \c %BpGraph like this:
243 /// for (BpGraph::BlueNodeIt n(g); n!=INVALID; ++n) ++count;
245 class BlueIt : public Node {
247 /// Default constructor
249 /// Default constructor.
250 /// \warning It sets the iterator to an undefined value.
252 /// Copy constructor.
254 /// Copy constructor.
256 BlueIt(const BlueIt& n) : Node(n) { }
257 /// %Invalid constructor \& conversion.
259 /// Initializes the iterator to be invalid.
260 /// \sa Invalid for more details.
262 /// Sets the iterator to the first blue node.
264 /// Sets the iterator to the first blue node of the given
266 explicit BlueIt(const BpGraph&) { }
267 /// Sets the iterator to the given blue node.
269 /// Sets the iterator to the given blue node of the given
271 BlueIt(const BpGraph&, const Node&) { }
274 /// Assign the iterator to the next blue node.
276 BlueIt& operator++() { return *this; }
279 /// Iterator class for the nodes.
281 /// This iterator goes through each node of the graph.
282 /// Its usage is quite simple, for example, you can count the number
283 /// of nodes in a graph \c g of type \c %BpGraph like this:
286 /// for (BpGraph::NodeIt n(g); n!=INVALID; ++n) ++count;
288 class NodeIt : public Node {
290 /// Default constructor
292 /// Default constructor.
293 /// \warning It sets the iterator to an undefined value.
295 /// Copy constructor.
297 /// Copy constructor.
299 NodeIt(const NodeIt& n) : Node(n) { }
300 /// %Invalid constructor \& conversion.
302 /// Initializes the iterator to be invalid.
303 /// \sa Invalid for more details.
305 /// Sets the iterator to the first node.
307 /// Sets the iterator to the first node of the given digraph.
309 explicit NodeIt(const BpGraph&) { }
310 /// Sets the iterator to the given node.
312 /// Sets the iterator to the given node of the given digraph.
314 NodeIt(const BpGraph&, const Node&) { }
317 /// Assign the iterator to the next node.
319 NodeIt& operator++() { return *this; }
323 /// The edge type of the graph
325 /// This class identifies an edge of the graph. It also serves
326 /// as a base class of the edge iterators,
327 /// thus they will convert to this type.
330 /// Default constructor
332 /// Default constructor.
333 /// \warning It sets the object to an undefined value.
335 /// Copy constructor.
337 /// Copy constructor.
339 Edge(const Edge&) { }
340 /// %Invalid constructor \& conversion.
342 /// Initializes the object to be invalid.
343 /// \sa Invalid for more details.
345 /// Equality operator
347 /// Equality operator.
349 /// Two iterators are equal if and only if they point to the
350 /// same object or both are \c INVALID.
351 bool operator==(Edge) const { return true; }
352 /// Inequality operator
354 /// Inequality operator.
355 bool operator!=(Edge) const { return true; }
357 /// Artificial ordering operator.
359 /// Artificial ordering operator.
361 /// \note This operator only has to define some strict ordering of
362 /// the edges; this order has nothing to do with the iteration
363 /// ordering of the edges.
364 bool operator<(Edge) const { return false; }
367 /// Iterator class for the edges.
369 /// This iterator goes through each edge of the graph.
370 /// Its usage is quite simple, for example, you can count the number
371 /// of edges in a graph \c g of type \c %BpGraph as follows:
374 /// for(BpGraph::EdgeIt e(g); e!=INVALID; ++e) ++count;
376 class EdgeIt : public Edge {
378 /// Default constructor
380 /// Default constructor.
381 /// \warning It sets the iterator to an undefined value.
383 /// Copy constructor.
385 /// Copy constructor.
387 EdgeIt(const EdgeIt& e) : Edge(e) { }
388 /// %Invalid constructor \& conversion.
390 /// Initializes the iterator to be invalid.
391 /// \sa Invalid for more details.
393 /// Sets the iterator to the first edge.
395 /// Sets the iterator to the first edge of the given graph.
397 explicit EdgeIt(const BpGraph&) { }
398 /// Sets the iterator to the given edge.
400 /// Sets the iterator to the given edge of the given graph.
402 EdgeIt(const BpGraph&, const Edge&) { }
405 /// Assign the iterator to the next edge.
407 EdgeIt& operator++() { return *this; }
410 /// Iterator class for the incident edges of a node.
412 /// This iterator goes trough the incident undirected edges
413 /// of a certain node of a graph.
414 /// Its usage is quite simple, for example, you can compute the
415 /// degree (i.e. the number of incident edges) of a node \c n
416 /// in a graph \c g of type \c %BpGraph as follows.
420 /// for(BpGraph::IncEdgeIt e(g, n); e!=INVALID; ++e) ++count;
423 /// \warning Loop edges will be iterated twice.
424 class IncEdgeIt : public Edge {
426 /// Default constructor
428 /// Default constructor.
429 /// \warning It sets the iterator to an undefined value.
431 /// Copy constructor.
433 /// Copy constructor.
435 IncEdgeIt(const IncEdgeIt& e) : Edge(e) { }
436 /// %Invalid constructor \& conversion.
438 /// Initializes the iterator to be invalid.
439 /// \sa Invalid for more details.
440 IncEdgeIt(Invalid) { }
441 /// Sets the iterator to the first incident edge.
443 /// Sets the iterator to the first incident edge of the given node.
445 IncEdgeIt(const BpGraph&, const Node&) { }
446 /// Sets the iterator to the given edge.
448 /// Sets the iterator to the given edge of the given graph.
450 IncEdgeIt(const BpGraph&, const Edge&) { }
451 /// Next incident edge
453 /// Assign the iterator to the next incident edge
454 /// of the corresponding node.
455 IncEdgeIt& operator++() { return *this; }
458 /// The arc type of the graph
460 /// This class identifies a directed arc of the graph. It also serves
461 /// as a base class of the arc iterators,
462 /// thus they will convert to this type.
465 /// Default constructor
467 /// Default constructor.
468 /// \warning It sets the object to an undefined value.
470 /// Copy constructor.
472 /// Copy constructor.
475 /// %Invalid constructor \& conversion.
477 /// Initializes the object to be invalid.
478 /// \sa Invalid for more details.
480 /// Equality operator
482 /// Equality operator.
484 /// Two iterators are equal if and only if they point to the
485 /// same object or both are \c INVALID.
486 bool operator==(Arc) const { return true; }
487 /// Inequality operator
489 /// Inequality operator.
490 bool operator!=(Arc) const { return true; }
492 /// Artificial ordering operator.
494 /// Artificial ordering operator.
496 /// \note This operator only has to define some strict ordering of
497 /// the arcs; this order has nothing to do with the iteration
498 /// ordering of the arcs.
499 bool operator<(Arc) const { return false; }
501 /// Converison to \c Edge
503 /// Converison to \c Edge.
505 operator Edge() const { return Edge(); }
508 /// Iterator class for the arcs.
510 /// This iterator goes through each directed arc of the graph.
511 /// Its usage is quite simple, for example, you can count the number
512 /// of arcs in a graph \c g of type \c %BpGraph as follows:
515 /// for(BpGraph::ArcIt a(g); a!=INVALID; ++a) ++count;
517 class ArcIt : public Arc {
519 /// Default constructor
521 /// Default constructor.
522 /// \warning It sets the iterator to an undefined value.
524 /// Copy constructor.
526 /// Copy constructor.
528 ArcIt(const ArcIt& e) : Arc(e) { }
529 /// %Invalid constructor \& conversion.
531 /// Initializes the iterator to be invalid.
532 /// \sa Invalid for more details.
534 /// Sets the iterator to the first arc.
536 /// Sets the iterator to the first arc of the given graph.
538 explicit ArcIt(const BpGraph &g) { ignore_unused_variable_warning(g); }
539 /// Sets the iterator to the given arc.
541 /// Sets the iterator to the given arc of the given graph.
543 ArcIt(const BpGraph&, const Arc&) { }
546 /// Assign the iterator to the next arc.
548 ArcIt& operator++() { return *this; }
551 /// Iterator class for the outgoing arcs of a node.
553 /// This iterator goes trough the \e outgoing directed arcs of a
554 /// certain node of a graph.
555 /// Its usage is quite simple, for example, you can count the number
556 /// of outgoing arcs of a node \c n
557 /// in a graph \c g of type \c %BpGraph as follows.
560 /// for (Digraph::OutArcIt a(g, n); a!=INVALID; ++a) ++count;
562 class OutArcIt : public Arc {
564 /// Default constructor
566 /// Default constructor.
567 /// \warning It sets the iterator to an undefined value.
569 /// Copy constructor.
571 /// Copy constructor.
573 OutArcIt(const OutArcIt& e) : Arc(e) { }
574 /// %Invalid constructor \& conversion.
576 /// Initializes the iterator to be invalid.
577 /// \sa Invalid for more details.
578 OutArcIt(Invalid) { }
579 /// Sets the iterator to the first outgoing arc.
581 /// Sets the iterator to the first outgoing arc of the given node.
583 OutArcIt(const BpGraph& n, const Node& g) {
584 ignore_unused_variable_warning(n);
585 ignore_unused_variable_warning(g);
587 /// Sets the iterator to the given arc.
589 /// Sets the iterator to the given arc of the given graph.
591 OutArcIt(const BpGraph&, const Arc&) { }
592 /// Next outgoing arc
594 /// Assign the iterator to the next
595 /// outgoing arc of the corresponding node.
596 OutArcIt& operator++() { return *this; }
599 /// Iterator class for the incoming arcs of a node.
601 /// This iterator goes trough the \e incoming directed arcs of a
602 /// certain node of a graph.
603 /// Its usage is quite simple, for example, you can count the number
604 /// of incoming arcs of a node \c n
605 /// in a graph \c g of type \c %BpGraph as follows.
608 /// for (Digraph::InArcIt a(g, n); a!=INVALID; ++a) ++count;
610 class InArcIt : public Arc {
612 /// Default constructor
614 /// Default constructor.
615 /// \warning It sets the iterator to an undefined value.
617 /// Copy constructor.
619 /// Copy constructor.
621 InArcIt(const InArcIt& e) : Arc(e) { }
622 /// %Invalid constructor \& conversion.
624 /// Initializes the iterator to be invalid.
625 /// \sa Invalid for more details.
627 /// Sets the iterator to the first incoming arc.
629 /// Sets the iterator to the first incoming arc of the given node.
631 InArcIt(const BpGraph& g, const Node& n) {
632 ignore_unused_variable_warning(n);
633 ignore_unused_variable_warning(g);
635 /// Sets the iterator to the given arc.
637 /// Sets the iterator to the given arc of the given graph.
639 InArcIt(const BpGraph&, const Arc&) { }
640 /// Next incoming arc
642 /// Assign the iterator to the next
643 /// incoming arc of the corresponding node.
644 InArcIt& operator++() { return *this; }
647 /// \brief Standard graph map type for the nodes.
649 /// Standard graph map type for the nodes.
650 /// It conforms to the ReferenceMap concept.
652 class NodeMap : public ReferenceMap<Node, T, T&, const T&>
657 explicit NodeMap(const BpGraph&) { }
658 /// Constructor with given initial value
659 NodeMap(const BpGraph&, T) { }
663 NodeMap(const NodeMap& nm) :
664 ReferenceMap<Node, T, T&, const T&>(nm) { }
665 ///Assignment operator
666 template <typename CMap>
667 NodeMap& operator=(const CMap&) {
668 checkConcept<ReadMap<Node, T>, CMap>();
673 /// \brief Standard graph map type for the red nodes.
675 /// Standard graph map type for the red nodes.
676 /// It conforms to the ReferenceMap concept.
678 class RedMap : public ReferenceMap<Node, T, T&, const T&>
683 explicit RedMap(const BpGraph&) { }
684 /// Constructor with given initial value
685 RedMap(const BpGraph&, T) { }
689 RedMap(const RedMap& nm) :
690 ReferenceMap<Node, T, T&, const T&>(nm) { }
691 ///Assignment operator
692 template <typename CMap>
693 RedMap& operator=(const CMap&) {
694 checkConcept<ReadMap<Node, T>, CMap>();
699 /// \brief Standard graph map type for the blue nodes.
701 /// Standard graph map type for the blue nodes.
702 /// It conforms to the ReferenceMap concept.
704 class BlueMap : public ReferenceMap<Node, T, T&, const T&>
709 explicit BlueMap(const BpGraph&) { }
710 /// Constructor with given initial value
711 BlueMap(const BpGraph&, T) { }
715 BlueMap(const BlueMap& nm) :
716 ReferenceMap<Node, T, T&, const T&>(nm) { }
717 ///Assignment operator
718 template <typename CMap>
719 BlueMap& operator=(const CMap&) {
720 checkConcept<ReadMap<Node, T>, CMap>();
725 /// \brief Standard graph map type for the arcs.
727 /// Standard graph map type for the arcs.
728 /// It conforms to the ReferenceMap concept.
730 class ArcMap : public ReferenceMap<Arc, T, T&, const T&>
735 explicit ArcMap(const BpGraph&) { }
736 /// Constructor with given initial value
737 ArcMap(const BpGraph&, T) { }
741 ArcMap(const ArcMap& em) :
742 ReferenceMap<Arc, T, T&, const T&>(em) { }
743 ///Assignment operator
744 template <typename CMap>
745 ArcMap& operator=(const CMap&) {
746 checkConcept<ReadMap<Arc, T>, CMap>();
751 /// \brief Standard graph map type for the edges.
753 /// Standard graph map type for the edges.
754 /// It conforms to the ReferenceMap concept.
756 class EdgeMap : public ReferenceMap<Edge, T, T&, const T&>
761 explicit EdgeMap(const BpGraph&) { }
762 /// Constructor with given initial value
763 EdgeMap(const BpGraph&, T) { }
767 EdgeMap(const EdgeMap& em) :
768 ReferenceMap<Edge, T, T&, const T&>(em) {}
769 ///Assignment operator
770 template <typename CMap>
771 EdgeMap& operator=(const CMap&) {
772 checkConcept<ReadMap<Edge, T>, CMap>();
777 /// \brief Gives back %true for red nodes.
779 /// Gives back %true for red nodes.
780 bool red(const Node&) const { return true; }
782 /// \brief Gives back %true for blue nodes.
784 /// Gives back %true for blue nodes.
785 bool blue(const Node&) const { return true; }
787 /// \brief Gives back the red end node of the edge.
789 /// Gives back the red end node of the edge.
790 Node redNode(const Edge&) const { return Node(); }
792 /// \brief Gives back the blue end node of the edge.
794 /// Gives back the blue end node of the edge.
795 Node blueNode(const Edge&) const { return Node(); }
797 /// \brief The first node of the edge.
799 /// It is a synonim for the \c redNode().
800 Node u(Edge) const { return INVALID; }
802 /// \brief The second node of the edge.
804 /// It is a synonim for the \c blueNode().
805 Node v(Edge) const { return INVALID; }
807 /// \brief The source node of the arc.
809 /// Returns the source node of the given arc.
810 Node source(Arc) const { return INVALID; }
812 /// \brief The target node of the arc.
814 /// Returns the target node of the given arc.
815 Node target(Arc) const { return INVALID; }
817 /// \brief The ID of the node.
819 /// Returns the ID of the given node.
820 int id(Node) const { return -1; }
822 /// \brief The red ID of the node.
824 /// Returns the red ID of the given node.
825 int redId(Node) const { return -1; }
827 /// \brief The red ID of the node.
829 /// Returns the red ID of the given node.
830 int id(RedNode) const { return -1; }
832 /// \brief The blue ID of the node.
834 /// Returns the blue ID of the given node.
835 int blueId(Node) const { return -1; }
837 /// \brief The blue ID of the node.
839 /// Returns the blue ID of the given node.
840 int id(BlueNode) const { return -1; }
842 /// \brief The ID of the edge.
844 /// Returns the ID of the given edge.
845 int id(Edge) const { return -1; }
847 /// \brief The ID of the arc.
849 /// Returns the ID of the given arc.
850 int id(Arc) const { return -1; }
852 /// \brief The node with the given ID.
854 /// Returns the node with the given ID.
855 /// \pre The argument should be a valid node ID in the graph.
856 Node nodeFromId(int) const { return INVALID; }
858 /// \brief The edge with the given ID.
860 /// Returns the edge with the given ID.
861 /// \pre The argument should be a valid edge ID in the graph.
862 Edge edgeFromId(int) const { return INVALID; }
864 /// \brief The arc with the given ID.
866 /// Returns the arc with the given ID.
867 /// \pre The argument should be a valid arc ID in the graph.
868 Arc arcFromId(int) const { return INVALID; }
870 /// \brief An upper bound on the node IDs.
872 /// Returns an upper bound on the node IDs.
873 int maxNodeId() const { return -1; }
875 /// \brief An upper bound on the red IDs.
877 /// Returns an upper bound on the red IDs.
878 int maxRedId() const { return -1; }
880 /// \brief An upper bound on the blue IDs.
882 /// Returns an upper bound on the blue IDs.
883 int maxBlueId() const { return -1; }
885 /// \brief An upper bound on the edge IDs.
887 /// Returns an upper bound on the edge IDs.
888 int maxEdgeId() const { return -1; }
890 /// \brief An upper bound on the arc IDs.
892 /// Returns an upper bound on the arc IDs.
893 int maxArcId() const { return -1; }
895 /// \brief The direction of the arc.
897 /// Returns \c true if the given arc goes from a red node to a blue node.
898 bool direction(Arc) const { return true; }
900 /// \brief Direct the edge.
902 /// Direct the given edge. The returned arc
903 /// represents the given edge and its direction comes
904 /// from the bool parameter. If it is \c true, then the source of the node
905 /// will be a red node.
906 Arc direct(Edge, bool) const {
910 /// \brief Direct the edge.
912 /// Direct the given edge. The returned arc represents the given
913 /// edge and its source node is the given node.
914 Arc direct(Edge, Node) const {
918 /// \brief The oppositely directed arc.
920 /// Returns the oppositely directed arc representing the same edge.
921 Arc oppositeArc(Arc) const { return INVALID; }
923 /// \brief The opposite node on the edge.
925 /// Returns the opposite node on the given edge.
926 Node oppositeNode(Node, Edge) const { return INVALID; }
928 void first(Node&) const {}
929 void next(Node&) const {}
931 void firstRed(Node&) const {}
932 void nextRed(Node&) const {}
934 void firstBlue(Node&) const {}
935 void nextBlue(Node&) const {}
937 void first(Edge&) const {}
938 void next(Edge&) const {}
940 void first(Arc&) const {}
941 void next(Arc&) const {}
943 void firstOut(Arc&, Node) const {}
944 void nextOut(Arc&) const {}
946 void firstIn(Arc&, Node) const {}
947 void nextIn(Arc&) const {}
949 void firstInc(Edge &, bool &, const Node &) const {}
950 void nextInc(Edge &, bool &) const {}
952 // The second parameter is dummy.
953 Node fromId(int, Node) const { return INVALID; }
954 // The second parameter is dummy.
955 Edge fromId(int, Edge) const { return INVALID; }
956 // The second parameter is dummy.
957 Arc fromId(int, Arc) const { return INVALID; }
960 int maxId(Node) const { return -1; }
962 int maxId(RedNode) const { return -1; }
964 int maxId(BlueNode) const { return -1; }
966 int maxId(Edge) const { return -1; }
968 int maxId(Arc) const { return -1; }
970 /// \brief The base node of the iterator.
972 /// Returns the base node of the given incident edge iterator.
973 Node baseNode(IncEdgeIt) const { return INVALID; }
975 /// \brief The running node of the iterator.
977 /// Returns the running node of the given incident edge iterator.
978 Node runningNode(IncEdgeIt) const { return INVALID; }
980 /// \brief The base node of the iterator.
982 /// Returns the base node of the given outgoing arc iterator
983 /// (i.e. the source node of the corresponding arc).
984 Node baseNode(OutArcIt) const { return INVALID; }
986 /// \brief The running node of the iterator.
988 /// Returns the running node of the given outgoing arc iterator
989 /// (i.e. the target node of the corresponding arc).
990 Node runningNode(OutArcIt) const { return INVALID; }
992 /// \brief The base node of the iterator.
994 /// Returns the base node of the given incomming arc iterator
995 /// (i.e. the target node of the corresponding arc).
996 Node baseNode(InArcIt) const { return INVALID; }
998 /// \brief The running node of the iterator.
1000 /// Returns the running node of the given incomming arc iterator
1001 /// (i.e. the source node of the corresponding arc).
1002 Node runningNode(InArcIt) const { return INVALID; }
1004 template <typename _BpGraph>
1005 struct Constraints {
1006 void constraints() {
1007 checkConcept<BaseBpGraphComponent, _BpGraph>();
1008 checkConcept<IterableBpGraphComponent<>, _BpGraph>();
1009 checkConcept<IDableBpGraphComponent<>, _BpGraph>();
1010 checkConcept<MappableBpGraphComponent<>, _BpGraph>();