diff --git a/python/mwmatching.py b/python/mwmatching.py index 4d33824..f7f61ec 100644 --- a/python/mwmatching.py +++ b/python/mwmatching.py @@ -858,6 +858,8 @@ class _MatchingContext: This function takes time O(n * log(n)). """ + assert not self.scan_queue + # Remove blossom labels and unwind lazy dual updates. for blossom in self.trivial_blossom + self.nontrivial_blossom: if blossom.parent is None: @@ -867,9 +869,6 @@ class _MatchingContext: assert blossom.label == _LABEL_NONE blossom.tree_edge = None - # Clear the scan queue. - self.scan_queue.clear() - # Reset least-slack edge tracking. self.lset_reset() @@ -1121,6 +1120,7 @@ class _MatchingContext: sub.tree_edge = path_edges[p+1] # Delete the expanded blossom. + # TODO -- list manipulation is too slow self.nontrivial_blossom.remove(blossom) def expand_unlabeled_blossom(self, blossom: _NonTrivialBlossom) -> None: @@ -1160,6 +1160,7 @@ class _MatchingContext: sub.delta2_node = self.delta2_queue.insert(prio, sub) # Delete the expanded blossom. + # TODO -- list manipulation is too slow self.nontrivial_blossom.remove(blossom) #