OR-Tools  9.3
BlossomGraph

Detailed Description

Definition at line 167 of file perfect_matching.h.

Classes

struct  Edge
 
struct  Node
 

Public Member Functions

 DEFINE_STRONG_INT_TYPE (NodeIndex, int)
 
 DEFINE_STRONG_INT_TYPE (EdgeIndex, int)
 
 DEFINE_STRONG_INT_TYPE (CostValue, int64_t)
 
 BlossomGraph (int num_nodes)
 
void AddEdge (NodeIndex tail, NodeIndex head, CostValue cost)
 
ABSL_MUST_USE_RESULT bool Initialize ()
 
void PrimalUpdates ()
 
CostValue ComputeMaxCommonTreeDualDeltaAndResetPrimalEdgeQueue ()
 
void UpdateAllTrees (CostValue delta)
 
bool NodeIsMatched (NodeIndex n) const
 
NodeIndex Match (NodeIndex n) const
 
void Grow (EdgeIndex e, NodeIndex tail, NodeIndex head)
 
void Augment (EdgeIndex e)
 
void Shrink (EdgeIndex e)
 
void Expand (NodeIndex to_expand)
 
int NumMatched () const
 
CostValue DualObjective () const
 
void ExpandAllBlossoms ()
 
CostValue Slack (const Edge &edge) const
 
CostValue Dual (const Node &node) const
 
void DisplayStats () const
 
void DebugCheckNoPossiblePrimalUpdates ()
 
bool DebugDualsAreFeasible () const
 
void DebugUpdateNodeDual (NodeIndex n, CostValue delta)
 
bool DebugEdgeIsTightAndExternal (const Edge &edge) const
 
const EdgeGetEdge (int e) const
 
const NodeGetNode (int n) const
 
std::string NodeDebugString (NodeIndex n) const
 
std::string EdgeDebugString (EdgeIndex e) const
 
std::string DebugString () const
 

Static Public Attributes

static const NodeIndex kNoNodeIndex
 
static const EdgeIndex kNoEdgeIndex
 
static const CostValue kMaxCostValue
 

Constructor & Destructor Documentation

◆ BlossomGraph()

BlossomGraph ( int  num_nodes)
explicit

Definition at line 120 of file perfect_matching.cc.

Member Function Documentation

◆ AddEdge()

void AddEdge ( NodeIndex  tail,
NodeIndex  head,
CostValue  cost 
)

Definition at line 130 of file perfect_matching.cc.

◆ Augment()

void Augment ( EdgeIndex  e)

Definition at line 551 of file perfect_matching.cc.

◆ ComputeMaxCommonTreeDualDeltaAndResetPrimalEdgeQueue()

CostValue ComputeMaxCommonTreeDualDeltaAndResetPrimalEdgeQueue ( )

Definition at line 263 of file perfect_matching.cc.

◆ DebugCheckNoPossiblePrimalUpdates()

void DebugCheckNoPossiblePrimalUpdates ( )

Definition at line 351 of file perfect_matching.cc.

◆ DebugDualsAreFeasible()

bool DebugDualsAreFeasible ( ) const

Definition at line 454 of file perfect_matching.cc.

◆ DebugEdgeIsTightAndExternal()

bool DebugEdgeIsTightAndExternal ( const Edge edge) const

Definition at line 467 of file perfect_matching.cc.

◆ DebugString()

std::string DebugString ( ) const

Definition at line 1207 of file perfect_matching.cc.

◆ DebugUpdateNodeDual()

void DebugUpdateNodeDual ( NodeIndex  n,
CostValue  delta 
)

Definition at line 1218 of file perfect_matching.cc.

◆ DEFINE_STRONG_INT_TYPE() [1/3]

DEFINE_STRONG_INT_TYPE ( CostValue  ,
int64_t   
)

◆ DEFINE_STRONG_INT_TYPE() [2/3]

DEFINE_STRONG_INT_TYPE ( EdgeIndex  ,
int   
)

◆ DEFINE_STRONG_INT_TYPE() [3/3]

DEFINE_STRONG_INT_TYPE ( NodeIndex  ,
int   
)

◆ DisplayStats()

void DisplayStats ( ) const

Definition at line 1271 of file perfect_matching.cc.

◆ Dual()

CostValue Dual ( const Node node) const

Definition at line 1250 of file perfect_matching.cc.

◆ DualObjective()

CostValue DualObjective ( ) const

Definition at line 1259 of file perfect_matching.cc.

◆ EdgeDebugString()

std::string EdgeDebugString ( EdgeIndex  e) const

Definition at line 1197 of file perfect_matching.cc.

◆ Expand()

void Expand ( NodeIndex  to_expand)

Definition at line 849 of file perfect_matching.cc.

◆ ExpandAllBlossoms()

void ExpandAllBlossoms ( )

Definition at line 1058 of file perfect_matching.cc.

◆ GetEdge()

const Edge & GetEdge ( int  e) const
inline

Definition at line 392 of file perfect_matching.h.

◆ GetNode()

const Node & GetNode ( int  n) const
inline

Definition at line 393 of file perfect_matching.h.

◆ Grow()

void Grow ( EdgeIndex  e,
NodeIndex  tail,
NodeIndex  head 
)

Definition at line 474 of file perfect_matching.cc.

◆ Initialize()

bool Initialize ( )

Definition at line 147 of file perfect_matching.cc.

◆ Match()

NodeIndex Match ( NodeIndex  n) const

Definition at line 340 of file perfect_matching.cc.

◆ NodeDebugString()

std::string NodeDebugString ( NodeIndex  n) const

Definition at line 1181 of file perfect_matching.cc.

◆ NodeIsMatched()

bool NodeIsMatched ( NodeIndex  n) const

Definition at line 333 of file perfect_matching.cc.

◆ NumMatched()

int NumMatched ( ) const
inline

Definition at line 354 of file perfect_matching.h.

◆ PrimalUpdates()

void PrimalUpdates ( )

Definition at line 385 of file perfect_matching.cc.

◆ Shrink()

void Shrink ( EdgeIndex  e)

Definition at line 654 of file perfect_matching.cc.

◆ Slack()

CostValue Slack ( const Edge edge) const

Definition at line 1232 of file perfect_matching.cc.

◆ UpdateAllTrees()

void UpdateAllTrees ( CostValue  delta)

Definition at line 313 of file perfect_matching.cc.

Member Data Documentation

◆ kMaxCostValue

const BlossomGraph::CostValue kMaxCostValue
static
Initial value:

Definition at line 179 of file perfect_matching.h.

◆ kNoEdgeIndex

const BlossomGraph::EdgeIndex kNoEdgeIndex
static
Initial value:
=
BlossomGraph::EdgeIndex(-1)

Definition at line 178 of file perfect_matching.h.

◆ kNoNodeIndex

const BlossomGraph::NodeIndex kNoNodeIndex
static
Initial value:

Definition at line 177 of file perfect_matching.h.


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