Abstract
Consider a forest that evolves via link operations that make the root of one tree the child of a node in another tree. Intermixed with link operations are nca operations, which return the nearest common ancestor of two given nodes when such exists. This article shows that a sequence of m such nca and link operations on a forest of n nodes can be processed online in time O(ma(m,n) + n). This was previously known only for a restricted type of link operation. The special case where a link only extends a tree by adding a new leaf occurs in Edmonds' algorithm for finding a maximum weight matching on a general graph. Incorporating our algorithm into the implementation of Edmonds' algorithm in [9] achieves time O(n(m + n logn)) for weighted matching, an arguably optimum asymptotic bound (n andm are the number of vertices and edges, respectively). Our data structure also provides a simple alternative implementation of the incremental-tree set merging algorithm of Gabow and Tarjan [11].
Author supplied keywords
Cite
CITATION STYLE
Gabow, H. N. (2017). A data structure for nearest common ancestors with linking. ACM Transactions on Algorithms, 13(4). https://doi.org/10.1145/3108240
Register to see more suggestions
Mendeley helps you to discover research relevant for your work.