method to reset matching

This commit is contained in:
Maximilian Keßler 2023-11-04 19:34:25 +01:00
parent 05ab338cf2
commit e232da1234
Signed by: max
GPG Key ID: BCC5A619923C0BA5
2 changed files with 13 additions and 0 deletions

View File

@ -205,6 +205,17 @@ void Graph::reset_forest()
node.ear_or_root_neighbor = cur_id;
node.root_of_ear_component = cur_id;
// Note that we do not change the matching itself here
++cur_id;
}
}
void Graph::reset_matching()
{
NodeId cur_id = 0;
for(auto & node : _nodes)
{
node.matched_neighbor = cur_id;
++cur_id;
}
}

View File

@ -182,6 +182,8 @@ public:
bool is_out_of_forest(NodeId const id) const;
void reset_forest();
void reset_matching();
private:
std::vector<Node> _nodes;
size_type _num_edges;