From 48e225310cb60710fa22a766fd5ae0e730daa32f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Sat, 4 Nov 2023 19:40:37 +0100 Subject: [PATCH] reset matching when entering edmonds algorithm --- edmonds.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/edmonds.cpp b/edmonds.cpp index 83449be..d69f9f9 100644 --- a/edmonds.cpp +++ b/edmonds.cpp @@ -31,7 +31,8 @@ std::vector path_to_forest_root(Graph const & graph, NodeId id) } -Graph maximum_matching(Graph & graph) + +Graph maximum_matching_from_initial_matching(Graph & graph) { graph.reset_forest(); for(NodeId id = 0; id < graph.num_nodes(); ++id) { @@ -119,4 +120,10 @@ Graph maximum_matching(Graph & graph) } } }; + +Graph maximum_matching(Graph & graph) { + graph.reset_matching(); + return maximum_matching_from_initial_matching(graph); +} + }