diff --git a/graph.cpp b/graph.cpp index 16b5710..939e092 100644 --- a/graph.cpp +++ b/graph.cpp @@ -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; } } diff --git a/graph.hpp b/graph.hpp index 8b71861..a287f54 100644 --- a/graph.hpp +++ b/graph.hpp @@ -182,6 +182,8 @@ public: bool is_out_of_forest(NodeId const id) const; void reset_forest(); + + void reset_matching(); private: std::vector _nodes; size_type _num_edges;