Abstract
Hierarchical data are often modelled as trees. An interesting query identifies pairs of similar trees. The standard approach to tree similarity is the tree edit distance, which has successfully been applied in a wide range of applications. In terms of runtime, the state-of-the-art for the tree edit distance is the RTED algorithm, which is guaranteed to be fast independently of the tree shape. Unfortunately, this algorithm uses twice the memory of the other, slower algorithms. The memory is quadratic in the tree size and is a bottleneck for the tree edit distance computation.
In this paper we present a new, memory efficient algorithm for the tree edit distance. Our algorithm runs at least as fast as RTED, but requires only half the memory. This is achieved by systematically releasing memory early during the first step of the algorithm, which computes a decomposition strategy and is the main memory bottleneck. We show the correctness of our approach and prove an upper bound for the memory usage. Our empirical evaluation confirms the low memory requirements and shows that in practice our algorithm performs better than the analytic guarantees suggest.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Akutsu, T.: Tree edit distance problems: Algorithms and applications to bioinformatics. IEICE Trans. on Inf. Syst. 93-D(2), 208–218 (2010)
Aoki, K.F., Yamaguchi, A., Okuno, Y., Akutsu, T., Ueda, N., Kanehisa, M., Mamitsuka, H.: Efficient tree-matching methods for accurate carbohydrate database queries. Genome Informatics 14, 134–143 (2003)
Augsten, N., Barbosa, D., Böhlen, M., Palpanas, T.: Efficient top-k approximate subtree matching in small memory. IEEE TKDE 23(8), 1123–1137 (2011)
Augsten, N., Böhlen, M.H., Gamper, J.: The pq-gram distance between ordered labeled trees. ACM TODS 35(1) (2010)
Chawathe, S.S.: Comparing hierarchical data in external memory. In: VLDB, pp. 90–101 (1999)
Cobena, G., Abiteboul, S., Marian, A.: Detecting changes in XML documents. In: ICDE, pp. 41–52 (2002)
Cohen, S.: Indexing for subtree similarity-search using edit distance. In: SIGMOD, pp. 49–60 (2013)
Dalamagas, T., Cheng, T., Winkel, K.-J., Sellis, T.K.: A methodology for clustering XML documents by structure. Inf. Syst. 31(3), 187–228 (2006)
Demaine, E.D., Mozes, S., Rossman, B., Weimann, O.: An optimal decomposition algorithm for tree edit distance. ACM Trans. on Alg. 6(1) (2009)
Dulucq, S., Touzet, H.: Decomposition algorithms for the tree edit distance problem. J. Discrete Alg. 3(2-4), 448–471 (2005)
Finis, J.P., Raiber, M., Augsten, N., Brunel, R., Kemper, A., Färber, F.: RWS-Diff: Flexible and efficient change detection in hierarchical data. In: CIKM, pp. 339–348 (2013)
Garofalakis, M., Kumar, A.: XML stream processing using tree-edit distance embeddings. ACM TODS 30(1), 279–332 (2005)
Guha, S., Jagadish, H.V., Koudas, N., Srivastava, D., Yu, T.: Approximate XML joins. In: SIGMOD, pp. 287–298 (2002)
Heumann, H., Wittum, G.: The tree-edit-distance, a measure for quantifying neuronal morphology. BMC Neuroscience 10(suppl. 1), P89 (2009)
Klein, P.N.: Computing the edit-distance between unrooted ordered trees. In: Bilardi, G., Pietracaprina, A., Italiano, G.F., Pucci, G. (eds.) ESA 1998. LNCS, vol. 1461, pp. 91–102. Springer, Heidelberg (1998)
Korn, F., Saha, B., Srivastava, D., Ying, S.: On repairing structural problems in semi-structured data. Proceedings of the VLDB Endowment 6(9) (2013)
Lee, K.-H., Choy, Y.-C., Cho, S.-B.: An efficient algorithm to compute differences between structured documents. IEEE TKDE 16(8), 965–979 (2004)
Lin, Z., Wang, H., McClean, S.: Measuring tree similarity for natural language processing based information retrieval. In: Hopfe, C.J., Rezgui, Y., Métais, E., Preece, A., Li, H. (eds.) NLDB 2010. LNCS, vol. 6177, pp. 13–23. Springer, Heidelberg (2010)
Pawlik, M., Augsten, N.: RTED: A robust algorithm for the tree edit distance. Proceedings of the VLDB Endowment, 334–345 (2011)
Springel, V., White, S.D.M., Jenkins, A., Frenk, C.S., Yoshida, N., Gao, L., Navarro, J., Thacker, R., Croton, D., Helly, J., Peacock, J.A., Cole, S., Thomas, P., Couchman, H., Evrard, A., Colberg, J., Pearce, F.: Simulations of the formation, evolution and clustering of galaxies and quasars. Nature 435 (2005)
Tai, K.-C.: The tree-to-tree correction problem. J. ACM 26(3), 422–433 (1979)
Zhang, K.: Algorithms for the constrained editing distance between ordered labeled trees and related problems. Pattern Recognition 28(3), 463–474 (1995)
Zhang, K., Shasha, D.: Simple fast algorithms for the editing distance between trees and related problems. SIAM J. Comput. 18(6), 1245–1262 (1989)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2014 Springer International Publishing Switzerland
About this paper
Cite this paper
Pawlik, M., Augsten, N. (2014). A Memory-Efficient Tree Edit Distance Algorithm. In: Decker, H., Lhotská, L., Link, S., Spies, M., Wagner, R.R. (eds) Database and Expert Systems Applications. DEXA 2014. Lecture Notes in Computer Science, vol 8644. Springer, Cham. https://doi.org/10.1007/978-3-319-10073-9_16
Download citation
DOI: https://doi.org/10.1007/978-3-319-10073-9_16
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-10072-2
Online ISBN: 978-3-319-10073-9
eBook Packages: Computer ScienceComputer Science (R0)