![]() |
Google OR-Tools v9.12
a fast and portable software suite for combinatorial optimization
|
#include <graph.h>
Classes | |
class | OutgoingArcIterator |
Public Member Functions | |
CompleteBipartiteGraph (NodeIndexType left_nodes, NodeIndexType right_nodes) | |
ArcIndexType | GetArc (NodeIndexType left_node, NodeIndexType right_node) const |
NodeIndexType | Head (ArcIndexType arc) const |
NodeIndexType | Tail (ArcIndexType arc) const |
ArcIndexType | OutDegree (NodeIndexType node) const |
IntegerRange< ArcIndexType > | OutgoingArcs (NodeIndexType node) const |
IntegerRange< ArcIndexType > | OutgoingArcsStartingFrom (NodeIndexType node, ArcIndexType from) const |
IntegerRange< NodeIndexType > | operator[] (NodeIndexType node) const |
![]() | |
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 () |
Additional Inherited Members | |
![]() | |
typedef int32_t | NodeIndex |
typedef int32_t | ArcIndex |
![]() | |
static constexpr bool | kHasNegativeReverseArcs |
static const int32_t | kNilNode |
static const int32_t | kNilArc |
![]() | |
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) |
![]() | |
int32_t | num_nodes_ |
int32_t | node_capacity_ |
int32_t | num_arcs_ |
int32_t | arc_capacity_ |
bool | const_capacities_ |
CompleteBipartiteGraph implementation ------------------------------------— Nodes and arcs are implicit and not stored.
|
inline |
Builds a complete bipartite graph from a set of left nodes to a set of right nodes. Indices of left nodes of the bipartite graph range from 0 to left_nodes-1; indices of right nodes range from left_nodes to left_nodes+right_nodes-1. If there are no right nodes, the divisor is arbitrary. We pick 2 as 0 and 1 are not supported by ConstantDivisor
. We handle the case where right_nodes
is 1 explicitly when dividing.
ArcIndexType util::CompleteBipartiteGraph< NodeIndexType, ArcIndexType >::GetArc | ( | NodeIndexType | left_node, |
NodeIndexType | right_node ) const |
NodeIndexType util::CompleteBipartiteGraph< NodeIndexType, ArcIndexType >::Head | ( | ArcIndexType | arc | ) | const |
IntegerRange< NodeIndexType > util::CompleteBipartiteGraph< NodeIndexType, ArcIndexType >::operator[] | ( | NodeIndexType | node | ) | const |
ArcIndexType util::CompleteBipartiteGraph< NodeIndexType, ArcIndexType >::OutDegree | ( | NodeIndexType | node | ) | const |
IntegerRange< ArcIndexType > util::CompleteBipartiteGraph< NodeIndexType, ArcIndexType >::OutgoingArcs | ( | NodeIndexType | node | ) | const |
IntegerRange< ArcIndexType > util::CompleteBipartiteGraph< NodeIndexType, ArcIndexType >::OutgoingArcsStartingFrom | ( | NodeIndexType | node, |
ArcIndexType | from ) const |
NodeIndexType util::CompleteBipartiteGraph< NodeIndexType, ArcIndexType >::Tail | ( | ArcIndexType | arc | ) | const |