This graph is a mix between the ReverseArcListGraph and the ReverseArcStaticGraph. More...
#include <graph.h>


Classes | |
| class | IncomingArcIterator |
| class | OppositeIncomingArcIterator |
| class | OutgoingArcIterator |
| class | OutgoingOrOppositeIncomingArcIterator |
Public Types | |
| typedef NodeIndexType | NodeIndex |
| Typedef so you can use Graph::NodeIndex and Graph::ArcIndex to be generic but also to improve the readability of your code. More... | |
| typedef ArcIndexType | ArcIndex |
Public Member Functions | |
| ReverseArcMixedGraph () | |
| ReverseArcMixedGraph (NodeIndexType num_nodes, ArcIndexType arc_capacity) | |
| ArcIndexType | OutDegree (NodeIndexType node) const |
| ArcIndexType | InDegree (NodeIndexType node) const |
| BeginEndWrapper< OutgoingArcIterator > | OutgoingArcs (NodeIndexType node) const |
| BeginEndWrapper< IncomingArcIterator > | IncomingArcs (NodeIndexType node) const |
| BeginEndWrapper< OutgoingOrOppositeIncomingArcIterator > | OutgoingOrOppositeIncomingArcs (NodeIndexType node) const |
| BeginEndWrapper< OppositeIncomingArcIterator > | OppositeIncomingArcs (NodeIndexType node) const |
| BeginEndWrapper< OutgoingArcIterator > | OutgoingArcsStartingFrom (NodeIndexType node, ArcIndexType from) const |
| BeginEndWrapper< IncomingArcIterator > | IncomingArcsStartingFrom (NodeIndexType node, ArcIndexType from) const |
| BeginEndWrapper< OutgoingOrOppositeIncomingArcIterator > | OutgoingOrOppositeIncomingArcsStartingFrom (NodeIndexType node, ArcIndexType from) const |
| BeginEndWrapper< OppositeIncomingArcIterator > | OppositeIncomingArcsStartingFrom (NodeIndexType node, ArcIndexType from) const |
| BeginEndWrapper< NodeIndexType const * > | operator[] (NodeIndexType node) const |
| This loops over the heads of the OutgoingArcs(node). More... | |
| ArcIndexType | OppositeArc (ArcIndexType arc) const |
| NodeIndexType | Head (ArcIndexType arc) const |
| NodeIndexType | Tail (ArcIndexType arc) const |
| void | ReserveArcs (ArcIndexType bound) override |
| void | AddNode (NodeIndexType node) |
| ArcIndexType | AddArc (NodeIndexType tail, NodeIndexType head) |
| void | Build () |
| void | Build (std::vector< ArcIndexType > *permutation) |
| NodeIndexType | num_nodes () const |
| Returns the number of valid nodes in the graph. More... | |
| ArcIndexType | num_arcs () const |
| Returns the number of valid arcs in the graph. More... | |
| IntegerRange< NodeIndex > | AllNodes () const |
| Allows nice range-based for loop: for (const NodeIndex node : graph.AllNodes()) { ... More... | |
| IntegerRange< ArcIndex > | AllForwardArcs () const |
| bool | IsNodeValid (NodeIndexType node) const |
| Returns true if the given node is a valid node of the graph. More... | |
| bool | IsArcValid (ArcIndexType arc) const |
| Returns true if the given arc is a valid arc of the graph. More... | |
| NodeIndexType | node_capacity () const |
| Capacity reserved for future nodes, always >= num_nodes_. More... | |
| ArcIndexType | arc_capacity () const |
| Capacity reserved for future arcs, always >= num_arcs_. More... | |
| virtual void | ReserveNodes (NodeIndexType bound) |
| Changes the graph capacities. More... | |
| void | Reserve (NodeIndexType node_capacity, ArcIndexType arc_capacity) |
| void | FreezeCapacities () |
| FreezeCapacities() makes any future attempt to change the graph capacities crash in DEBUG mode. More... | |
| void | GroupForwardArcsByFunctor (const A &a, B *b) |
| ArcIndexType | max_end_arc_index () const |
Static Public Attributes | |
| static const NodeIndexType | kNilNode |
| Constants that will never be a valid node or arc. More... | |
| static const ArcIndexType | kNilArc |
Protected Member Functions | |
| void | ComputeCumulativeSum (std::vector< ArcIndexType > *v) |
| Functions commented when defined because they are implementation details. More... | |
| void | BuildStartAndForwardHead (SVector< NodeIndexType > *head, std::vector< ArcIndexType > *start, std::vector< ArcIndexType > *permutation) |
| Given the tail of arc #i in (*head)[i] and the head of arc #i in (*head)[~i]. More... | |
Protected Attributes | |
| NodeIndexType | num_nodes_ |
| NodeIndexType | node_capacity_ |
| ArcIndexType | num_arcs_ |
| ArcIndexType | arc_capacity_ |
| bool | const_capacities_ |
This graph is a mix between the ReverseArcListGraph and the ReverseArcStaticGraph.
It uses less memory:
|
inherited |
|
inherited |
Typedef so you can use Graph::NodeIndex and Graph::ArcIndex to be generic but also to improve the readability of your code.
We also recommend that you define a typedef ... Graph; for readability.
|
inline |
|
inline |
| ArcIndexType util::ReverseArcMixedGraph< NodeIndexType, ArcIndexType >::AddArc | ( | NodeIndexType | tail, |
| NodeIndexType | head | ||
| ) |
| void util::ReverseArcMixedGraph< NodeIndexType, ArcIndexType >::AddNode | ( | NodeIndexType | node | ) |
|
inherited |
|
inherited |
|
inherited |
Capacity reserved for future arcs, always >= num_arcs_.
|
inline |
| void util::ReverseArcMixedGraph< NodeIndexType, ArcIndexType >::Build | ( | std::vector< ArcIndexType > * | permutation | ) |
|
protectedinherited |
Given the tail of arc #i in (*head)[i] and the head of arc #i in (*head)[~i].
Computes the outgoing degree of each nodes and check if we need to permute something or not. Note that the tails are currently stored in the positive range of the SVector head.
Abort early if we do not need the permutation: we only need to put the heads in the positive range.
Computes the forward arc permutation.
Restore in (*start)[i] the index of the first arc with tail >= i.
Permutes the head into their final position in head. We do not need the tails anymore at this point.
|
protectedinherited |
|
inherited |
FreezeCapacities() makes any future attempt to change the graph capacities crash in DEBUG mode.
|
inlineinherited |
| NodeIndexType util::ReverseArcMixedGraph< NodeIndexType, ArcIndexType >::Head | ( | ArcIndexType | arc | ) | const |
| BeginEndWrapper<IncomingArcIterator> util::ReverseArcMixedGraph< NodeIndexType, ArcIndexType >::IncomingArcs | ( | NodeIndexType | node | ) | const |
| BeginEndWrapper<IncomingArcIterator> util::ReverseArcMixedGraph< NodeIndexType, ArcIndexType >::IncomingArcsStartingFrom | ( | NodeIndexType | node, |
| ArcIndexType | from | ||
| ) | const |
| ArcIndexType util::ReverseArcMixedGraph< NodeIndexType, ArcIndexType >::InDegree | ( | NodeIndexType | node | ) | const |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inherited |
|
inlineinherited |
|
inlineinherited |
| BeginEndWrapper< NodeIndexType const * > util::ReverseArcMixedGraph< NodeIndexType, ArcIndexType >::operator[] | ( | NodeIndexType | node | ) | const |
| ArcIndexType util::ReverseArcMixedGraph< NodeIndexType, ArcIndexType >::OppositeArc | ( | ArcIndexType | arc | ) | const |
| BeginEndWrapper<OppositeIncomingArcIterator> util::ReverseArcMixedGraph< NodeIndexType, ArcIndexType >::OppositeIncomingArcs | ( | NodeIndexType | node | ) | const |
| BeginEndWrapper<OppositeIncomingArcIterator> util::ReverseArcMixedGraph< NodeIndexType, ArcIndexType >::OppositeIncomingArcsStartingFrom | ( | NodeIndexType | node, |
| ArcIndexType | from | ||
| ) | const |
| ArcIndexType util::ReverseArcMixedGraph< NodeIndexType, ArcIndexType >::OutDegree | ( | NodeIndexType | node | ) | const |
| BeginEndWrapper<OutgoingArcIterator> util::ReverseArcMixedGraph< NodeIndexType, ArcIndexType >::OutgoingArcs | ( | NodeIndexType | node | ) | const |
| BeginEndWrapper<OutgoingArcIterator> util::ReverseArcMixedGraph< NodeIndexType, ArcIndexType >::OutgoingArcsStartingFrom | ( | NodeIndexType | node, |
| ArcIndexType | from | ||
| ) | const |
| BeginEndWrapper<OutgoingOrOppositeIncomingArcIterator> util::ReverseArcMixedGraph< NodeIndexType, ArcIndexType >::OutgoingOrOppositeIncomingArcs | ( | NodeIndexType | node | ) | const |
| BeginEndWrapper<OutgoingOrOppositeIncomingArcIterator> util::ReverseArcMixedGraph< NodeIndexType, ArcIndexType >::OutgoingOrOppositeIncomingArcsStartingFrom | ( | NodeIndexType | node, |
| ArcIndexType | from | ||
| ) | const |
|
inlineinherited |
|
overridevirtual |
Reimplemented from util::BaseGraph< NodeIndexType, ArcIndexType, true >.
|
inlinevirtualinherited |
Changes the graph capacities.
The functions will fail in debug mode if:
Reimplemented in util::ReverseArcListGraph< NodeIndexType, ArcIndexType >.
| NodeIndexType util::ReverseArcMixedGraph< NodeIndexType, ArcIndexType >::Tail | ( | ArcIndexType | arc | ) | const |
|
protectedinherited |
|
protectedinherited |
|
staticinherited |
|
staticinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |