![]() |
Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
|
StaticGraph with reverse arc.
#include <graph.h>
Classes | |
| class | OutgoingOrOppositeIncomingArcIterator |
Public Types | |
| using | OppositeIncomingArcIterator = IntegerRangeIterator<ArcIndexType> |
| using | IncomingArcIterator |
| using | OutgoingArcIterator = IntegerRangeIterator<ArcIndexType> |
| Public Types inherited from util::BaseGraph< int32_t, int32_t, true > | |
| typedef int32_t | NodeIndex |
| typedef int32_t | ArcIndex |
Public Member Functions | |
| ReverseArcStaticGraph () | |
| ReverseArcStaticGraph (NodeIndexType num_nodes, ArcIndexType arc_capacity) | |
| ArcIndexType | OppositeArc (ArcIndexType arc) const |
| NodeIndexType | Head (ArcIndexType arc) const |
| NodeIndexType | Tail (ArcIndexType arc) const |
| ArcIndexType | OutDegree (NodeIndexType node) const |
| ReverseArcStaticGraph<>::OutDegree() and InDegree() work in O(1). | |
| ArcIndexType | InDegree (NodeIndexType node) const |
| IntegerRange< ArcIndexType > | OutgoingArcs (NodeIndexType node) const |
| IntegerRange< ArcIndexType > | OutgoingArcsStartingFrom (NodeIndexType node, ArcIndexType from) const |
| IntegerRange< ArcIndexType > | OppositeIncomingArcs (NodeIndexType node) const |
| IntegerRange< ArcIndexType > | OppositeIncomingArcsStartingFrom (NodeIndexType node, ArcIndexType from) const |
| BeginEndWrapper< IncomingArcIterator > | IncomingArcs (NodeIndexType node) const |
| BeginEndWrapper< IncomingArcIterator > | IncomingArcsStartingFrom (NodeIndexType node, ArcIndexType from) const |
| BeginEndWrapper< OutgoingOrOppositeIncomingArcIterator > | OutgoingOrOppositeIncomingArcs (NodeIndexType node) const |
| BeginEndWrapper< OutgoingOrOppositeIncomingArcIterator > | OutgoingOrOppositeIncomingArcsStartingFrom (NodeIndexType node, ArcIndexType from) const |
| absl::Span< const NodeIndexType > | operator[] (NodeIndexType node) const |
| 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 & | 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 () |
Additional Inherited Members | |
| Static Public Attributes inherited from util::BaseGraph< int32_t, int32_t, true > | |
| static constexpr bool | kHasNegativeReverseArcs |
| static constexpr int32_t | kNilNode |
| static constexpr int32_t | kNilArc |
| Protected Member Functions inherited from util::BaseGraph< int32_t, int32_t, true > | |
| void | ComputeCumulativeSum (internal::Vector< int32_t, int32_t > *v) |
| Functions commented when defined because they are implementation details. | |
| void | BuildStartAndForwardHead (internal::SVector< int32_t, int32_t > *head, internal::Vector< int32_t, 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_ |
| using util::ReverseArcStaticGraph< NodeIndexType, ArcIndexType >::IncomingArcIterator |
| using util::ReverseArcStaticGraph< NodeIndexType, ArcIndexType >::OppositeIncomingArcIterator = IntegerRangeIterator<ArcIndexType> |
| using util::ReverseArcStaticGraph< NodeIndexType, ArcIndexType >::OutgoingArcIterator = IntegerRangeIterator<ArcIndexType> |
|
inline |
|
inline |
| ArcIndexType util::ReverseArcStaticGraph< NodeIndexType, ArcIndexType >::AddArc | ( | NodeIndexType | tail, |
| NodeIndexType | head ) |
| void util::ReverseArcStaticGraph< NodeIndexType, ArcIndexType >::AddNode | ( | NodeIndexType | node | ) |
|
inline |
| void util::ReverseArcStaticGraph< NodeIndexType, ArcIndexType >::Build | ( | std::vector< ArcIndexType > * | permutation | ) |
Computes incoming degree of each nodes.
Computes the reverse arcs of the forward arcs.
Computes in reverse_start_ the start index of the reverse arcs.
Fill reverse arc information.
| NodeIndexType util::ReverseArcStaticGraph< NodeIndexType, ArcIndexType >::Head | ( | ArcIndexType | arc | ) | const |
|
inline |
|
inline |
| ArcIndexType util::ReverseArcStaticGraph< NodeIndexType, ArcIndexType >::InDegree | ( | NodeIndexType | node | ) | const |
|
inline |
| absl::Span< const NodeIndexType > util::ReverseArcStaticGraph< NodeIndexType, ArcIndexType >::operator[] | ( | NodeIndexType | node | ) | const |
| ArcIndexType util::ReverseArcStaticGraph< NodeIndexType, ArcIndexType >::OppositeArc | ( | ArcIndexType | arc | ) | const |
|
inline |
|
inline |
| ArcIndexType util::ReverseArcStaticGraph< NodeIndexType, ArcIndexType >::OutDegree | ( | NodeIndexType | node | ) | const |
ReverseArcStaticGraph<>::OutDegree() and InDegree() work in O(1).
|
inline |
|
inline |
| BeginEndWrapper< OutgoingOrOppositeIncomingArcIterator > util::ReverseArcStaticGraph< NodeIndexType, ArcIndexType >::OutgoingOrOppositeIncomingArcs | ( | NodeIndexType | node | ) | const |
| BeginEndWrapper< OutgoingOrOppositeIncomingArcIterator > util::ReverseArcStaticGraph< NodeIndexType, ArcIndexType >::OutgoingOrOppositeIncomingArcsStartingFrom | ( | NodeIndexType | node, |
| ArcIndexType | from ) const |
|
override |
| NodeIndexType util::ReverseArcStaticGraph< NodeIndexType, ArcIndexType >::Tail | ( | ArcIndexType | arc | ) | const |