C++ Reference
C++ Reference: Graph
graph.h
Go to the documentation of this file.
966 HasReverseArcs>::FreezeCapacities() {
BeginEndWrapper< IncomingArcIterator > IncomingArcs(NodeIndexType node) const
void PermuteWithExplicitElementType(const IntVector &permutation, Array *array_to_permute, ElementType unused)
Definition: graph.h:724
ArcIndexType OppositeArc(ArcIndexType arc) const
Definition: graph.h:1702
void Next()
Definition: graph.h:1910
ArcIndexType Index() const
Definition: graph.h:2109
BeginEndWrapper< OutgoingArcIterator > OutgoingArcsStartingFrom(NodeIndexType node, ArcIndexType from) const
ReverseArcStaticGraph(NodeIndexType num_nodes, ArcIndexType arc_capacity)
Definition: graph.h:559
IntegerRange< ArcIndexType > OutgoingArcs(NodeIndexType node) const
Definition: graph.h:2321
OutgoingArcIterator(const CompleteBipartiteGraph &graph, NodeIndexType node)
Definition: graph.h:2280
NodeIndexType Head(ArcIndexType arc) const
Definition: graph.h:2300
bool operator!=(const typename ListGraph< NodeIndexType, ArcIndexType >::OutgoingHeadIterator &other) const
Definition: graph.h:1224
void Next()
Definition: graph.h:2145
OutgoingArcIterator(const ListGraph &graph, NodeIndexType node, ArcIndexType arc)
Definition: graph.h:1178
Definition: graph.h:460
BeginEndWrapper< OutgoingOrOppositeIncomingArcIterator > OutgoingOrOppositeIncomingArcsStartingFrom(NodeIndexType node, ArcIndexType from) const
OutgoingArcIterator(const StaticGraph &graph, NodeIndexType node, ArcIndexType arc)
Definition: graph.h:1389
OutgoingArcIterator(const StaticGraph &graph, NodeIndexType node)
Definition: graph.h:1387
IncomingArcIterator(const ReverseArcListGraph &graph, NodeIndexType node, ArcIndexType arc)
Definition: graph.h:1586
DEFINE_STL_ITERATOR_FUNCTIONS(OutgoingHeadIterator)
IntegerRange< ArcIndexType > OutgoingArcsStartingFrom(NodeIndexType node, ArcIndexType from) const
Definition: graph.h:2228
DEFINE_STL_ITERATOR_FUNCTIONS(OppositeIncomingArcIterator)
BeginEndWrapper< OppositeIncomingArcIterator > OppositeIncomingArcs(NodeIndexType node) const
ArcIndexType Index() const
Definition: graph.h:1811
ReverseArcMixedGraph(NodeIndexType num_nodes, ArcIndexType arc_capacity)
Definition: graph.h:647
DEFINE_STL_ITERATOR_FUNCTIONS(OutgoingOrOppositeIncomingArcIterator)
void ComputeCumulativeSum(std::vector< ArcIndexType > *v)
Definition: graph.h:978
ArcIndexType index_
Definition: graph.h:1577
const ReverseArcMixedGraph * graph_
Definition: graph.h:2095
ArcIndexType Index() const
Definition: graph.h:1874
NodeIndexType operator*() const
Definition: graph.h:1229
ArcIndexType Index() const
Definition: graph.h:1656
void ReserveNodes(NodeIndexType bound) override
Definition: graph.h:1148
OppositeIncomingArcIterator(const ReverseArcMixedGraph &graph, NodeIndexType node, ArcIndexType arc)
Definition: graph.h:2077
BeginEndWrapper< OutgoingHeadIterator > operator[](NodeIndexType node) const
Definition: graph.h:1428
BeginEndWrapper< OutgoingOrOppositeIncomingArcIterator > OutgoingOrOppositeIncomingArcs(NodeIndexType node) const
IncomingArcIterator(const ReverseArcListGraph &graph, NodeIndexType node)
Definition: graph.h:1584
BeginEndWrapper< OppositeIncomingArcIterator > OppositeIncomingArcsStartingFrom(NodeIndexType node, ArcIndexType from) const
OutgoingOrOppositeIncomingArcIterator(const ReverseArcMixedGraph &graph, NodeIndexType node, ArcIndexType arc)
Definition: graph.h:2132
ArcIndexType Index() const
Definition: graph.h:1908
DEFINE_STL_ITERATOR_FUNCTIONS(OutgoingArcIterator)
ArcIndexType index_
Definition: graph.h:1858
StaticGraph(NodeIndexType num_nodes, ArcIndexType arc_capacity)
Definition: graph.h:407
DEFINE_STL_ITERATOR_FUNCTIONS(OutgoingArcIterator)
void Reserve(NodeIndexType node_capacity, ArcIndexType arc_capacity)
Definition: graph.h:247
Definition: graph.h:2170
OppositeIncomingArcIterator(const ReverseArcListGraph &graph, NodeIndexType node)
Definition: graph.h:1553
BeginEndWrapper< OutgoingOrOppositeIncomingArcIterator > OutgoingOrOppositeIncomingArcs(NodeIndexType node) const
OutgoingOrOppositeIncomingArcIterator(const ReverseArcMixedGraph &graph, NodeIndexType node)
Definition: graph.h:2122
BeginEndWrapper< IncomingArcIterator > IncomingArcsStartingFrom(NodeIndexType node, ArcIndexType from) const
BeginEndWrapper< OutgoingArcIterator > OutgoingArcsStartingFrom(NodeIndexType node, ArcIndexType from) const
bool Ok() const
Definition: graph.h:2140
void BuildStartAndForwardHead(SVector< NodeIndexType > *head, std::vector< ArcIndexType > *start, std::vector< ArcIndexType > *permutation)
Definition: graph.h:995
DEFINE_STL_ITERATOR_FUNCTIONS(IncomingArcIterator)
ArcIndexType Index() const
Definition: graph.h:1536
BeginEndWrapper< OutgoingOrOppositeIncomingArcIterator > OutgoingOrOppositeIncomingArcsStartingFrom(NodeIndexType node, ArcIndexType from) const
Definition: graph.h:2248
ArcIndexType OutDegree(NodeIndexType node) const
Definition: graph.h:1939
std::input_iterator_tag iterator_category
Definition: graph.h:1201
void ReserveNodes(NodeIndexType bound) override
Definition: graph.h:1255
ArcIndexType Index() const
Definition: graph.h:1593
OutgoingArcIterator(const ReverseArcStaticGraph &graph, NodeIndexType node)
Definition: graph.h:1802
DEFINE_STL_ITERATOR_FUNCTIONS(OutgoingArcIterator)
BeginEndWrapper< NodeIndexType const * > operator[](NodeIndexType node) const
Definition: graph.h:1243
BeginEndWrapper< OutgoingArcIterator > OutgoingArcs(NodeIndexType node) const
OppositeIncomingArcIterator(const ReverseArcStaticGraph &graph, NodeIndexType node, ArcIndexType arc)
Definition: graph.h:1838
BeginEndWrapper< OutgoingArcIterator > OutgoingArcsStartingFrom(NodeIndexType node, ArcIndexType from) const
IntegerRange< ArcIndexType > OutgoingArcsStartingFrom(NodeIndexType node, ArcIndexType from) const
Definition: graph.h:2333
OutgoingArcIterator(const ReverseArcListGraph &graph, NodeIndexType node)
Definition: graph.h:1524
ArcIndexType InDegree(NodeIndexType node) const
Definition: graph.h:1444
ArcIndexType InDegree(NodeIndexType node) const
Definition: graph.h:1945
BeginEndWrapper< OutgoingArcIterator > OutgoingArcs(NodeIndexType node) const
BeginEndWrapper< IncomingArcIterator > IncomingArcsStartingFrom(NodeIndexType node, ArcIndexType from) const
OutgoingHeadIterator(const ReverseArcListGraph &graph, NodeIndexType node)
Definition: graph.h:1644
Definition: graph.h:174
OutgoingOrOppositeIncomingArcIterator(const ReverseArcStaticGraph &graph, NodeIndexType node)
Definition: graph.h:1887
BeginEndWrapper< IncomingArcIterator > IncomingArcsStartingFrom(NodeIndexType node, ArcIndexType from) const
BeginEndWrapper< OutgoingArcIterator > OutgoingArcs(NodeIndexType node) const
ptrdiff_t difference_type
Definition: graph.h:1202
ArcIndexType OutDegree(NodeIndexType node) const
Definition: graph.h:2211
void GroupForwardArcsByFunctor(const A &a, B *b)
Definition: graph.h:264
OutgoingOrOppositeIncomingArcIterator(const ReverseArcListGraph &graph, NodeIndexType node)
Definition: graph.h:1606
Definition: graph.h:1172
OutgoingArcIterator(const ReverseArcMixedGraph &graph, NodeIndexType node, ArcIndexType arc)
Definition: graph.h:2044
ArcIndexType index_
Definition: graph.h:2096
BeginEndWrapper< OutgoingOrOppositeIncomingArcIterator > OutgoingOrOppositeIncomingArcsStartingFrom(NodeIndexType node, ArcIndexType from) const
const ReverseArcListGraph & graph_
Definition: graph.h:1576
DEFINE_STL_ITERATOR_FUNCTIONS(OppositeIncomingArcIterator)
IntegerRange< ArcIndex > AllForwardArcs() const
Definition: graph.h:935
BeginEndWrapper< NodeIndexType const * > operator[](NodeIndexType node) const
Definition: graph.h:1954
CompleteBipartiteGraph(NodeIndexType left_nodes, NodeIndexType right_nodes)
Definition: graph.h:2261
ListGraph(NodeIndexType num_nodes, ArcIndexType arc_capacity)
Definition: graph.h:312
OppositeIncomingArcIterator(const ReverseArcMixedGraph &graph, NodeIndexType node)
Definition: graph.h:2070
ArcIndexType Index() const
Definition: graph.h:1567
ArcIndexType Index() const
Definition: graph.h:1620
BeginEndWrapper< IncomingArcIterator > IncomingArcs(NodeIndexType node) const
ArcIndexType AddArc(NodeIndexType tail, NodeIndexType head)
Definition: graph.h:1279
IncomingArcIterator(const ReverseArcMixedGraph &graph, NodeIndexType node, ArcIndexType arc)
Definition: graph.h:2105
Definition: graph.h:396
OutgoingArcIterator(const ReverseArcListGraph &graph, NodeIndexType node, ArcIndexType arc)
Definition: graph.h:1528
OutgoingArcIterator(const ReverseArcMixedGraph &graph, NodeIndexType node)
Definition: graph.h:2042
ArcIndexType Index() const
Definition: graph.h:2051
DEFINE_STL_ITERATOR_FUNCTIONS(IncomingArcIterator)
OutgoingHeadIterator(const ListGraph &graph, NodeIndexType node, ArcIndexType arc)
Definition: graph.h:1211
BeginEndWrapper< OutgoingArcIterator > OutgoingArcs(NodeIndexType node) const
BeginEndWrapper< OppositeIncomingArcIterator > OppositeIncomingArcs(NodeIndexType node) const
ArcIndexType AddArc(NodeIndexType tail, NodeIndexType head)
Definition: graph.h:1741
Definition: graph.h:636
ArcIndexType OutDegree(NodeIndexType node) const
Definition: graph.h:1249
OutgoingHeadIterator(const ReverseArcListGraph &graph, NodeIndexType node, ArcIndexType arc)
Definition: graph.h:1648
ArcIndexType AddArc(NodeIndexType tail, NodeIndexType head)
Definition: graph.h:1500
ArcIndexType Index() const
Definition: graph.h:2286
ArcIndexType OppositeArc(ArcIndexType arc) const
Definition: graph.h:1961
Definition: iterators.h:146
BeginEndWrapper< OppositeIncomingArcIterator > OppositeIncomingArcsStartingFrom(NodeIndexType node, ArcIndexType from) const
IncomingArcIterator(const ReverseArcStaticGraph &graph, NodeIndexType node)
Definition: graph.h:1865
bool Ok() const
Definition: graph.h:1619
Definition: graph.h:548
const ArcIndexType limit_
Definition: graph.h:1857
Definition: graph.h:184
ArcIndexType Index() const
Definition: graph.h:2144
BeginEndWrapper< OutgoingOrOppositeIncomingArcIterator > OutgoingOrOppositeIncomingArcs(NodeIndexType node) const
const ReverseArcStaticGraph & graph_
Definition: graph.h:1856
ArcIndexType InDegree(NodeIndexType node) const
Definition: graph.h:1688
void ReserveArcs(ArcIndexType bound) override
Definition: graph.h:1983
BeginEndWrapper< OutgoingArcIterator > OutgoingArcsStartingFrom(NodeIndexType node, ArcIndexType from) const
OutgoingOrOppositeIncomingArcIterator(const ReverseArcStaticGraph &graph, NodeIndexType node, ArcIndexType arc)
Definition: graph.h:1897
DEFINE_STL_ITERATOR_FUNCTIONS(IncomingArcIterator)
void Next()
Definition: graph.h:1621
Definition: iterators.h:38
ArcIndexType OutDegree(NodeIndexType node) const
Definition: graph.h:1682
IntegerRange< NodeIndexType > operator[](NodeIndexType node) const
Definition: graph.h:2344
OutgoingArcIterator(const ListGraph &graph, NodeIndexType node)
Definition: graph.h:1174
DEFINE_STL_ITERATOR_FUNCTIONS(OutgoingOrOppositeIncomingArcIterator)
void ReserveArcs(ArcIndexType bound) override
Definition: graph.h:1725
BeginEndWrapper< OppositeIncomingArcIterator > OppositeIncomingArcsStartingFrom(NodeIndexType node, ArcIndexType from) const
DEFINE_RANGE_BASED_ARC_ITERATION(ListGraph, Outgoing, Base::kNilArc)
Definition: graph.h:297
DEFINE_STL_ITERATOR_FUNCTIONS(OutgoingOrOppositeIncomingArcIterator)
IncomingArcIterator(const ReverseArcStaticGraph &graph, NodeIndexType node, ArcIndexType arc)
Definition: graph.h:1867
IncomingArcIterator(const ReverseArcMixedGraph &graph, NodeIndexType node)
Definition: graph.h:2103
NodeIndexType Tail(ArcIndexType arc) const
Definition: graph.h:2307
BeginEndWrapper< OutgoingArcIterator > OutgoingArcsStartingFrom(NodeIndexType node, ArcIndexType from) const
ArcIndexType OppositeArc(ArcIndexType arc) const
Definition: graph.h:1452
DEFINE_STL_ITERATOR_FUNCTIONS(OutgoingArcIterator)
ReverseArcListGraph(NodeIndexType num_nodes, ArcIndexType arc_capacity)
Definition: graph.h:471
IntegerRange< NodeIndexType > operator[](NodeIndexType node) const
Definition: graph.h:2237
ArcIndexType OutDegree(NodeIndexType node) const
Definition: graph.h:1436
BeginEndWrapper< NodeIndexType const * > operator[](NodeIndexType node) const
Definition: graph.h:1695
void Permute(const IntVector &permutation, Array *array_to_permute)
Definition: graph.h:737
ArcIndexType OutDegree(NodeIndexType node) const
Definition: graph.h:2314
ArcIndexType Index() const
Definition: graph.h:1847
OutgoingHeadIterator(const ListGraph &graph, NodeIndexType node)
Definition: graph.h:1207
ArcIndexType AddArc(NodeIndexType tail, NodeIndexType head)
Definition: graph.h:1999
ArcIndexType Index() const
Definition: graph.h:2086
const NodeIndexType & reference
Definition: graph.h:1204
OppositeIncomingArcIterator(const ReverseArcListGraph &graph, NodeIndexType node, ArcIndexType arc)
Definition: graph.h:1558
IntegerRange< ArcIndexType > OutgoingArcs(NodeIndexType node) const
Definition: graph.h:2218
ArcIndexType AddArc(NodeIndexType tail, NodeIndexType head)
Definition: graph.h:1134
Definition: connected_components.h:56
BeginEndWrapper< OutgoingArcIterator > OutgoingArcs(NodeIndexType node) const
void ReserveArcs(ArcIndexType bound) override
Definition: graph.h:1481
BeginEndWrapper< IncomingArcIterator > IncomingArcs(NodeIndexType node) const
BeginEndWrapper< OutgoingHeadIterator > operator[](NodeIndexType node) const
Definition: graph.h:1097
BeginEndWrapper< OppositeIncomingArcIterator > OppositeIncomingArcs(NodeIndexType node) const
OutgoingArcIterator(const ReverseArcStaticGraph &graph, NodeIndexType node, ArcIndexType arc)
Definition: graph.h:1804
void ReserveNodes(NodeIndexType bound) override
Definition: graph.h:1472
OppositeIncomingArcIterator(const ReverseArcStaticGraph &graph, NodeIndexType node)
Definition: graph.h:1830
DEFINE_STL_ITERATOR_FUNCTIONS(OutgoingArcIterator)
OutgoingOrOppositeIncomingArcIterator(const ReverseArcListGraph &graph, NodeIndexType node, ArcIndexType arc)
Definition: graph.h:1612
DEFINE_STL_ITERATOR_FUNCTIONS(OppositeIncomingArcIterator)
bool Ok() const
Definition: graph.h:1909