Lowest Common Ancestors with Linking and Cutting

Given a collection of rooted trees, answer queries of the form, "What is the nearest common ancestor of vertices xx and yy" In this version of the problem, the queries are on-line. Interspersed with the queries are on-line commands of two types: link(x,y)link(x, y), where yy but not necessarily xx is a tree root, and cut(x)cut (x), where xx is not a root. The effect of a command link(x,y)link(x, y) is to combine the trees containing xx and yy by making xx the parent of yy. The effect of a command cut(x)cut (x) is to cut the edge connecting xx and its parent, splitting the tree containing xx into two trees: one containing all descendants of xx and another containing all nondescendants of xx.

Parameters

  • nn: number of vertices
  • mm: number of total number of operations (queries, links, and cuts)

Insufficient data to display graph

Filters

Computational Model

Randomization

Approximation

Algorithms Table

Insuffient Data to display table

Reductions Table

Insuffient Data to display table

Other relevant algorithms

Insuffient Data to display table