C++ Reference
C++ Reference: Graph
ebert_graph.h
Go to the documentation of this file.
AnnotatedGraphBuildManager(typename GraphType::NodeIndex num_nodes, typename GraphType::ArcIndex num_arcs, bool sort_arcs)
Definition: ebert_graph.h:2069
bool operator()(typename GraphType::ArcIndex a, typename GraphType::ArcIndex b) const
Definition: ebert_graph.h:1945
ArcFunctorOrderingByTailAndHead(const GraphType &graph)
Definition: ebert_graph.h:1942
void operator=(const IncomingArcIterator &iterator)
Definition: ebert_graph.h:1320
IncomingArcIterator(const EbertGraph &graph, NodeIndexType node, ArcIndexType arc)
Definition: ebert_graph.h:1310
bool Ok() const
Definition: ebert_graph.h:1327
IncomingArcIterator(const EbertGraph &graph, NodeIndexType node)
Definition: ebert_graph.h:1301
ArcIndexType Index() const
Definition: ebert_graph.h:1336
Definition: ebert_graph.h:1238
OutgoingOrOppositeIncomingArcIterator(const EbertGraph &graph, NodeIndexType node, ArcIndexType arc)
Definition: ebert_graph.h:1251
void Next()
Definition: ebert_graph.h:1270
bool Ok() const
Definition: ebert_graph.h:1267
OutgoingOrOppositeIncomingArcIterator(const EbertGraph &graph, NodeIndexType node)
Definition: ebert_graph.h:1240
ArcIndexType Index() const
Definition: ebert_graph.h:1276
void operator=(const OutgoingOrOppositeIncomingArcIterator &iterator)
Definition: ebert_graph.h:1260
~CycleHandlerForAnnotatedArcs() override
Definition: ebert_graph.h:1096
void SetIndexFromIndex(ArcIndexType source, ArcIndexType destination) const override
Definition: ebert_graph.h:1067
bool Unseen(ArcIndexType permutation_element) const override
Definition: ebert_graph.h:1092
CycleHandlerForAnnotatedArcs(PermutationCycleHandler< ArcIndexType > *annotation_handler, DerivedGraph *graph)
Definition: ebert_graph.h:1051
void SetTempFromIndex(ArcIndexType source) override
Definition: ebert_graph.h:1059
void SetIndexFromTemp(ArcIndexType destination) const override
Definition: ebert_graph.h:1076
void SetSeen(ArcIndexType *permutation_element) const override
Definition: ebert_graph.h:1088
static const NodeIndexType kNilNode
Definition: ebert_graph.h:217
ZVector< ArcIndexType > next_adjacent_arc_
Definition: ebert_graph.h:1148
bool IsNodeValid(NodeIndexType node) const
Definition: ebert_graph.h:280
ArcIndexType max_num_arcs_
Definition: ebert_graph.h:490
static const ArcIndexType kFirstArc
Definition: ebert_graph.h:226
ArcIndexType NextOutgoingArc(const NodeIndexType unused_node, const ArcIndexType arc) const
Definition: ebert_graph.h:1139
ZVector< ArcIndexType > first_incident_arc_
Definition: ebert_graph.h:503
static const ArcIndexType kMaxNumArcs
Definition: ebert_graph.h:236
bool Reserve(NodeIndexType new_max_num_nodes, ArcIndexType new_max_num_arcs)
Definition: ebert_graph.h:979
bool representation_clean_
Definition: ebert_graph.h:1153
ArcIndexType AddArc(NodeIndexType tail, NodeIndexType head)
Definition: ebert_graph.h:1002
ZVector< NodeIndexType > head_
Definition: ebert_graph.h:499
ArcIndexType end_arc_index() const
Definition: ebert_graph.h:253
void Initialize(NodeIndexType max_num_nodes, ArcIndexType max_num_arcs)
Definition: ebert_graph.h:1113
NodeIndexType num_nodes_
Definition: ebert_graph.h:493
ArcIndexType FirstOutgoingOrOppositeIncomingArc(const NodeIndexType node) const
Definition: ebert_graph.h:1124
void GroupForwardArcsByFunctor(const ArcIndexTypeStrictWeakOrderingFunctor &compare, PermutationCycleHandler< ArcIndexType > *annotation_handler)
Definition: ebert_graph.h:1023
static const ArcIndexType kNilArc
Definition: ebert_graph.h:220
static const NodeIndexType kMaxNumNodes
Definition: ebert_graph.h:231
NodeIndexType max_num_nodes_
Definition: ebert_graph.h:487
static const NodeIndexType kFirstNode
Definition: ebert_graph.h:223
ArcIndexType NextAdjacentArc(const ArcIndexType arc) const
Definition: ebert_graph.h:1132
bool IsOutgoingOrOppositeIncoming(ArcIndexType arc, NodeIndexType node) const
Definition: ebert_graph.h:1430
bool IsDirect(const ArcIndexType arc) const
Definition: ebert_graph.h:1418
void BuildRepresentation()
Definition: ebert_graph.h:1449
bool IsIncoming(ArcIndexType arc, NodeIndexType node) const
Definition: ebert_graph.h:1436
NodeIndexType DirectArcHead(const ArcIndexType arc) const
Definition: ebert_graph.h:1392
bool CheckArcValidity(const ArcIndexType arc) const
Definition: ebert_graph.h:1372
ArcIndexType Opposite(const ArcIndexType arc) const
Definition: ebert_graph.h:1410
bool IsOutgoing(ArcIndexType arc, NodeIndexType node) const
Definition: ebert_graph.h:1441
std::string DebugString() const
Definition: ebert_graph.h:1459
bool IsReverse(const ArcIndexType arc) const
Definition: ebert_graph.h:1424
ArcIndexType ReverseArc(const ArcIndexType arc) const
Definition: ebert_graph.h:1403
ArcIndexType DirectArc(const ArcIndexType arc) const
Definition: ebert_graph.h:1397
NodeIndexType Tail(const ArcIndexType arc) const
Definition: ebert_graph.h:1377
EbertGraph(NodeIndexType max_num_nodes, ArcIndexType max_num_arcs)
Definition: ebert_graph.h:1229
bool CheckArcBounds(const ArcIndexType arc) const
Definition: ebert_graph.h:1364
NodeIndexType DirectArcTail(const ArcIndexType arc) const
Definition: ebert_graph.h:1385
ForwardEbertGraph(NodeIndexType max_num_nodes, ArcIndexType max_num_arcs)
Definition: ebert_graph.h:1604
void BuildRepresentation()
Definition: ebert_graph.h:1647
ForwardEbertGraph()
Definition: ebert_graph.h:1602
bool IsIncoming(ArcIndexType arc, NodeIndexType node) const
Definition: ebert_graph.h:1639
bool BuildTailArray()
Definition: ebert_graph.h:1657
bool CheckArcValidity(const ArcIndexType arc) const
Definition: ebert_graph.h:1621
void ReleaseTailArray()
Definition: ebert_graph.h:1685
bool CheckTailIndexValidity(const ArcIndexType arc) const
Definition: ebert_graph.h:1626
std::string DebugString() const
Definition: ebert_graph.h:1699
NodeIndexType Tail(const ArcIndexType arc) const
Definition: ebert_graph.h:1632
bool CheckArcBounds(const ArcIndexType arc) const
Definition: ebert_graph.h:1613
~ForwardEbertGraph()
Definition: ebert_graph.h:1608
bool TailArrayComplete() const
Definition: ebert_graph.h:1688
NodeIndexType NodeIndex
Definition: ebert_graph.h:1599
void SetIndexFromIndex(ArcIndexType source, ArcIndexType destination) const override
Definition: ebert_graph.h:587
CycleHandlerForAnnotatedArcs(PermutationCycleHandler< ArcIndexType > *annotation_handler, NodeIndexType *data)
Definition: ebert_graph.h:576
void SetTempFromIndex(ArcIndexType source) override
Definition: ebert_graph.h:582
void SetIndexFromTemp(ArcIndexType destination) const override
Definition: ebert_graph.h:593
bool IsIncoming(ArcIndexType arc, NodeIndexType node) const
Definition: ebert_graph.h:764
bool BuildTailArray()
Definition: ebert_graph.h:817
bool CheckArcValidity(const ArcIndexType arc) const
Definition: ebert_graph.h:779
void ReleaseTailArray()
Definition: ebert_graph.h:845
bool CheckTailIndexValidity(const ArcIndexType arc) const
Definition: ebert_graph.h:784
ArcIndexType NextOutgoingArc(const NodeIndexType node, ArcIndexType arc) const
Definition: ebert_graph.h:789
ForwardStaticGraph(const NodeIndexType num_nodes, const ArcIndexType num_arcs, const bool sort_arcs_by_head, std::vector< std::pair< NodeIndexType, NodeIndexType > > *client_input_arcs, operations_research::PermutationCycleHandler< ArcIndexType > *const client_cycle_handler)
Definition: ebert_graph.h:622
std::string DebugString() const
Definition: ebert_graph.h:803
NodeIndexType Tail(const ArcIndexType arc) const
Definition: ebert_graph.h:757
bool CheckArcBounds(const ArcIndexType arc) const
Definition: ebert_graph.h:771
bool TailArrayComplete() const
Definition: ebert_graph.h:848
NodeIndexType NodeIndex
Definition: ebert_graph.h:565
PermutationIndexComparisonByArcHead(const ZVector< NodeIndexType > &head)
Definition: ebert_graph.h:522
bool operator()(ArcIndexType a, ArcIndexType b) const
Definition: ebert_graph.h:526
ArcIterator(const DerivedGraph &graph)
Definition: ebert_graph.h:346
ArcIndexType Index() const
Definition: ebert_graph.h:356
NodeIterator(const DerivedGraph &graph)
Definition: ebert_graph.h:323
NodeIndexType Index() const
Definition: ebert_graph.h:333
void Next()
Definition: ebert_graph.h:397
void operator=(const OutgoingArcIterator &iterator)
Definition: ebert_graph.h:387
bool Ok() const
Definition: ebert_graph.h:394
ArcIndexType Index() const
Definition: ebert_graph.h:403
OutgoingArcIterator(const DerivedGraph &graph, NodeIndexType node, ArcIndexType arc)
Definition: ebert_graph.h:378
OutgoingArcIterator(const DerivedGraph &graph, NodeIndexType node)
Definition: ebert_graph.h:369
static const NodeIndexType kNilNode
Definition: ebert_graph.h:217
ArcIndexType NextArc(const ArcIndexType arc) const
Definition: ebert_graph.h:473
NodeIndexType max_num_nodes() const
Definition: ebert_graph.h:256
bool IsNodeValid(NodeIndexType node) const
Definition: ebert_graph.h:280
ArcIndexType max_num_arcs_
Definition: ebert_graph.h:490
static const ArcIndexType kFirstArc
Definition: ebert_graph.h:226
ArcIndexType num_arcs() const
Definition: ebert_graph.h:242
NodeIndexType Head(const ArcIndexType arc) const
Definition: ebert_graph.h:298
ZVector< ArcIndexType > first_incident_arc_
Definition: ebert_graph.h:503
std::string ArcDebugString(const ArcIndexType arc) const
Definition: ebert_graph.h:311
static const ArcIndexType kMaxNumArcs
Definition: ebert_graph.h:236
NodeIndexType num_nodes() const
Definition: ebert_graph.h:238
ArcIndexType max_num_arcs() const
Definition: ebert_graph.h:260
std::string NodeDebugString(const NodeIndexType node) const
Definition: ebert_graph.h:303
ZVector< NodeIndexType > head_
Definition: ebert_graph.h:499
ArcIndexType end_arc_index() const
Definition: ebert_graph.h:253
static const ArcIndexType kNilArc
Definition: ebert_graph.h:220
ArcIndexType max_end_arc_index() const
Definition: ebert_graph.h:272
static const NodeIndexType kMaxNumNodes
Definition: ebert_graph.h:231
NodeIndexType max_num_nodes_
Definition: ebert_graph.h:487
NodeIndexType end_node_index() const
Definition: ebert_graph.h:248
NodeIndexType StartNode(NodeIndexType node) const
Definition: ebert_graph.h:440
ArcIndexType FirstOutgoingArc(const NodeIndexType node) const
Definition: ebert_graph.h:480
static const NodeIndexType kFirstNode
Definition: ebert_graph.h:223
NodeIndexType max_end_node_index() const
Definition: ebert_graph.h:265
NodeIndexType NextNode(const NodeIndexType node) const
Definition: ebert_graph.h:459
ArcIndexType StartArc(ArcIndexType arc) const
Definition: ebert_graph.h:446
ArcIndexType LookUpArc(const NodeIndexType tail, const NodeIndexType head) const
Definition: ebert_graph.h:286
bool BuildTailArrayFromAdjacencyListsIfForwardGraph() const
Definition: ebert_graph.h:1921
TailArrayManager(GraphType *g)
Definition: ebert_graph.h:1919
void ReleaseTailArrayIfForwardGraph() const
Definition: ebert_graph.h:1928
GraphType * Graph(PermutationCycleHandler< typename GraphType::ArcIndex > *client_cycle_handler)
Definition: ebert_graph.h:2043
bool Reserve(const typename GraphType::NodeIndex new_max_num_nodes, const typename GraphType::ArcIndex new_max_num_arcs)
Definition: ebert_graph.h:2032
GraphType::ArcIndex AddArc(const typename GraphType::NodeIndex tail, const typename GraphType::NodeIndex head)
Definition: ebert_graph.h:2037
GraphBuilderFromArcs(typename GraphType::NodeIndex max_num_nodes, typename GraphType::ArcIndex max_num_arcs, bool sort_arcs)
Definition: ebert_graph.h:2026
GraphType::ArcIndex AddArc(typename GraphType::NodeIndex tail, typename GraphType::NodeIndex head)
Definition: ebert_graph.h:1973
GraphType * Graph(PermutationCycleHandler< typename GraphType::ArcIndex > *client_cycle_handler)
Definition: ebert_graph.h:1992
GraphBuilderFromArcs(typename GraphType::NodeIndex max_num_nodes, typename GraphType::ArcIndex max_num_arcs, bool sort_arcs)
Definition: ebert_graph.h:1966
Definition: christofides.h:43
ZVector< FlowQuantity > QuantityArray
Definition: ebert_graph.h:210
ForwardStaticGraph< NodeIndex, ArcIndex > ForwardStarStaticGraph
Definition: ebert_graph.h:207
ForwardEbertGraph< NodeIndex, ArcIndex > ForwardStarGraph
Definition: ebert_graph.h:206
bool BuildLineGraph(const GraphType &graph, GraphType *const line_graph)
Definition: ebert_graph.h:2089
EbertGraph< NodeIndex, ArcIndex > StarGraph
Definition: ebert_graph.h:205
static constexpr bool has_reverse_arcs
Definition: ebert_graph.h:1850
static constexpr bool is_dynamic
Definition: ebert_graph.h:1851
bool BuildTailArray() const
Definition: ebert_graph.h:1886
GraphType *const graph_
Definition: ebert_graph.h:1888
TailArrayBuilder(GraphType *graph)
Definition: ebert_graph.h:1884
bool BuildTailArray() const
Definition: ebert_graph.h:1876
TailArrayBuilder(GraphType *unused_graph)
Definition: ebert_graph.h:1874
GraphType *const graph_
Definition: ebert_graph.h:1911
void ReleaseTailArray() const
Definition: ebert_graph.h:1909
TailArrayReleaser(GraphType *graph)
Definition: ebert_graph.h:1907
void ReleaseTailArray() const
Definition: ebert_graph.h:1899
TailArrayReleaser(GraphType *unused_graph)
Definition: ebert_graph.h:1897