1 /* -*- mode: C++; indent-tabs-mode: nil; -*-
3 * This file is a part of LEMON, a generic C++ optimization library.
5 * Copyright (C) 2003-2013
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 RedNodeIt and BlueNodeIt in the
52 /// two node sets. With RedNodeMap and BlueNodeMap values can be
53 /// assigned to 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.
154 /// Class to represent blue nodes.
156 /// This class represents the blue nodes of the graph. It does
157 /// not supposed to be used directly, because the nodes can be
158 /// represented as Node instances. This class can be used as
159 /// template parameter for special map classes.
160 class BlueNode : public Node {
162 /// Default constructor
164 /// Default constructor.
165 /// \warning It sets the object to an undefined value.
167 /// Copy constructor.
169 /// Copy constructor.
171 BlueNode(const BlueNode&) : Node() { }
173 /// %Invalid constructor \& conversion.
175 /// Initializes the object to be invalid.
176 /// \sa Invalid for more details.
177 BlueNode(Invalid) { }
181 /// Iterator class for the red nodes.
183 /// This iterator goes through each red node of the graph.
184 /// Its usage is quite simple, for example, you can count the number
185 /// of red nodes in a graph \c g of type \c %BpGraph like this:
188 /// for (BpGraph::RedNodeIt n(g); n!=INVALID; ++n) ++count;
190 class RedNodeIt : public RedNode {
192 /// Default constructor
194 /// Default constructor.
195 /// \warning It sets the iterator to an undefined value.
197 /// Copy constructor.
199 /// Copy constructor.
201 RedNodeIt(const RedNodeIt& n) : RedNode(n) { }
202 /// %Invalid constructor \& conversion.
204 /// Initializes the iterator to be invalid.
205 /// \sa Invalid for more details.
206 RedNodeIt(Invalid) { }
207 /// Sets the iterator to the first red node.
209 /// Sets the iterator to the first red node of the given
211 explicit RedNodeIt(const BpGraph&) { }
212 /// Sets the iterator to the given red node.
214 /// Sets the iterator to the given red node of the given
216 RedNodeIt(const BpGraph&, const RedNode&) { }
219 /// Assign the iterator to the next red node.
221 RedNodeIt& operator++() { return *this; }
224 /// Iterator class for the blue nodes.
226 /// This iterator goes through each blue node of the graph.
227 /// Its usage is quite simple, for example, you can count the number
228 /// of blue nodes in a graph \c g of type \c %BpGraph like this:
231 /// for (BpGraph::BlueNodeIt n(g); n!=INVALID; ++n) ++count;
233 class BlueNodeIt : public BlueNode {
235 /// Default constructor
237 /// Default constructor.
238 /// \warning It sets the iterator to an undefined value.
240 /// Copy constructor.
242 /// Copy constructor.
244 BlueNodeIt(const BlueNodeIt& n) : BlueNode(n) { }
245 /// %Invalid constructor \& conversion.
247 /// Initializes the iterator to be invalid.
248 /// \sa Invalid for more details.
249 BlueNodeIt(Invalid) { }
250 /// Sets the iterator to the first blue node.
252 /// Sets the iterator to the first blue node of the given
254 explicit BlueNodeIt(const BpGraph&) { }
255 /// Sets the iterator to the given blue node.
257 /// Sets the iterator to the given blue node of the given
259 BlueNodeIt(const BpGraph&, const BlueNode&) { }
262 /// Assign the iterator to the next blue node.
264 BlueNodeIt& operator++() { return *this; }
267 /// Iterator class for the nodes.
269 /// This iterator goes through each node of the graph.
270 /// Its usage is quite simple, for example, you can count the number
271 /// of nodes in a graph \c g of type \c %BpGraph like this:
274 /// for (BpGraph::NodeIt n(g); n!=INVALID; ++n) ++count;
276 class NodeIt : public Node {
278 /// Default constructor
280 /// Default constructor.
281 /// \warning It sets the iterator to an undefined value.
283 /// Copy constructor.
285 /// Copy constructor.
287 NodeIt(const NodeIt& n) : Node(n) { }
288 /// %Invalid constructor \& conversion.
290 /// Initializes the iterator to be invalid.
291 /// \sa Invalid for more details.
293 /// Sets the iterator to the first node.
295 /// Sets the iterator to the first node of the given digraph.
297 explicit NodeIt(const BpGraph&) { }
298 /// Sets the iterator to the given node.
300 /// Sets the iterator to the given node of the given digraph.
302 NodeIt(const BpGraph&, const Node&) { }
305 /// Assign the iterator to the next node.
307 NodeIt& operator++() { return *this; }
311 /// The edge type of the graph
313 /// This class identifies an edge of the graph. It also serves
314 /// as a base class of the edge iterators,
315 /// thus they will convert to this type.
318 /// Default constructor
320 /// Default constructor.
321 /// \warning It sets the object to an undefined value.
323 /// Copy constructor.
325 /// Copy constructor.
327 Edge(const Edge&) { }
328 /// %Invalid constructor \& conversion.
330 /// Initializes the object to be invalid.
331 /// \sa Invalid for more details.
333 /// Equality operator
335 /// Equality operator.
337 /// Two iterators are equal if and only if they point to the
338 /// same object or both are \c INVALID.
339 bool operator==(Edge) const { return true; }
340 /// Inequality operator
342 /// Inequality operator.
343 bool operator!=(Edge) const { return true; }
345 /// Artificial ordering operator.
347 /// Artificial ordering operator.
349 /// \note This operator only has to define some strict ordering of
350 /// the edges; this order has nothing to do with the iteration
351 /// ordering of the edges.
352 bool operator<(Edge) const { return false; }
355 /// Iterator class for the edges.
357 /// This iterator goes through each edge of the graph.
358 /// Its usage is quite simple, for example, you can count the number
359 /// of edges in a graph \c g of type \c %BpGraph as follows:
362 /// for(BpGraph::EdgeIt e(g); e!=INVALID; ++e) ++count;
364 class EdgeIt : public Edge {
366 /// Default constructor
368 /// Default constructor.
369 /// \warning It sets the iterator to an undefined value.
371 /// Copy constructor.
373 /// Copy constructor.
375 EdgeIt(const EdgeIt& e) : Edge(e) { }
376 /// %Invalid constructor \& conversion.
378 /// Initializes the iterator to be invalid.
379 /// \sa Invalid for more details.
381 /// Sets the iterator to the first edge.
383 /// Sets the iterator to the first edge of the given graph.
385 explicit EdgeIt(const BpGraph&) { }
386 /// Sets the iterator to the given edge.
388 /// Sets the iterator to the given edge of the given graph.
390 EdgeIt(const BpGraph&, const Edge&) { }
393 /// Assign the iterator to the next edge.
395 EdgeIt& operator++() { return *this; }
398 /// Iterator class for the incident edges of a node.
400 /// This iterator goes trough the incident undirected edges
401 /// of a certain node of a graph.
402 /// Its usage is quite simple, for example, you can compute the
403 /// degree (i.e. the number of incident edges) of a node \c n
404 /// in a graph \c g of type \c %BpGraph as follows.
408 /// for(BpGraph::IncEdgeIt e(g, n); e!=INVALID; ++e) ++count;
411 /// \warning Loop edges will be iterated twice.
412 class IncEdgeIt : public Edge {
414 /// Default constructor
416 /// Default constructor.
417 /// \warning It sets the iterator to an undefined value.
419 /// Copy constructor.
421 /// Copy constructor.
423 IncEdgeIt(const IncEdgeIt& e) : Edge(e) { }
424 /// %Invalid constructor \& conversion.
426 /// Initializes the iterator to be invalid.
427 /// \sa Invalid for more details.
428 IncEdgeIt(Invalid) { }
429 /// Sets the iterator to the first incident edge.
431 /// Sets the iterator to the first incident edge of the given node.
433 IncEdgeIt(const BpGraph&, const Node&) { }
434 /// Sets the iterator to the given edge.
436 /// Sets the iterator to the given edge of the given graph.
438 IncEdgeIt(const BpGraph&, const Edge&) { }
439 /// Next incident edge
441 /// Assign the iterator to the next incident edge
442 /// of the corresponding node.
443 IncEdgeIt& operator++() { return *this; }
446 /// The arc type of the graph
448 /// This class identifies a directed arc of the graph. It also serves
449 /// as a base class of the arc iterators,
450 /// thus they will convert to this type.
453 /// Default constructor
455 /// Default constructor.
456 /// \warning It sets the object to an undefined value.
458 /// Copy constructor.
460 /// Copy constructor.
463 /// %Invalid constructor \& conversion.
465 /// Initializes the object to be invalid.
466 /// \sa Invalid for more details.
468 /// Equality operator
470 /// Equality operator.
472 /// Two iterators are equal if and only if they point to the
473 /// same object or both are \c INVALID.
474 bool operator==(Arc) const { return true; }
475 /// Inequality operator
477 /// Inequality operator.
478 bool operator!=(Arc) const { return true; }
480 /// Artificial ordering operator.
482 /// Artificial ordering operator.
484 /// \note This operator only has to define some strict ordering of
485 /// the arcs; this order has nothing to do with the iteration
486 /// ordering of the arcs.
487 bool operator<(Arc) const { return false; }
489 /// Converison to \c Edge
491 /// Converison to \c Edge.
493 operator Edge() const { return Edge(); }
496 /// Iterator class for the arcs.
498 /// This iterator goes through each directed arc of the graph.
499 /// Its usage is quite simple, for example, you can count the number
500 /// of arcs in a graph \c g of type \c %BpGraph as follows:
503 /// for(BpGraph::ArcIt a(g); a!=INVALID; ++a) ++count;
505 class ArcIt : public Arc {
507 /// Default constructor
509 /// Default constructor.
510 /// \warning It sets the iterator to an undefined value.
512 /// Copy constructor.
514 /// Copy constructor.
516 ArcIt(const ArcIt& e) : Arc(e) { }
517 /// %Invalid constructor \& conversion.
519 /// Initializes the iterator to be invalid.
520 /// \sa Invalid for more details.
522 /// Sets the iterator to the first arc.
524 /// Sets the iterator to the first arc of the given graph.
526 explicit ArcIt(const BpGraph &g)
528 ::lemon::ignore_unused_variable_warning(g);
530 /// Sets the iterator to the given arc.
532 /// Sets the iterator to the given arc of the given graph.
534 ArcIt(const BpGraph&, const Arc&) { }
537 /// Assign the iterator to the next arc.
539 ArcIt& operator++() { return *this; }
542 /// Iterator class for the outgoing arcs of a node.
544 /// This iterator goes trough the \e outgoing directed arcs of a
545 /// certain node of a graph.
546 /// Its usage is quite simple, for example, you can count the number
547 /// of outgoing arcs of a node \c n
548 /// in a graph \c g of type \c %BpGraph as follows.
551 /// for (Digraph::OutArcIt a(g, n); a!=INVALID; ++a) ++count;
553 class OutArcIt : public Arc {
555 /// Default constructor
557 /// Default constructor.
558 /// \warning It sets the iterator to an undefined value.
560 /// Copy constructor.
562 /// Copy constructor.
564 OutArcIt(const OutArcIt& e) : Arc(e) { }
565 /// %Invalid constructor \& conversion.
567 /// Initializes the iterator to be invalid.
568 /// \sa Invalid for more details.
569 OutArcIt(Invalid) { }
570 /// Sets the iterator to the first outgoing arc.
572 /// Sets the iterator to the first outgoing arc of the given node.
574 OutArcIt(const BpGraph& n, const Node& g) {
575 ::lemon::ignore_unused_variable_warning(n);
576 ::lemon::ignore_unused_variable_warning(g);
578 /// Sets the iterator to the given arc.
580 /// Sets the iterator to the given arc of the given graph.
582 OutArcIt(const BpGraph&, const Arc&) { }
583 /// Next outgoing arc
585 /// Assign the iterator to the next
586 /// outgoing arc of the corresponding node.
587 OutArcIt& operator++() { return *this; }
590 /// Iterator class for the incoming arcs of a node.
592 /// This iterator goes trough the \e incoming directed arcs of a
593 /// certain node of a graph.
594 /// Its usage is quite simple, for example, you can count the number
595 /// of incoming arcs of a node \c n
596 /// in a graph \c g of type \c %BpGraph as follows.
599 /// for (Digraph::InArcIt a(g, n); a!=INVALID; ++a) ++count;
601 class InArcIt : public Arc {
603 /// Default constructor
605 /// Default constructor.
606 /// \warning It sets the iterator to an undefined value.
608 /// Copy constructor.
610 /// Copy constructor.
612 InArcIt(const InArcIt& e) : Arc(e) { }
613 /// %Invalid constructor \& conversion.
615 /// Initializes the iterator to be invalid.
616 /// \sa Invalid for more details.
618 /// Sets the iterator to the first incoming arc.
620 /// Sets the iterator to the first incoming arc of the given node.
622 InArcIt(const BpGraph& g, const Node& n) {
623 ::lemon::ignore_unused_variable_warning(n);
624 ::lemon::ignore_unused_variable_warning(g);
626 /// Sets the iterator to the given arc.
628 /// Sets the iterator to the given arc of the given graph.
630 InArcIt(const BpGraph&, const Arc&) { }
631 /// Next incoming arc
633 /// Assign the iterator to the next
634 /// incoming arc of the corresponding node.
635 InArcIt& operator++() { return *this; }
638 /// \brief Standard graph map type for the nodes.
640 /// Standard graph map type for the nodes.
641 /// It conforms to the ReferenceMap concept.
643 class NodeMap : public ReferenceMap<Node, T, T&, const T&>
648 explicit NodeMap(const BpGraph&) { }
649 /// Constructor with given initial value
650 NodeMap(const BpGraph&, T) { }
654 NodeMap(const NodeMap& nm) :
655 ReferenceMap<Node, T, T&, const T&>(nm) { }
656 ///Assignment operator
657 template <typename CMap>
658 NodeMap& operator=(const CMap&) {
659 checkConcept<ReadMap<Node, T>, CMap>();
664 /// \brief Standard graph map type for the red nodes.
666 /// Standard graph map type for the red nodes.
667 /// It conforms to the ReferenceMap concept.
669 class RedNodeMap : public ReferenceMap<Node, T, T&, const T&>
674 explicit RedNodeMap(const BpGraph&) { }
675 /// Constructor with given initial value
676 RedNodeMap(const BpGraph&, T) { }
680 RedNodeMap(const RedNodeMap& nm) :
681 ReferenceMap<Node, T, T&, const T&>(nm) { }
682 ///Assignment operator
683 template <typename CMap>
684 RedNodeMap& operator=(const CMap&) {
685 checkConcept<ReadMap<Node, T>, CMap>();
690 /// \brief Standard graph map type for the blue nodes.
692 /// Standard graph map type for the blue nodes.
693 /// It conforms to the ReferenceMap concept.
695 class BlueNodeMap : public ReferenceMap<Node, T, T&, const T&>
700 explicit BlueNodeMap(const BpGraph&) { }
701 /// Constructor with given initial value
702 BlueNodeMap(const BpGraph&, T) { }
706 BlueNodeMap(const BlueNodeMap& nm) :
707 ReferenceMap<Node, T, T&, const T&>(nm) { }
708 ///Assignment operator
709 template <typename CMap>
710 BlueNodeMap& operator=(const CMap&) {
711 checkConcept<ReadMap<Node, T>, CMap>();
716 /// \brief Standard graph map type for the arcs.
718 /// Standard graph map type for the arcs.
719 /// It conforms to the ReferenceMap concept.
721 class ArcMap : public ReferenceMap<Arc, T, T&, const T&>
726 explicit ArcMap(const BpGraph&) { }
727 /// Constructor with given initial value
728 ArcMap(const BpGraph&, T) { }
732 ArcMap(const ArcMap& em) :
733 ReferenceMap<Arc, T, T&, const T&>(em) { }
734 ///Assignment operator
735 template <typename CMap>
736 ArcMap& operator=(const CMap&) {
737 checkConcept<ReadMap<Arc, T>, CMap>();
742 /// \brief Standard graph map type for the edges.
744 /// Standard graph map type for the edges.
745 /// It conforms to the ReferenceMap concept.
747 class EdgeMap : public ReferenceMap<Edge, T, T&, const T&>
752 explicit EdgeMap(const BpGraph&) { }
753 /// Constructor with given initial value
754 EdgeMap(const BpGraph&, T) { }
758 EdgeMap(const EdgeMap& em) :
759 ReferenceMap<Edge, T, T&, const T&>(em) {}
760 ///Assignment operator
761 template <typename CMap>
762 EdgeMap& operator=(const CMap&) {
763 checkConcept<ReadMap<Edge, T>, CMap>();
768 /// \brief Gives back %true for red nodes.
770 /// Gives back %true for red nodes.
771 bool red(const Node&) const { return true; }
773 /// \brief Gives back %true for blue nodes.
775 /// Gives back %true for blue nodes.
776 bool blue(const Node&) const { return true; }
778 /// \brief Converts the node to red node object.
780 /// This function converts unsafely the node to red node
781 /// object. It should be called only if the node is from the red
782 /// partition or INVALID.
783 RedNode asRedNodeUnsafe(const Node&) const { return RedNode(); }
785 /// \brief Converts the node to blue node object.
787 /// This function converts unsafely the node to blue node
788 /// object. It should be called only if the node is from the red
789 /// partition or INVALID.
790 BlueNode asBlueNodeUnsafe(const Node&) const { return BlueNode(); }
792 /// \brief Converts the node to red node object.
794 /// This function converts safely the node to red node
795 /// object. If the node is not from the red partition, then it
797 RedNode asRedNode(const Node&) const { return RedNode(); }
799 /// \brief Converts the node to blue node object.
801 /// This function converts unsafely the node to blue node
802 /// object. If the node is not from the blue partition, then it
804 BlueNode asBlueNode(const Node&) const { return BlueNode(); }
806 /// \brief Gives back the red end node of the edge.
808 /// Gives back the red end node of the edge.
809 RedNode redNode(const Edge&) const { return RedNode(); }
811 /// \brief Gives back the blue end node of the edge.
813 /// Gives back the blue end node of the edge.
814 BlueNode blueNode(const Edge&) const { return BlueNode(); }
816 /// \brief The first node of the edge.
818 /// It is a synonim for the \c redNode().
819 Node u(Edge) const { return INVALID; }
821 /// \brief The second node of the edge.
823 /// It is a synonim for the \c blueNode().
824 Node v(Edge) const { return INVALID; }
826 /// \brief The source node of the arc.
828 /// Returns the source node of the given arc.
829 Node source(Arc) const { return INVALID; }
831 /// \brief The target node of the arc.
833 /// Returns the target node of the given arc.
834 Node target(Arc) const { return INVALID; }
836 /// \brief The ID of the node.
838 /// Returns the ID of the given node.
839 int id(Node) const { return -1; }
841 /// \brief The red ID of the node.
843 /// Returns the red ID of the given node.
844 int id(RedNode) const { return -1; }
846 /// \brief The blue ID of the node.
848 /// Returns the blue ID of the given node.
849 int id(BlueNode) const { return -1; }
851 /// \brief The ID of the edge.
853 /// Returns the ID of the given edge.
854 int id(Edge) const { return -1; }
856 /// \brief The ID of the arc.
858 /// Returns the ID of the given arc.
859 int id(Arc) const { return -1; }
861 /// \brief The node with the given ID.
863 /// Returns the node with the given ID.
864 /// \pre The argument should be a valid node ID in the graph.
865 Node nodeFromId(int) const { return INVALID; }
867 /// \brief The edge with the given ID.
869 /// Returns the edge with the given ID.
870 /// \pre The argument should be a valid edge ID in the graph.
871 Edge edgeFromId(int) const { return INVALID; }
873 /// \brief The arc with the given ID.
875 /// Returns the arc with the given ID.
876 /// \pre The argument should be a valid arc ID in the graph.
877 Arc arcFromId(int) const { return INVALID; }
879 /// \brief An upper bound on the node IDs.
881 /// Returns an upper bound on the node IDs.
882 int maxNodeId() const { return -1; }
884 /// \brief An upper bound on the red IDs.
886 /// Returns an upper bound on the red IDs.
887 int maxRedId() const { return -1; }
889 /// \brief An upper bound on the blue IDs.
891 /// Returns an upper bound on the blue IDs.
892 int maxBlueId() const { return -1; }
894 /// \brief An upper bound on the edge IDs.
896 /// Returns an upper bound on the edge IDs.
897 int maxEdgeId() const { return -1; }
899 /// \brief An upper bound on the arc IDs.
901 /// Returns an upper bound on the arc IDs.
902 int maxArcId() const { return -1; }
904 /// \brief The direction of the arc.
906 /// Returns \c true if the given arc goes from a red node to a blue node.
907 bool direction(Arc) const { return true; }
909 /// \brief Direct the edge.
911 /// Direct the given edge. The returned arc
912 /// represents the given edge and its direction comes
913 /// from the bool parameter. If it is \c true, then the source of the node
914 /// will be a red node.
915 Arc direct(Edge, bool) const {
919 /// \brief Direct the edge.
921 /// Direct the given edge. The returned arc represents the given
922 /// edge and its source node is the given node.
923 Arc direct(Edge, Node) const {
927 /// \brief The oppositely directed arc.
929 /// Returns the oppositely directed arc representing the same edge.
930 Arc oppositeArc(Arc) const { return INVALID; }
932 /// \brief The opposite node on the edge.
934 /// Returns the opposite node on the given edge.
935 Node oppositeNode(Node, Edge) const { return INVALID; }
937 void first(Node&) const {}
938 void next(Node&) const {}
940 void firstRed(RedNode&) const {}
941 void nextRed(RedNode&) const {}
943 void firstBlue(BlueNode&) const {}
944 void nextBlue(BlueNode&) const {}
946 void first(Edge&) const {}
947 void next(Edge&) const {}
949 void first(Arc&) const {}
950 void next(Arc&) const {}
952 void firstOut(Arc&, Node) const {}
953 void nextOut(Arc&) const {}
955 void firstIn(Arc&, Node) const {}
956 void nextIn(Arc&) const {}
958 void firstInc(Edge &, bool &, const Node &) const {}
959 void nextInc(Edge &, bool &) const {}
961 // The second parameter is dummy.
962 Node fromId(int, Node) const { return INVALID; }
963 // The second parameter is dummy.
964 Edge fromId(int, Edge) const { return INVALID; }
965 // The second parameter is dummy.
966 Arc fromId(int, Arc) const { return INVALID; }
969 int maxId(Node) const { return -1; }
971 int maxId(RedNode) const { return -1; }
973 int maxId(BlueNode) const { return -1; }
975 int maxId(Edge) const { return -1; }
977 int maxId(Arc) const { return -1; }
979 /// \brief The base node of the iterator.
981 /// Returns the base node of the given incident edge iterator.
982 Node baseNode(IncEdgeIt) const { return INVALID; }
984 /// \brief The running node of the iterator.
986 /// Returns the running node of the given incident edge iterator.
987 Node runningNode(IncEdgeIt) const { return INVALID; }
989 /// \brief The base node of the iterator.
991 /// Returns the base node of the given outgoing arc iterator
992 /// (i.e. the source node of the corresponding arc).
993 Node baseNode(OutArcIt) const { return INVALID; }
995 /// \brief The running node of the iterator.
997 /// Returns the running node of the given outgoing arc iterator
998 /// (i.e. the target node of the corresponding arc).
999 Node runningNode(OutArcIt) const { return INVALID; }
1001 /// \brief The base node of the iterator.
1003 /// Returns the base node of the given incoming arc iterator
1004 /// (i.e. the target node of the corresponding arc).
1005 Node baseNode(InArcIt) const { return INVALID; }
1007 /// \brief The running node of the iterator.
1009 /// Returns the running node of the given incoming arc iterator
1010 /// (i.e. the source node of the corresponding arc).
1011 Node runningNode(InArcIt) const { return INVALID; }
1013 template <typename _BpGraph>
1014 struct Constraints {
1015 void constraints() {
1016 checkConcept<BaseBpGraphComponent, _BpGraph>();
1017 checkConcept<IterableBpGraphComponent<>, _BpGraph>();
1018 checkConcept<IDableBpGraphComponent<>, _BpGraph>();
1019 checkConcept<MappableBpGraphComponent<>, _BpGraph>();