3 * lemon/concept/ugraph_component.h - Part of LEMON, a generic
4 * C++ optimization library
6 * Copyright (C) 2005 Egervary Jeno Kombinatorikus Optimalizalasi
7 * Kutatocsoport (Egervary Research Group on Combinatorial Optimization,
10 * Permission to use, modify and distribute this software is granted
11 * provided that this copyright notice appears in all copies. For
12 * precise terms see the accompanying LICENSE file.
14 * This software is provided "AS IS" with no warranty of any kind,
15 * express or implied, and with no claim as to its suitability for any
20 /// \ingroup graph_concepts
22 /// \brief Undirected bipartite graphs and components of.
25 #ifndef LEMON_CONCEPT_BPUGRAPH_H
26 #define LEMON_CONCEPT_BPUGRAPH_H
28 #include <lemon/concept/graph_component.h>
30 #include <lemon/concept/graph.h>
31 #include <lemon/concept/ugraph.h>
33 #include <lemon/utility.h>
38 /// \addtogroup graph_concepts
42 /// \brief Class describing the concept of Bipartite Undirected Graphs.
44 /// This class describes the common interface of all
45 /// Undirected Bipartite Graphs.
47 /// As all concept describing classes it provides only interface
48 /// without any sensible implementation. So any algorithm for
49 /// bipartite undirected graph should compile with this class, but it
50 /// will not run properly, of course.
52 /// In LEMON bipartite undirected graphs also fulfill the concept of
53 /// the undirected graphs (\ref lemon::concept::UGraph "UGraph Concept").
55 /// You can assume that all undirected bipartite graph can be handled
56 /// as an undirected graph and consequently as a static graph.
58 /// The bipartite graph stores two types of nodes which are named
59 /// ANode and BNode. The graph type contains two types ANode and BNode
60 /// which are inherited from Node type. Moreover they have
61 /// constructor which converts Node to either ANode or BNode when it is
62 /// possible. Therefor everywhere the Node type can be used instead of
63 /// ANode and BNode. So the usage of the ANode and BNode is suggested.
65 /// The iteration on the partition can be done with the ANodeIt and
66 /// BNodeIt classes. The node map can be used to map values to the nodes
67 /// and similarly we can use to map values for just the ANodes and
68 /// BNodes the ANodeMap and BNodeMap template classes.
72 /// \todo undocumented
76 /// \brief The base type of node iterators,
77 /// or in other words, the trivial node iterator.
79 /// This is the base type of each node iterator,
80 /// thus each kind of node iterator converts to this.
81 /// More precisely each kind of node iterator should be inherited
82 /// from the trivial node iterator. The Node class represents
83 /// both of two types of nodes.
86 /// Default constructor
88 /// @warning The default constructor sets the iterator
89 /// to an undefined value.
97 /// Invalid constructor \& conversion.
99 /// This constructor initializes the iterator to be invalid.
100 /// \sa Invalid for more details.
102 /// Equality operator
104 /// Two iterators are equal if and only if they point to the
105 /// same object or both are invalid.
106 bool operator==(Node) const { return true; }
108 /// Inequality operator
110 /// \sa operator==(Node n)
112 bool operator!=(Node) const { return true; }
114 /// Artificial ordering operator.
116 /// To allow the use of graph descriptors as key type in std::map or
117 /// similar associative container we require this.
119 /// \note This operator only have to define some strict ordering of
120 /// the items; this order has nothing to do with the iteration
121 /// ordering of the items.
123 /// \bug This is a technical requirement. Do we really need this?
124 bool operator<(Node) const { return false; }
128 /// \brief The base type of anode iterators,
129 /// or in other words, the trivial anode iterator.
131 /// This is the base type of each anode iterator,
132 /// thus each kind of anode iterator converts to this.
133 /// More precisely each kind of node iterator should be inherited
134 /// from the trivial anode iterator. The ANode class should be used
135 /// only in special cases. Usually the Node type should be used insted
139 /// Default constructor
141 /// @warning The default constructor sets the iterator
142 /// to an undefined value.
144 /// Copy constructor.
146 /// Copy constructor.
148 ANode(const ANode&) { }
150 /// Construct the same node as ANode.
152 /// Construct the same node as ANode. It may throws assertion
153 /// when the given node is from the BNode set.
154 ANode(const Node&) { }
156 /// Invalid constructor \& conversion.
158 /// This constructor initializes the iterator to be invalid.
159 /// \sa Invalid for more details.
161 /// Equality operator
163 /// Two iterators are equal if and only if they point to the
164 /// same object or both are invalid.
165 bool operator==(ANode) const { return true; }
167 /// Inequality operator
169 /// \sa operator==(ANode n)
171 bool operator!=(ANode) const { return true; }
173 /// Artificial ordering operator.
175 /// To allow the use of graph descriptors as key type in std::map or
176 /// similar associative container we require this.
178 /// \note This operator only have to define some strict ordering of
179 /// the items; this order has nothing to do with the iteration
180 /// ordering of the items.
181 bool operator<(ANode) const { return false; }
185 /// \brief The base type of bnode iterators,
186 /// or in other words, the trivial bnode iterator.
188 /// This is the base type of each anode iterator,
189 /// thus each kind of anode iterator converts to this.
190 /// More precisely each kind of node iterator should be inherited
191 /// from the trivial anode iterator. The BNode class should be used
192 /// only in special cases. Usually the Node type should be used insted
196 /// Default constructor
198 /// @warning The default constructor sets the iterator
199 /// to an undefined value.
201 /// Copy constructor.
203 /// Copy constructor.
205 BNode(const BNode&) { }
207 /// Construct the same node as BNode.
209 /// Construct the same node as BNode. It may throws assertion
210 /// when the given node is from the ANode set.
211 BNode(const Node&) { }
213 /// Invalid constructor \& conversion.
215 /// This constructor initializes the iterator to be invalid.
216 /// \sa Invalid for more details.
218 /// Equality operator
220 /// Two iterators are equal if and only if they point to the
221 /// same object or both are invalid.
222 bool operator==(BNode) const { return true; }
224 /// Inequality operator
226 /// \sa operator==(BNode n)
228 bool operator!=(BNode) const { return true; }
230 /// Artificial ordering operator.
232 /// To allow the use of graph descriptors as key type in std::map or
233 /// similar associative container we require this.
235 /// \note This operator only have to define some strict ordering of
236 /// the items; this order has nothing to do with the iteration
237 /// ordering of the items.
238 bool operator<(BNode) const { return false; }
242 /// This iterator goes through each node.
244 /// This iterator goes through each node.
245 /// Its usage is quite simple, for example you can count the number
246 /// of nodes in graph \c g of type \c Graph like this:
249 /// for (Graph::NodeIt n(g); n!=INVALID; ++n) ++count;
251 class NodeIt : public Node {
253 /// Default constructor
255 /// @warning The default constructor sets the iterator
256 /// to an undefined value.
258 /// Copy constructor.
260 /// Copy constructor.
262 NodeIt(const NodeIt& n) : Node(n) { }
263 /// Invalid constructor \& conversion.
265 /// Initialize the iterator to be invalid.
266 /// \sa Invalid for more details.
268 /// Sets the iterator to the first node.
270 /// Sets the iterator to the first node of \c g.
272 NodeIt(const BpUGraph&) { }
273 /// Node -> NodeIt conversion.
275 /// Sets the iterator to the node of \c the graph pointed by
276 /// the trivial iterator.
277 /// This feature necessitates that each time we
278 /// iterate the edge-set, the iteration order is the same.
279 NodeIt(const BpUGraph&, const Node&) { }
282 /// Assign the iterator to the next node.
284 NodeIt& operator++() { return *this; }
287 /// This iterator goes through each ANode.
289 /// This iterator goes through each ANode.
290 /// Its usage is quite simple, for example you can count the number
291 /// of nodes in graph \c g of type \c Graph like this:
294 /// for (Graph::ANodeIt n(g); n!=INVALID; ++n) ++count;
296 class ANodeIt : public ANode {
298 /// Default constructor
300 /// @warning The default constructor sets the iterator
301 /// to an undefined value.
303 /// Copy constructor.
305 /// Copy constructor.
307 ANodeIt(const ANodeIt& n) : Node(n) { }
308 /// Invalid constructor \& conversion.
310 /// Initialize the iterator to be invalid.
311 /// \sa Invalid for more details.
313 /// Sets the iterator to the first node.
315 /// Sets the iterator to the first node of \c g.
317 ANodeIt(const BpUGraph&) { }
318 /// Node -> ANodeIt conversion.
320 /// Sets the iterator to the node of \c the graph pointed by
321 /// the trivial iterator.
322 /// This feature necessitates that each time we
323 /// iterate the edge-set, the iteration order is the same.
324 ANodeIt(const BpUGraph&, const Node&) { }
327 /// Assign the iterator to the next node.
329 ANodeIt& operator++() { return *this; }
332 /// This iterator goes through each BNode.
334 /// This iterator goes through each BNode.
335 /// Its usage is quite simple, for example you can count the number
336 /// of nodes in graph \c g of type \c Graph like this:
339 /// for (Graph::BNodeIt n(g); n!=INVALID; ++n) ++count;
341 class BNodeIt : public BNode {
343 /// Default constructor
345 /// @warning The default constructor sets the iterator
346 /// to an undefined value.
348 /// Copy constructor.
350 /// Copy constructor.
352 BNodeIt(const BNodeIt& n) : Node(n) { }
353 /// Invalid constructor \& conversion.
355 /// Initialize the iterator to be invalid.
356 /// \sa Invalid for more details.
358 /// Sets the iterator to the first node.
360 /// Sets the iterator to the first node of \c g.
362 BNodeIt(const BpUGraph&) { }
363 /// Node -> BNodeIt conversion.
365 /// Sets the iterator to the node of \c the graph pointed by
366 /// the trivial iterator.
367 /// This feature necessitates that each time we
368 /// iterate the edge-set, the iteration order is the same.
369 BNodeIt(const BpUGraph&, const Node&) { }
372 /// Assign the iterator to the next node.
374 BNodeIt& operator++() { return *this; }
378 /// The base type of the undirected edge iterators.
380 /// The base type of the undirected edge iterators.
384 /// Default constructor
386 /// @warning The default constructor sets the iterator
387 /// to an undefined value.
389 /// Copy constructor.
391 /// Copy constructor.
393 UEdge(const UEdge&) { }
394 /// Initialize the iterator to be invalid.
396 /// Initialize the iterator to be invalid.
399 /// Equality operator
401 /// Two iterators are equal if and only if they point to the
402 /// same object or both are invalid.
403 bool operator==(UEdge) const { return true; }
404 /// Inequality operator
406 /// \sa operator==(UEdge n)
408 bool operator!=(UEdge) const { return true; }
410 /// Artificial ordering operator.
412 /// To allow the use of graph descriptors as key type in std::map or
413 /// similar associative container we require this.
415 /// \note This operator only have to define some strict ordering of
416 /// the items; this order has nothing to do with the iteration
417 /// ordering of the items.
419 /// \bug This is a technical requirement. Do we really need this?
420 bool operator<(UEdge) const { return false; }
423 /// This iterator goes through each undirected edge.
425 /// This iterator goes through each undirected edge of a graph.
426 /// Its usage is quite simple, for example you can count the number
427 /// of undirected edges in a graph \c g of type \c Graph as follows:
430 /// for(Graph::UEdgeIt e(g); e!=INVALID; ++e) ++count;
432 class UEdgeIt : public UEdge {
434 /// Default constructor
436 /// @warning The default constructor sets the iterator
437 /// to an undefined value.
439 /// Copy constructor.
441 /// Copy constructor.
443 UEdgeIt(const UEdgeIt& e) : UEdge(e) { }
444 /// Initialize the iterator to be invalid.
446 /// Initialize the iterator to be invalid.
449 /// This constructor sets the iterator to the first undirected edge.
451 /// This constructor sets the iterator to the first undirected edge.
452 UEdgeIt(const BpUGraph&) { }
453 /// UEdge -> UEdgeIt conversion
455 /// Sets the iterator to the value of the trivial iterator.
456 /// This feature necessitates that each time we
457 /// iterate the undirected edge-set, the iteration order is the
459 UEdgeIt(const BpUGraph&, const UEdge&) { }
460 /// Next undirected edge
462 /// Assign the iterator to the next undirected edge.
463 UEdgeIt& operator++() { return *this; }
466 /// \brief This iterator goes trough the incident undirected
469 /// This iterator goes trough the incident undirected edges
470 /// of a certain node
472 /// Its usage is quite simple, for example you can compute the
473 /// degree (i.e. count the number
474 /// of incident edges of a node \c n
475 /// in graph \c g of type \c Graph as follows.
478 /// for(Graph::IncEdgeIt e(g, n); e!=INVALID; ++e) ++count;
480 class IncEdgeIt : public UEdge {
482 /// Default constructor
484 /// @warning The default constructor sets the iterator
485 /// to an undefined value.
487 /// Copy constructor.
489 /// Copy constructor.
491 IncEdgeIt(const IncEdgeIt& e) : UEdge(e) { }
492 /// Initialize the iterator to be invalid.
494 /// Initialize the iterator to be invalid.
496 IncEdgeIt(Invalid) { }
497 /// This constructor sets the iterator to first incident edge.
499 /// This constructor set the iterator to the first incident edge of
501 IncEdgeIt(const BpUGraph&, const Node&) { }
502 /// UEdge -> IncEdgeIt conversion
504 /// Sets the iterator to the value of the trivial iterator \c e.
505 /// This feature necessitates that each time we
506 /// iterate the edge-set, the iteration order is the same.
507 IncEdgeIt(const BpUGraph&, const UEdge&) { }
508 /// Next incident edge
510 /// Assign the iterator to the next incident edge
511 /// of the corresponding node.
512 IncEdgeIt& operator++() { return *this; }
515 /// The directed edge type.
517 /// The directed edge type. It can be converted to the
519 class Edge : public UEdge {
521 /// Default constructor
523 /// @warning The default constructor sets the iterator
524 /// to an undefined value.
526 /// Copy constructor.
528 /// Copy constructor.
530 Edge(const Edge& e) : UEdge(e) { }
531 /// Initialize the iterator to be invalid.
533 /// Initialize the iterator to be invalid.
536 /// Equality operator
538 /// Two iterators are equal if and only if they point to the
539 /// same object or both are invalid.
540 bool operator==(Edge) const { return true; }
541 /// Inequality operator
543 /// \sa operator==(Edge n)
545 bool operator!=(Edge) const { return true; }
547 /// Artificial ordering operator.
549 /// To allow the use of graph descriptors as key type in std::map or
550 /// similar associative container we require this.
552 /// \note This operator only have to define some strict ordering of
553 /// the items; this order has nothing to do with the iteration
554 /// ordering of the items.
556 /// \bug This is a technical requirement. Do we really need this?
557 bool operator<(Edge) const { return false; }
560 /// This iterator goes through each directed edge.
562 /// This iterator goes through each edge of a graph.
563 /// Its usage is quite simple, for example you can count the number
564 /// of edges in a graph \c g of type \c Graph as follows:
567 /// for(Graph::EdgeIt e(g); e!=INVALID; ++e) ++count;
569 class EdgeIt : public Edge {
571 /// Default constructor
573 /// @warning The default constructor sets the iterator
574 /// to an undefined value.
576 /// Copy constructor.
578 /// Copy constructor.
580 EdgeIt(const EdgeIt& e) : Edge(e) { }
581 /// Initialize the iterator to be invalid.
583 /// Initialize the iterator to be invalid.
586 /// This constructor sets the iterator to the first edge.
588 /// This constructor sets the iterator to the first edge of \c g.
589 ///@param g the graph
590 EdgeIt(const BpUGraph &g) { ignore_unused_variable_warning(g); }
591 /// Edge -> EdgeIt conversion
593 /// Sets the iterator to the value of the trivial iterator \c e.
594 /// This feature necessitates that each time we
595 /// iterate the edge-set, the iteration order is the same.
596 EdgeIt(const BpUGraph&, const Edge&) { }
599 /// Assign the iterator to the next edge.
600 EdgeIt& operator++() { return *this; }
603 /// This iterator goes trough the outgoing directed edges of a node.
605 /// This iterator goes trough the \e outgoing edges of a certain node
607 /// Its usage is quite simple, for example you can count the number
608 /// of outgoing edges of a node \c n
609 /// in graph \c g of type \c Graph as follows.
612 /// for (Graph::OutEdgeIt e(g, n); e!=INVALID; ++e) ++count;
615 class OutEdgeIt : public Edge {
617 /// Default constructor
619 /// @warning The default constructor sets the iterator
620 /// to an undefined value.
622 /// Copy constructor.
624 /// Copy constructor.
626 OutEdgeIt(const OutEdgeIt& e) : Edge(e) { }
627 /// Initialize the iterator to be invalid.
629 /// Initialize the iterator to be invalid.
631 OutEdgeIt(Invalid) { }
632 /// This constructor sets the iterator to the first outgoing edge.
634 /// This constructor sets the iterator to the first outgoing edge of
637 ///@param g the graph
638 OutEdgeIt(const BpUGraph& n, const Node& g) {
639 ignore_unused_variable_warning(n);
640 ignore_unused_variable_warning(g);
642 /// Edge -> OutEdgeIt conversion
644 /// Sets the iterator to the value of the trivial iterator.
645 /// This feature necessitates that each time we
646 /// iterate the edge-set, the iteration order is the same.
647 OutEdgeIt(const BpUGraph&, const Edge&) { }
648 ///Next outgoing edge
650 /// Assign the iterator to the next
651 /// outgoing edge of the corresponding node.
652 OutEdgeIt& operator++() { return *this; }
655 /// This iterator goes trough the incoming directed edges of a node.
657 /// This iterator goes trough the \e incoming edges of a certain node
659 /// Its usage is quite simple, for example you can count the number
660 /// of outgoing edges of a node \c n
661 /// in graph \c g of type \c Graph as follows.
664 /// for(Graph::InEdgeIt e(g, n); e!=INVALID; ++e) ++count;
667 class InEdgeIt : public Edge {
669 /// Default constructor
671 /// @warning The default constructor sets the iterator
672 /// to an undefined value.
674 /// Copy constructor.
676 /// Copy constructor.
678 InEdgeIt(const InEdgeIt& e) : Edge(e) { }
679 /// Initialize the iterator to be invalid.
681 /// Initialize the iterator to be invalid.
683 InEdgeIt(Invalid) { }
684 /// This constructor sets the iterator to first incoming edge.
686 /// This constructor set the iterator to the first incoming edge of
689 ///@param g the graph
690 InEdgeIt(const BpUGraph& g, const Node& n) {
691 ignore_unused_variable_warning(n);
692 ignore_unused_variable_warning(g);
694 /// Edge -> InEdgeIt conversion
696 /// Sets the iterator to the value of the trivial iterator \c e.
697 /// This feature necessitates that each time we
698 /// iterate the edge-set, the iteration order is the same.
699 InEdgeIt(const BpUGraph&, const Edge&) { }
700 /// Next incoming edge
702 /// Assign the iterator to the next inedge of the corresponding node.
704 InEdgeIt& operator++() { return *this; }
707 /// \brief Read write map of the nodes to type \c T.
709 /// ReadWrite map of the nodes to type \c T.
711 /// \warning Making maps that can handle bool type (NodeMap<bool>)
712 /// needs some extra attention!
713 /// \todo Wrong documentation
715 class NodeMap : public ReadWriteMap< Node, T >
720 NodeMap(const BpUGraph&) { }
722 NodeMap(const BpUGraph&, T) { }
725 NodeMap(const NodeMap& nm) : ReadWriteMap< Node, T >(nm) { }
726 ///Assignment operator
727 NodeMap& operator=(const NodeMap&) { return *this; }
728 // \todo fix this concept
731 /// \brief Read write map of the ANodes to type \c T.
733 /// ReadWrite map of the ANodes to type \c T.
735 /// \warning Making maps that can handle bool type (NodeMap<bool>)
736 /// needs some extra attention!
737 /// \todo Wrong documentation
739 class ANodeMap : public ReadWriteMap< Node, T >
744 ANodeMap(const BpUGraph&) { }
746 ANodeMap(const BpUGraph&, T) { }
749 ANodeMap(const NodeMap& nm) : ReadWriteMap< Node, T >(nm) { }
750 ///Assignment operator
751 ANodeMap& operator=(const NodeMap&) { return *this; }
752 // \todo fix this concept
755 /// \brief Read write map of the BNodes to type \c T.
757 /// ReadWrite map of the BNodes to type \c T.
759 /// \warning Making maps that can handle bool type (NodeMap<bool>)
760 /// needs some extra attention!
761 /// \todo Wrong documentation
763 class BNodeMap : public ReadWriteMap< Node, T >
768 BNodeMap(const BpUGraph&) { }
770 BNodeMap(const BpUGraph&, T) { }
773 BNodeMap(const NodeMap& nm) : ReadWriteMap< Node, T >(nm) { }
774 ///Assignment operator
775 BNodeMap& operator=(const NodeMap&) { return *this; }
776 // \todo fix this concept
779 /// \brief Read write map of the directed edges to type \c T.
781 /// Reference map of the directed edges to type \c T.
783 /// \warning Making maps that can handle bool type (EdgeMap<bool>)
784 /// needs some extra attention!
785 /// \todo Wrong documentation
787 class EdgeMap : public ReadWriteMap<Edge,T>
792 EdgeMap(const BpUGraph&) { }
794 EdgeMap(const BpUGraph&, T) { }
796 EdgeMap(const EdgeMap& em) : ReadWriteMap<Edge,T>(em) { }
797 ///Assignment operator
798 EdgeMap& operator=(const EdgeMap&) { return *this; }
799 // \todo fix this concept
802 /// Read write map of the undirected edges to type \c T.
804 /// Reference map of the edges to type \c T.
806 /// \warning Making maps that can handle bool type (UEdgeMap<bool>)
807 /// needs some extra attention!
808 /// \todo Wrong documentation
810 class UEdgeMap : public ReadWriteMap<UEdge,T>
815 UEdgeMap(const BpUGraph&) { }
817 UEdgeMap(const BpUGraph&, T) { }
819 UEdgeMap(const UEdgeMap& em) : ReadWriteMap<UEdge,T>(em) {}
820 ///Assignment operator
821 UEdgeMap &operator=(const UEdgeMap&) { return *this; }
822 // \todo fix this concept
825 /// \brief Direct the given undirected edge.
827 /// Direct the given undirected edge. The returned edge source
828 /// will be the given edge.
829 Edge direct(const UEdge&, const Node&) const {
833 /// \brief Direct the given undirected edge.
835 /// Direct the given undirected edge. The returned edge source
836 /// will be the source of the undirected edge if the given bool
838 Edge direct(const UEdge&, bool) const {
842 /// \brief Returns true when the given node is an ANode.
844 /// Returns true when the given node is an ANode.
845 bool aNode(Node) const { return true;}
847 /// \brief Returns true when the given node is an BNode.
849 /// Returns true when the given node is an BNode.
850 bool bNode(Node) const { return true;}
852 /// \brief Returns the edge's end node which is in the ANode set.
854 /// Returns the edge's end node which is in the ANode set.
855 Node aNode(UEdge) const { return INVALID;}
857 /// \brief Returns the edge's end node which is in the BNode set.
859 /// Returns the edge's end node which is in the BNode set.
860 Node bNode(UEdge) const { return INVALID;}
862 /// \brief Returns true if the edge has default orientation.
864 /// Returns whether the given directed edge is same orientation as
865 /// the corresponding undirected edge.
866 bool direction(Edge) const { return true; }
868 /// \brief Returns the opposite directed edge.
870 /// Returns the opposite directed edge.
871 Edge oppositeEdge(Edge) const { return INVALID; }
873 /// \brief Opposite node on an edge
875 /// \return the opposite of the given Node on the given Edge
876 Node oppositeNode(Node, UEdge) const { return INVALID; }
878 /// \brief First node of the undirected edge.
880 /// \return the first node of the given UEdge.
882 /// Naturally uectected edges don't have direction and thus
883 /// don't have source and target node. But we use these two methods
884 /// to query the two endnodes of the edge. The direction of the edge
885 /// which arises this way is called the inherent direction of the
886 /// undirected edge, and is used to define the "default" direction
887 /// of the directed versions of the edges.
889 Node source(UEdge) const { return INVALID; }
891 /// \brief Second node of the undirected edge.
892 Node target(UEdge) const { return INVALID; }
894 /// \brief Source node of the directed edge.
895 Node source(Edge) const { return INVALID; }
897 /// \brief Target node of the directed edge.
898 Node target(Edge) const { return INVALID; }
900 /// \brief Base node of the iterator
902 /// Returns the base node (the source in this case) of the iterator
903 Node baseNode(OutEdgeIt e) const {
907 /// \brief Running node of the iterator
909 /// Returns the running node (the target in this case) of the
911 Node runningNode(OutEdgeIt e) const {
915 /// \brief Base node of the iterator
917 /// Returns the base node (the target in this case) of the iterator
918 Node baseNode(InEdgeIt e) const {
921 /// \brief Running node of the iterator
923 /// Returns the running node (the source in this case) of the
925 Node runningNode(InEdgeIt e) const {
929 /// \brief Base node of the iterator
931 /// Returns the base node of the iterator
932 Node baseNode(IncEdgeIt) const {
936 /// \brief Running node of the iterator
938 /// Returns the running node of the iterator
939 Node runningNode(IncEdgeIt) const {
943 template <typename Graph>
951 /// \brief An empty non-static undirected graph class.
953 /// This class provides everything that \ref BpUGraph does.
954 /// Additionally it enables building graphs from scratch.
955 class ExtendableBpUGraph : public BpUGraph {
958 /// \brief Add a new ANode to the graph.
960 /// Add a new ANode to the graph.
961 /// \return the new node.
964 /// \brief Add a new ANode to the graph.
966 /// Add a new ANode to the graph.
967 /// \return the new node.
970 /// \brief Add a new undirected edge to the graph.
972 /// Add a new undirected edge to the graph. One of the nodes
973 /// should be ANode and the other should be BNode.
974 /// \pre The nodes are not in the same nodeset.
975 /// \return the new edge.
976 UEdge addEdge(const Node& from, const Node& to);
978 /// \brief Resets the graph.
980 /// This function deletes all undirected edges and nodes of the graph.
981 /// It also frees the memory allocated to store them.
984 template <typename Graph>
986 void constraints() {}
991 /// \brief An empty erasable undirected graph class.
993 /// This class is an extension of \ref ExtendableBpUGraph. It makes it
994 /// possible to erase undirected edges or nodes.
995 class ErasableBpUGraph : public ExtendableBpUGraph {
998 /// \brief Deletes a node.
1002 void erase(Node) { }
1003 /// \brief Deletes an undirected edge.
1005 /// Deletes an undirected edge.
1007 void erase(UEdge) { }
1009 template <typename Graph>
1010 struct Constraints {
1011 void constraints() {}