![]() |
Google OR-Tools v9.12
a fast and portable software suite for combinatorial optimization
|
#include <graph.h>
Public Member Functions | |
OutgoingOrOppositeIncomingArcIterator (const ReverseArcListGraph &graph, NodeIndexType node) | |
OutgoingOrOppositeIncomingArcIterator (const ReverseArcListGraph &graph, NodeIndexType node, ArcIndexType arc) | |
bool | Ok () const |
ArcIndexType | Index () const |
void | Next () |
DEFINE_STL_ITERATOR_FUNCTIONS (OutgoingOrOppositeIncomingArcIterator) | |
bool | IsArcValid (ArcIndexType arc) const |
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 |
![]() | |
BaseGraph () | |
BaseGraph (const BaseGraph &)=default | |
BaseGraph & | operator= (const BaseGraph &)=default |
virtual | ~BaseGraph ()=default |
NodeIndexType | num_nodes () const |
NodeIndexType | size () const |
ArcIndexType | num_arcs () const |
Returns the number of valid arcs in the graph. | |
IntegerRange< NodeIndex > | AllNodes () const |
BaseGraph implementation -------------------------------------------------—. | |
IntegerRange< ArcIndex > | AllForwardArcs () const |
bool | IsNodeValid (NodeIndexType node) const |
Returns true if the given node is a valid node of the graph. | |
bool | IsArcValid (ArcIndexType arc) const |
NodeIndexType | node_capacity () const |
Capacity reserved for future nodes, always >= num_nodes_. | |
ArcIndexType | arc_capacity () const |
Capacity reserved for future arcs, always >= num_arcs_. | |
void | Reserve (NodeIndexType node_capacity, ArcIndexType arc_capacity) |
void | FreezeCapacities () |
BaseGraph () | |
BaseGraph (const BaseGraph &)=default | |
BaseGraph & | operator= (const BaseGraph &)=default |
virtual | ~BaseGraph ()=default |
NodeIndexType | num_nodes () const |
NodeIndexType | size () const |
ArcIndexType | num_arcs () const |
Returns the number of valid arcs in the graph. | |
IntegerRange< NodeIndex > | AllNodes () const |
BaseGraph implementation -------------------------------------------------—. | |
IntegerRange< ArcIndex > | AllForwardArcs () const |
bool | IsNodeValid (NodeIndexType node) const |
Returns true if the given node is a valid node of the graph. | |
bool | IsArcValid (ArcIndexType arc) const |
NodeIndexType | node_capacity () const |
Capacity reserved for future nodes, always >= num_nodes_. | |
ArcIndexType | arc_capacity () const |
Capacity reserved for future arcs, always >= num_arcs_. | |
void | Reserve (NodeIndexType node_capacity, ArcIndexType arc_capacity) |
void | FreezeCapacities () |
Additional Inherited Members | |
![]() | |
typedef NodeIndexType | NodeIndex |
typedef ArcIndexType | ArcIndex |
![]() | |
static constexpr bool | kHasNegativeReverseArcs |
static const NodeIndexType | kNilNode |
static const ArcIndexType | kNilArc |
static constexpr bool | kHasNegativeReverseArcs |
static const NodeIndexType | kNilNode |
static const ArcIndexType | kNilArc |
![]() | |
void | ComputeCumulativeSum (std::vector< ArcIndexType > *v) |
Functions commented when defined because they are implementation details. | |
void | BuildStartAndForwardHead (SVector< NodeIndexType > *head, std::vector< ArcIndexType > *start, std::vector< ArcIndexType > *permutation) |
void | ComputeCumulativeSum (std::vector< ArcIndexType > *v) |
Functions commented when defined because they are implementation details. | |
void | BuildStartAndForwardHead (SVector< NodeIndexType > *head, std::vector< ArcIndexType > *start, std::vector< ArcIndexType > *permutation) |
![]() | |
NodeIndexType | num_nodes_ |
NodeIndexType | node_capacity_ |
ArcIndexType | num_arcs_ |
ArcIndexType | arc_capacity_ |
bool | const_capacities_ |
NodeIndexType | num_nodes_ |
NodeIndexType | node_capacity_ |
ArcIndexType | num_arcs_ |
ArcIndexType | arc_capacity_ |
bool | const_capacities_ |
|
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 | ) |
util::ReverseArcListGraph< NodeIndexType, ArcIndexType >::OutgoingOrOppositeIncomingArcIterator::DEFINE_STL_ITERATOR_FUNCTIONS | ( | OutgoingOrOppositeIncomingArcIterator | ) |
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 |
( | ArcIndexType | arc | ) | const |
Returns true if the given arc is a valid arc of the graph.
|
inline |
|
inline |
|
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), or kNilArc
, in which case an empty range is returned.
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 |
|
overridevirtual |
Reimplemented from util::BaseGraph< NodeIndexType, ArcIndexType, true >.
|
overridevirtual |
Reimplemented from util::BaseGraph< NodeIndexType, ArcIndexType, true >.
|
inline |
|
inline |
NodeIndexType util::ReverseArcListGraph< NodeIndexType, ArcIndexType >::Tail | ( | ArcIndexType | arc | ) | const |