Implementation of the Blossom-V algorithm by Kolmogorov (2009) for Minimum Weight Perfect Matching. More...
#include <ogdf/graphalg/MatchingBlossomV.h>
Classes | |
struct | stats |
Structure to store statistics. More... | |
Public Member Functions | |
MatchingBlossomV (bool greedyInit=true) | |
Construct a MatchingBlossomV instance. More... | |
Private Member Functions | |
template<class WeightContainer > | |
bool | _doCall (const Graph &G, const WeightContainer &weights, std::unordered_set< edge > &matching) |
Helper for the main call function since abstract functions cannot be templated. More... | |
void | advanceCurrentAuxNode () |
Helper function to advance the current aux node to the next one. More... | |
void | augment (edge augmentationEdge) |
Augment the matching with augmentationEdge . More... | |
bool | doCall (const Graph &G, const EdgeArray< TWeight > &weights, std::unordered_set< edge > &matching) |
bool | doCall (const GraphAttributes &GA, std::unordered_set< edge > &matching) |
bool | dualChange () |
Executes a dual change step. More... | |
long long | end (std::chrono::high_resolution_clock::time_point start) |
Get the time difference between start and now in nanoseconds. More... | |
void | expand (Pseudonode *pseudonode) |
Expand the given pseudonode . More... | |
bool | findExpandablePseudonode (AuxNode< TWeight > *auxNode) |
Finds and expands an odd pseudonode in auxNode , if possible. More... | |
bool | findMatching (std::unordered_set< edge > &matching) |
Main function of the algorithm. More... | |
bool | findMatchingAugmentation (AuxNode< TWeight > *auxNode) |
Finds and executes a matching augmentation in auxNode , if possible. More... | |
bool | findShrinkableCycle (AuxNode< TWeight > *auxNode) |
Finds and shrinks an odd cycle in auxNode , if possible. More... | |
bool | findTreeAugmentation (AuxNode< TWeight > *auxNode) |
Finds and executes a tree augmentation in auxNode , if possible. More... | |
void | grow (edge newEdge) |
Augment the corresponding tree with augmentationEdge . More... | |
std::ostream & | lout (Level level=Level::Default, bool indent=true) const |
stream for logging-output (local) More... | |
std::ostream & | louth () |
Helper function to log with high priority. More... | |
std::chrono::high_resolution_clock::time_point | now () |
Get the current time point. More... | |
bool | primalChange () |
Executes a primal change step. More... | |
void | printParallelEdgesStats () |
Print additional statistics about parallel edges. More... | |
void | printStatistics () |
Print all statistics. More... | |
long long | processStatisticEntry (const std::string &key) |
Print a single statistics entry. More... | |
void | shrink (edge cycleEdge) |
Shrink the odd cycle induced by cycleEdge and the tree determined by its endpoints. More... | |
Private Attributes | |
AuxGraph< TWeight > | m_auxGraph |
AuxNode< TWeight > * | m_currentAuxNode = nullptr |
The current aux node in the main loop. More... | |
EpsilonTest | m_eps |
The epsilon test for floating point comparisons. More... | |
BlossomVHelper< TWeight > | m_helper |
std::unordered_map< std::string, stats > | m_stats |
A mapping of all statistic names to their values. More... | |
Implementation of the Blossom-V algorithm by Kolmogorov (2009) for Minimum Weight Perfect Matching.
Definition at line 63 of file MatchingBlossomV.h.
|
inline |
Construct a MatchingBlossomV instance.
greedyInit | whether or not to use the greedy initialization |
Definition at line 282 of file MatchingBlossomV.h.
|
inlineprivate |
Helper for the main call function since abstract functions cannot be templated.
Definition at line 296 of file MatchingBlossomV.h.
|
inlineprivate |
Helper function to advance the current aux node to the next one.
Definition at line 136 of file MatchingBlossomV.h.
|
inlineprivate |
Augment the matching with augmentationEdge
.
Definition at line 547 of file MatchingBlossomV.h.
|
inlineprivate |
Definition at line 285 of file MatchingBlossomV.h.
|
inlineprivate |
Definition at line 290 of file MatchingBlossomV.h.
|
inlineprivate |
Executes a dual change step.
Definition at line 475 of file MatchingBlossomV.h.
|
inlineprivate |
Get the time difference between start
and now in nanoseconds.
Definition at line 124 of file MatchingBlossomV.h.
|
inlineprivate |
Expand the given pseudonode
.
Definition at line 775 of file MatchingBlossomV.h.
|
inlineprivate |
Finds and expands an odd pseudonode in auxNode
, if possible.
Definition at line 460 of file MatchingBlossomV.h.
|
inlineprivate |
Main function of the algorithm.
Finds a minimum weight perfect matching in the graph if one exists.
Definition at line 320 of file MatchingBlossomV.h.
|
inlineprivate |
Finds and executes a matching augmentation in auxNode
, if possible.
Definition at line 398 of file MatchingBlossomV.h.
|
inlineprivate |
Finds and shrinks an odd cycle in auxNode
, if possible.
Definition at line 443 of file MatchingBlossomV.h.
|
inlineprivate |
Finds and executes a tree augmentation in auxNode
, if possible.
Definition at line 426 of file MatchingBlossomV.h.
|
inlineprivate |
Augment the corresponding tree with augmentationEdge
.
Definition at line 584 of file MatchingBlossomV.h.
|
inlineprivate |
|
inlineprivate |
Helper function to log with high priority.
Definition at line 133 of file MatchingBlossomV.h.
|
inlineprivate |
Get the current time point.
Definition at line 119 of file MatchingBlossomV.h.
|
inlineprivate |
Executes a primal change step.
Definition at line 365 of file MatchingBlossomV.h.
|
inlineprivate |
Print additional statistics about parallel edges.
Definition at line 900 of file MatchingBlossomV.h.
|
inlineprivate |
Print all statistics.
Definition at line 871 of file MatchingBlossomV.h.
|
inlineprivate |
Print a single statistics entry.
Definition at line 928 of file MatchingBlossomV.h.
|
inlineprivate |
Shrink the odd cycle induced by cycleEdge
and the tree determined by its endpoints.
Definition at line 656 of file MatchingBlossomV.h.
|
private |
Definition at line 93 of file MatchingBlossomV.h.
|
private |
The current aux node in the main loop.
Definition at line 96 of file MatchingBlossomV.h.
|
private |
The epsilon test for floating point comparisons.
Definition at line 99 of file MatchingBlossomV.h.
|
private |
Definition at line 92 of file MatchingBlossomV.h.
|
private |
A mapping of all statistic names to their values.
Definition at line 116 of file MatchingBlossomV.h.