38#include <unordered_map>
39#include <unordered_set>
47namespace matching_blossom {
68 std::unordered_set<edge>&
selfLoops(
edge ref) {
return m_refToSelfLoops[ref]; }
73 m_refToSelfLoops[ref].insert(selfLoop);
74 m_selfLoopToRef[selfLoop] = ref;
75 m_selfLoopToOtherPseudonode[selfLoop] = other;
80 auto it = m_selfLoopToOtherPseudonode.find(selfLoop);
81 if (it != m_selfLoopToOtherPseudonode.end() && it->second !=
nullptr) {
82 auto& otherRefEdges = it->second->referenceEdges;
83 auto edgeIt = otherRefEdges.m_selfLoopToRef.find(selfLoop);
84 if (edgeIt != otherRefEdges.m_selfLoopToRef.end()) {
85 otherRefEdges.m_refToSelfLoops[edgeIt->second].erase(selfLoop);
86 otherRefEdges.m_selfLoopToRef.erase(edgeIt);
87 otherRefEdges.m_selfLoopToOtherPseudonode.erase(selfLoop);
Includes declaration of graph class.
Basic declarations, included by all source files.
Class for the representation of edges.
Class for the representation of nodes.
Dummy class for scoped iteration of a std::unordered_map.
Helper class to store reference edges for all self loops.
std::unordered_map< edge, edge > m_selfLoopToRef
A mapping of all self loops to their reference edges.
std::unordered_set< edge > & selfLoops(edge ref)
void addReference(edge ref, edge selfLoop, Pseudonode *other)
Add a self loop selfLoop which was removed because of the reference edge ref and pointed previously t...
void removeFromOther(edge selfLoop)
Remove the given selfLoop from the reference edges of the other pseudonode.
ValueIteratorContainer< edge, edge > refEdges
std::unordered_map< edge, std::unordered_set< edge > > m_refToSelfLoops
A mapping of all reference edges to all self loops that were removed because of them.
std::unordered_map< edge, Pseudonode * > m_selfLoopToOtherPseudonode
A mapping of all self loops to the pseudonode they previously pointed to.
Helper class representing a pseudonode in the Blossom algorithm.
ReferenceEdges referenceEdges
The ReferenceEdges for self loops of this pseudonode.
Pseudonode(node _graphNode, Cycle *_cycle)
void addReference(edge ref, edge selfLoop, Pseudonode *other)
Add a self loop selfLoop which was removed because of the reference edge ref and pointed previously t...
Cycle * cycle
The odd-length cycle that this pseudonode represents.
node graphNode
The node in the graph that this pseudonode is linked to.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
Utility functions and classes regarding map access and iteration.
The namespace for all OGDF objects.