Yuliia Tatarinova
We study the problem of maintaining the size of a maximum matching in a tree that is updated by edge insertions and deletions while preserving the tree property. The algorithm represents the current tree with a top-tree decomposition and augments every cluster with four dynamic-programming values corresponding to the maximum matching size under each combination of matched/unmatched statuses of the cluster's two boundary vertices. When two clusters are combined (by a rake or compress operation), the four values for the parent cluster are computed in constant time from the children's values, enforcing that at most one matched edge is incident to the shared boundary vertex. Since a single update changes only O(log n) clusters in the top tree, the matching information can be updated in O(log n) time. The cardinality of a maximum matching is obtained in O(1) time from the root cluster, and an edge can be tested for membership in some maximum matching in O(log n) time. The method also extends naturally to weighted matchings by initializing edge clusters with their weights.
- M. Gupta, A. Sharma. An O(log n) Fully Dynamic Algorithm for Maximum Matching in a Tree.