OR-Tools  8.2
ListGraph< NodeIndexType, ArcIndexType >

Detailed Description

template<typename NodeIndexType = int32, typename ArcIndexType = int32>
class util::ListGraph< NodeIndexType, ArcIndexType >

Definition at line 298 of file graph.h.

Classes

class  OutgoingArcIterator
 
class  OutgoingHeadIterator
 

Public Types

typedef int32 NodeIndex
 
typedef int32 ArcIndex
 

Public Member Functions

 ListGraph ()
 
 ListGraph (NodeIndexType num_nodes, ArcIndexType arc_capacity)
 
void AddNode (NodeIndexType node)
 
ArcIndexType AddArc (NodeIndexType tail, NodeIndexType head)
 
void Build ()
 
void Build (std::vector< ArcIndexType > *permutation)
 
ArcIndexType OutDegree (NodeIndexType node) const
 
BeginEndWrapper< OutgoingArcIteratorOutgoingArcs (NodeIndexType node) const
 
BeginEndWrapper< OutgoingArcIteratorOutgoingArcsStartingFrom (NodeIndexType node, ArcIndexType from) const
 
BeginEndWrapper< OutgoingHeadIteratoroperator[] (NodeIndexType node) const
 
NodeIndexType Tail (ArcIndexType arc) const
 
NodeIndexType Head (ArcIndexType arc) const
 
void ReserveNodes (NodeIndexType bound) override
 
void ReserveArcs (ArcIndexType bound) override
 
bool IsArcValid (ArcIndexType arc) const
 
int32 num_nodes () const
 
int32 num_arcs () const
 
IntegerRange< NodeIndexAllNodes () const
 
IntegerRange< ArcIndexAllForwardArcs () const
 
bool IsNodeValid (int32 node) const
 
bool IsArcValid (int32 arc) const
 
int32 node_capacity () const
 
int32 arc_capacity () const
 
virtual void ReserveNodes (int32 bound)
 
virtual void ReserveArcs (int32 bound)
 
void Reserve (int32 node_capacity, int32 arc_capacity)
 
void FreezeCapacities ()
 
void GroupForwardArcsByFunctor (const A &a, B *b)
 
int32 max_end_arc_index () const
 

Static Public Attributes

static const int32 kNilNode
 
static const int32 kNilArc
 

Protected Member Functions

void ComputeCumulativeSum (std::vector< int32 > *v)
 
void BuildStartAndForwardHead (SVector< int32 > *head, std::vector< int32 > *start, std::vector< int32 > *permutation)
 

Member Typedef Documentation

◆ ArcIndex

typedef int32 ArcIndex
inherited

Definition at line 191 of file graph.h.

◆ NodeIndex

typedef int32 NodeIndex
inherited

Definition at line 190 of file graph.h.

Constructor & Destructor Documentation

◆ ListGraph() [1/2]

ListGraph ( )
inline

Definition at line 308 of file graph.h.

◆ ListGraph() [2/2]

ListGraph ( NodeIndexType  num_nodes,
ArcIndexType  arc_capacity 
)
inline

Definition at line 313 of file graph.h.

Member Function Documentation

◆ AddArc()

ArcIndexType AddArc ( NodeIndexType  tail,
NodeIndexType  head 
)

Definition at line 1140 of file graph.h.

◆ AddNode()

void AddNode ( NodeIndexType  node)

Definition at line 1132 of file graph.h.

◆ AllForwardArcs()

IntegerRange< int32 > AllForwardArcs
inherited

Definition at line 211 of file graph.h.

◆ AllNodes()

IntegerRange< int32 > AllNodes
inherited

Definition at line 210 of file graph.h.

◆ arc_capacity()

int32 arc_capacity
inherited

Definition at line 228 of file graph.h.

◆ Build() [1/2]

void Build ( )
inline

Definition at line 340 of file graph.h.

◆ Build() [2/2]

void Build ( std::vector< ArcIndexType > *  permutation)

Definition at line 1170 of file graph.h.

◆ BuildStartAndForwardHead()

void BuildStartAndForwardHead ( SVector< int32 > *  head,
std::vector< int32 > *  start,
std::vector< int32 > *  permutation 
)
protectedinherited

Definition at line 273 of file graph.h.

◆ ComputeCumulativeSum()

void ComputeCumulativeSum ( std::vector< int32 > *  v)
protectedinherited

Definition at line 272 of file graph.h.

◆ FreezeCapacities()

void FreezeCapacities
inherited

Definition at line 255 of file graph.h.

◆ GroupForwardArcsByFunctor()

void GroupForwardArcsByFunctor ( const A &  a,
B *  b 
)
inlineinherited

Definition at line 265 of file graph.h.

◆ Head()

NodeIndexType Head ( ArcIndexType  arc) const

Definition at line 1117 of file graph.h.

◆ IsArcValid() [1/2]

bool IsArcValid
inline

Definition at line 220 of file graph.h.

◆ IsArcValid() [2/2]

bool IsArcValid ( int32  arc) const
inlineinherited

Definition at line 220 of file graph.h.

◆ IsNodeValid()

bool IsNodeValid ( int32  node) const
inlineinherited

Definition at line 214 of file graph.h.

◆ max_end_arc_index()

int32 max_end_arc_index ( ) const
inlineinherited

Definition at line 268 of file graph.h.

◆ node_capacity()

int32 node_capacity
inherited

Definition at line 225 of file graph.h.

◆ num_arcs()

int32 num_arcs ( ) const
inlineinherited

Definition at line 205 of file graph.h.

◆ num_nodes()

int32 num_nodes ( ) const
inlineinherited

Definition at line 202 of file graph.h.

◆ operator[]()

BeginEndWrapper< typename ListGraph< NodeIndexType, ArcIndexType >::OutgoingHeadIterator > operator[] ( NodeIndexType  node) const

Definition at line 1103 of file graph.h.

◆ OutDegree()

ArcIndexType OutDegree ( NodeIndexType  node) const

Definition at line 1124 of file graph.h.

◆ OutgoingArcs()

BeginEndWrapper<OutgoingArcIterator> OutgoingArcs ( NodeIndexType  node) const

◆ OutgoingArcsStartingFrom()

BeginEndWrapper<OutgoingArcIterator> OutgoingArcsStartingFrom ( NodeIndexType  node,
ArcIndexType  from 
) const

◆ Reserve()

void Reserve ( int32  node_capacity,
int32  arc_capacity 
)
inlineinherited

Definition at line 248 of file graph.h.

◆ ReserveArcs() [1/2]

void ReserveArcs ( ArcIndexType  bound)
override

Definition at line 1161 of file graph.h.

◆ ReserveArcs() [2/2]

virtual void ReserveArcs ( int32  bound)
inlinevirtualinherited

Definition at line 242 of file graph.h.

◆ ReserveNodes() [1/2]

virtual void ReserveNodes ( int32  bound)
inlinevirtualinherited

Definition at line 236 of file graph.h.

◆ ReserveNodes() [2/2]

void ReserveNodes ( NodeIndexType  bound)
override

Definition at line 1154 of file graph.h.

◆ Tail()

NodeIndexType Tail ( ArcIndexType  arc) const

Definition at line 1110 of file graph.h.

Member Data Documentation

◆ kNilArc

const int32 kNilArc
staticinherited

Definition at line 260 of file graph.h.

◆ kNilNode

const int32 kNilNode
staticinherited

Definition at line 259 of file graph.h.


The documentation for this class was generated from the following file: