Abstract
The unordered tree edit distance is a natural metric to compute distances between trees without intrinsic child order, such as representations of chemical molecules. While the unordered tree edit distance is MAX SNP-hard in principle, it is feasible for small cases, e.g. via an A* algorithm. Unfortunately, current heuristics for the A* algorithm assume unit costs for deletions, insertions, and replacements, which limits our ability to inject domain knowledge. In this paper, we present three novel heuristics for the A* algorithm that work with custom cost functions. In experiments on two chemical data sets, we show that custom costs make the A* computation faster and improve the error of a 5-nearest neighbor regressor, predicting chemical properties. We also show that, on these data, polynomial edit distances can achieve similar results as the unordered tree edit distance.
Funding by the German Research Foundation (DFG) under grant number PA 3460/2-1 is gratefully acknowledged.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
Note that we use ‘node’ and ‘label’ interchangeably in this paper. To disambiguate between two nodes with the same label, we use the index.
- 2.
Strictly speaking, this is only valid if the lower bound f is exact for insertions. This is the case for all heuristics considered in this paper.
- 3.
We also tested lower K, which achieved worse results for all methods.
References
Aiolli, F., Da San Martino, G., Sperduti, A.: An efficient topological distance-based tree kernel. IEEE TNNLS 26(5), 1115–1120 (2015)
Augsten, N., Böhlen, M., Gamper, J.: The pq-gram distance between ordered labeled trees. ACM TDS 35(1), 1–36 (2008)
Bille, P.: A survey on tree edit distance and related problems. Theoret. Comput. Sci. 337(1), 217–239 (2005)
Bougleux, S., Brun, L., Carletti, V., Foggia, P., Gaüzère, B., Vento, M.: Graph edit distance as a quadratic assignment problem. Pat. Rec. Lett. 87, 38–46 (2017)
Collins, M., Duffy, N.: New ranking algorithms for parsing and tagging: kernels over discrete structures, and the voted perceptron. In: Proceedings of the ACL, pp. 263–270 (2002)
Gallicchio, C., Micheli, A.: Tree echo state networks. Neurocomputing 101, 319–337 (2013)
Horesh, Y., Mehr, R., Unger, R.: Designing an A* algorithm for calculating edit distance between rooted-unordered trees. J. Comp. Bio. 13(6), 1165–1176 (2006)
Kusner, M.J., Paige, B., Hernández-Lobato, J.M.: Grammar variational autoencoder. In: Proceedings of the ICML, pp. 1945–1954 (2017)
Paaßen, B., Gallicchio, C., Micheli, A., Hammer, B.: Tree edit distance learning via adaptive symbol embeddings. In: Proceedings of the ICML, pp. 3973–3982 (2018)
Rarey, M., Dixon, J.S.: Feature trees: a new molecular similarity measure based on tree matching. J. Comput. Aided Mol. Design 12(5), 471–490 (1998)
Shapiro, B.A., Zhang, K.: Comparing multiple RNA secondary structures using tree comparisons. Bioinformatics 6(4), 309–318 (1990)
Weininger, D.: Smiles, a chemical language and information system. 1. Introduction to methodology and encoding rules. J. Chem. Inf. CS 28(1), 31–36 (1988)
Yoshino, T., Higuchi, S., Hirata, K.: A dynamic programming A* algorithm for computing unordered tree edit distance. In: Proceedings of the IIAI-AAI, pp. 135–140 (2013)
Zhang, K.: A constrained edit distance between unordered labeled trees. Algorithmica 15(3), 205–222 (1996)
Zhang, K., Jiang, T.: Some MAX SNP-hard results concerning unordered labeled trees. Inf. Proc. Lett. 49(5), 249–254 (1994)
Zhang, K., Shasha, D.: Simple fast algorithms for the editing distance between trees and related problems. SIAM Comput. 18(6), 1245–1262 (1989)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2021 Springer Nature Switzerland AG
About this paper
Cite this paper
Paaßen, B. (2021). An A*-algorithm for the Unordered Tree Edit Distance with Custom Costs. In: Reyes, N., et al. Similarity Search and Applications. SISAP 2021. Lecture Notes in Computer Science(), vol 13058. Springer, Cham. https://doi.org/10.1007/978-3-030-89657-7_27
Download citation
DOI: https://doi.org/10.1007/978-3-030-89657-7_27
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-89656-0
Online ISBN: 978-3-030-89657-7
eBook Packages: Computer ScienceComputer Science (R0)