An Optimal Algorithm for Computing All Subtree Repeats in Trees
Given a labeled tree T, our goal is to group repeating subtrees of T into equivalence classes with respect to their topologies and the node labels. We present an explicit, simple, and time-optimal algorithm for solving this problem for unrooted unordered labeled trees, and show that the running time of our method is linear with respect to the size of T. By unordered, we mean that the order of the adjacent nodes (children/neighbors) of any node of T is irrelevant. An unrooted tree T does not have a node that is designated as root and can also be referred to as an undirected tree. We show how the presented algorithm can easily be modified to operate on trees that do not satisfy some or any of the aforementioned assumptions on the tree structure; for instance, how it can be applied to rooted, ordered or unlabeled trees.
Unable to display preview. Download preview PDF.
- 1.Aho, A.V., Lam, M.S., Sethi, R., Ullman, J.D.: Compilers: principles, techniques, and tools, 2nd edn. Addison-Wesley (2006)Google Scholar
- 2.Barstow, D.R., Shrobe, H.E., Sandewall, E.: Interactive Programming Environments. McGraw-Hill, Inc. (1984)Google Scholar
- 5.Christou, M., Crochemore, M., Flouri, T., Iliopoulos, C.S., Janoušek, J., Melichar, B., Pissis, S.P.: Computing all subtree repeats in ordered ranked trees. In: Grossi, R., Sebastiani, F., Silvestri, F. (eds.) SPIRE 2011. LNCS, vol. 7024, pp. 338–343. Springer, Heidelberg (2011)CrossRefGoogle Scholar
- 7.Felsenstein, J.: Inferring phylogenies. Sinauer Associates (2003)Google Scholar
- 10.Harary, F.: Graph Theory. Addison Wesley Publishing Company (1994)Google Scholar
- 13.Knuth, D.E., Bendix, P.B.: Simple word problems in universal algebra. In: Leech, J. (ed.) Computational Problems in Abstract Algebra, pp. 263–297. Pergamon Press (1970)Google Scholar