From e232da12345a16a7d1db0c0c5a3f9355fd119f3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Sat, 4 Nov 2023 19:34:25 +0100 Subject: [PATCH] method to reset matching --- graph.cpp | 11 +++++++++++ graph.hpp | 2 ++ 2 files changed, 13 insertions(+) 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;