Fast Algorithms for Computing Tree LCS

  • Authors:
  • Shay Mozes;Dekel Tsur;Oren Weimann;Michal Ziv-Ukelson

  • Affiliations:
  • Brown University, Providence, USA RI 02912-1910;Ben-Gurion University, Beer-Sheva, Israel;Massachusetts Institute of Technology, Cambridge, USA MA 02139;Ben-Gurion University, Beer-Sheva, Israel

  • Venue:
  • CPM '08 Proceedings of the 19th annual symposium on Combinatorial Pattern Matching
  • Year:
  • 2008

Quantified Score

Hi-index 0.01

Visualization

Abstract

The LCS of two rooted, ordered, and labeled trees Fand Gis the largest forest that can be obtained from both trees by deleting nodes. We present algorithms for computing tree LCS which exploit the sparsityinherent to the tree LCS problem. Assuming Gis smaller than F, our first algorithm runs in time $O(r\cdot {\rm height}(F) \cdot {\rm height}(G)\cdot \lg\lg |G|)$, where ris the number of pairs (v茂戮驴 F, w茂戮驴 G) such that vand whave the same label. Our second algorithm runs in time $O(L r \lg r \cdot \lg\lg|G|)$, where Lis the size of the LCS of Fand G. For this algorithm we present a novel three dimensional alignment graph. Our third algorithm is intended for the constrained variant of the problem in which only nodes with zero or one children can be deleted. For this case we obtain an $O(r h \lg \lg|G|)$ time algorithm, where h= height(F) + height(G).