Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <graph.h>
Classes | |
class | IncomingArcIterator |
class | OppositeIncomingArcIterator |
class | OutgoingArcIterator |
class | OutgoingHeadIterator |
class | OutgoingOrOppositeIncomingArcIterator |
Public Member Functions | |
ReverseArcListGraph () | |
ReverseArcListGraph (NodeIndexType num_nodes, ArcIndexType arc_capacity) | |
ArcIndexType | OppositeArc (ArcIndexType arc) const |
ArcIndexType | OutDegree (NodeIndexType node) const |
ReverseArcListGraph<>::OutDegree() and InDegree() work in O(degree). | |
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< OutgoingHeadIterator > | operator[] (NodeIndexType node) const |
NodeIndexType | Head (ArcIndexType arc) const |
NodeIndexType | Tail (ArcIndexType arc) const |
void | ReserveNodes (NodeIndexType bound) override |
void | ReserveArcs (ArcIndexType bound) override |
void | AddNode (NodeIndexType node) |
ArcIndexType | AddArc (NodeIndexType tail, NodeIndexType head) |
void | Build () |
void | Build (std::vector< ArcIndexType > *permutation) |
bool | IsArcValid (ArcIndexType arc) const |
Public Member Functions inherited from util::BaseGraph< int32_t, int32_t, true > | |
BaseGraph () | |
BaseGraph (const BaseGraph &)=default | |
BaseGraph & | operator= (const BaseGraph &)=default |
virtual | ~BaseGraph ()=default |
int32_t | num_nodes () const |
int32_t | size () const |
int32_t | num_arcs () const |
Returns the number of valid arcs in the graph. | |
IntegerRange< NodeIndex > | AllNodes () const |
BaseGraph implementation -------------------------------------------------—. | |
IntegerRange< ArcIndex > | AllForwardArcs () const |
bool | IsNodeValid (int32_t node) const |
Returns true if the given node is a valid node of the graph. | |
bool | IsArcValid (int32_t arc) const |
int32_t | node_capacity () const |
Capacity reserved for future nodes, always >= num_nodes_. | |
int32_t | arc_capacity () const |
Capacity reserved for future arcs, always >= num_arcs_. | |
virtual void | ReserveNodes (int32_t bound) |
virtual void | ReserveArcs (int32_t bound) |
void | Reserve (int32_t node_capacity, int32_t arc_capacity) |
void | FreezeCapacities () |
void | GroupForwardArcsByFunctor (const A &a, B *b) |
int32_t | max_end_arc_index () const |
Additional Inherited Members | |
Public Types inherited from util::BaseGraph< int32_t, int32_t, true > | |
typedef int32_t | NodeIndex |
typedef int32_t | ArcIndex |
Static Public Attributes inherited from util::BaseGraph< int32_t, int32_t, true > | |
static const int32_t | kNilNode |
static const int32_t | kNilArc |
Protected Member Functions inherited from util::BaseGraph< int32_t, int32_t, true > | |
void | ComputeCumulativeSum (std::vector< int32_t > *v) |
Functions commented when defined because they are implementation details. | |
void | BuildStartAndForwardHead (SVector< int32_t > *head, std::vector< int32_t > *start, std::vector< int32_t > *permutation) |
Protected Attributes inherited from util::BaseGraph< int32_t, int32_t, true > | |
int32_t | num_nodes_ |
int32_t | node_capacity_ |
int32_t | num_arcs_ |
int32_t | arc_capacity_ |
bool | const_capacities_ |
Extends the ListGraph by also storing the reverse arcs. This class also documents the Graph interface related to reverse arc.
|
inline |
|
inline |
ArcIndexType util::ReverseArcListGraph< NodeIndexType, ArcIndexType >::AddArc | ( | NodeIndexType | tail, |
NodeIndexType | head ) |
void util::ReverseArcListGraph< NodeIndexType, ArcIndexType >::AddNode | ( | NodeIndexType | node | ) |
|
inline |
void util::ReverseArcListGraph< NodeIndexType, ArcIndexType >::Build | ( | std::vector< ArcIndexType > * | permutation | ) |
NodeIndexType util::ReverseArcListGraph< NodeIndexType, ArcIndexType >::Head | ( | ArcIndexType | arc | ) | const |
BeginEndWrapper< IncomingArcIterator > util::ReverseArcListGraph< NodeIndexType, ArcIndexType >::IncomingArcs | ( | NodeIndexType | node | ) | const |
BeginEndWrapper< IncomingArcIterator > util::ReverseArcListGraph< NodeIndexType, ArcIndexType >::IncomingArcsStartingFrom | ( | NodeIndexType | node, |
ArcIndexType | from ) const |
ArcIndexType util::ReverseArcListGraph< NodeIndexType, ArcIndexType >::InDegree | ( | NodeIndexType | node | ) | const |
|
inline |
BeginEndWrapper< typename ReverseArcListGraph< NodeIndexType, ArcIndexType >::OutgoingHeadIterator > util::ReverseArcListGraph< NodeIndexType, ArcIndexType >::operator[] | ( | NodeIndexType | node | ) | const |
ArcIndexType util::ReverseArcListGraph< NodeIndexType, ArcIndexType >::OppositeArc | ( | ArcIndexType | arc | ) | const |
BeginEndWrapper< OppositeIncomingArcIterator > util::ReverseArcListGraph< NodeIndexType, ArcIndexType >::OppositeIncomingArcs | ( | NodeIndexType | node | ) | const |
BeginEndWrapper< OppositeIncomingArcIterator > util::ReverseArcListGraph< NodeIndexType, ArcIndexType >::OppositeIncomingArcsStartingFrom | ( | NodeIndexType | node, |
ArcIndexType | from ) const |
ArcIndexType util::ReverseArcListGraph< NodeIndexType, ArcIndexType >::OutDegree | ( | NodeIndexType | node | ) | const |
ReverseArcListGraph<>::OutDegree() and InDegree() work in O(degree).
BeginEndWrapper< OutgoingArcIterator > util::ReverseArcListGraph< NodeIndexType, ArcIndexType >::OutgoingArcs | ( | NodeIndexType | node | ) | const |
Arc iterations functions over the arcs touching a node (see the top-level comment for the different types). To be used as follows: for (const Graph::ArcIndex arc : IterationFunction(node)) { ... }
The StartingFrom() version are similar, but restart the iteration from a given arc position (which must be valid in the iteration context).
BeginEndWrapper< OutgoingArcIterator > util::ReverseArcListGraph< NodeIndexType, ArcIndexType >::OutgoingArcsStartingFrom | ( | NodeIndexType | node, |
ArcIndexType | from ) const |
BeginEndWrapper< OutgoingOrOppositeIncomingArcIterator > util::ReverseArcListGraph< NodeIndexType, ArcIndexType >::OutgoingOrOppositeIncomingArcs | ( | NodeIndexType | node | ) | const |
BeginEndWrapper< OutgoingOrOppositeIncomingArcIterator > util::ReverseArcListGraph< NodeIndexType, ArcIndexType >::OutgoingOrOppositeIncomingArcsStartingFrom | ( | NodeIndexType | node, |
ArcIndexType | from ) const |
|
override |
|
override |
NodeIndexType util::ReverseArcListGraph< NodeIndexType, ArcIndexType >::Tail | ( | ArcIndexType | arc | ) | const |