TY - JOUR

T1 - Fast algorithms for computing tree LCS

AU - Mozes, Shay

AU - Tsur, Dekel

AU - Weimann, Oren

AU - Ziv-Ukelson, Michal

PY - 2009/10/6

Y1 - 2009/10/6

N2 - The LCS of two rooted, ordered, and labeled trees F and G is the largest forest that can be obtained from both trees by deleting nodes. We present algorithms for computing tree LCS which exploit the sparsity inherent to the tree LCS problem. Assuming G is smaller than F, our first algorithm runs in time O (r {dot operator} height (F) {dot operator} height (G) {dot operator} lg lg | G |), where r is the number of pairs (v ∈ F, w ∈ G) such that v and w have the same label. Our second algorithm runs in time O (L r lg r {dot operator} lg lg | G |), where L is the size of the LCS of F and 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).

AB - The LCS of two rooted, ordered, and labeled trees F and G is the largest forest that can be obtained from both trees by deleting nodes. We present algorithms for computing tree LCS which exploit the sparsity inherent to the tree LCS problem. Assuming G is smaller than F, our first algorithm runs in time O (r {dot operator} height (F) {dot operator} height (G) {dot operator} lg lg | G |), where r is the number of pairs (v ∈ F, w ∈ G) such that v and w have the same label. Our second algorithm runs in time O (L r lg r {dot operator} lg lg | G |), where L is the size of the LCS of F and 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).

KW - Largest common subforest

KW - Ordered trees

KW - Sparse dynamic programming

KW - Tree LCS

KW - Tree edit distance

UR - http://www.scopus.com/inward/record.url?scp=69949100575&partnerID=8YFLogxK

U2 - 10.1016/j.tcs.2009.07.011

DO - 10.1016/j.tcs.2009.07.011

M3 - Article

AN - SCOPUS:69949100575

VL - 410

SP - 4303

EP - 4314

JO - Theoretical Computer Science

JF - Theoretical Computer Science

SN - 0304-3975

IS - 43

ER -