Skip to main content

An A*-algorithm for the Unordered Tree Edit Distance with Custom Costs

  • Conference paper
  • First Online:
Similarity Search and Applications (SISAP 2021)

Part of the book series: Lecture Notes in Computer Science ((LNISA,volume 13058))

Included in the following conference series:

  • 853 Accesses

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 64.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 84.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 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. 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. 3.

    We also tested lower K, which achieved worse results for all methods.

References

  1. Aiolli, F., Da San Martino, G., Sperduti, A.: An efficient topological distance-based tree kernel. IEEE TNNLS 26(5), 1115–1120 (2015)

    Google Scholar 

  2. Augsten, N., Böhlen, M., Gamper, J.: The pq-gram distance between ordered labeled trees. ACM TDS 35(1), 1–36 (2008)

    Google Scholar 

  3. Bille, P.: A survey on tree edit distance and related problems. Theoret. Comput. Sci. 337(1), 217–239 (2005)

    Google Scholar 

  4. 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)

    Google Scholar 

  5. 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)

    Google Scholar 

  6. Gallicchio, C., Micheli, A.: Tree echo state networks. Neurocomputing 101, 319–337 (2013)

    Google Scholar 

  7. 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)

    Google Scholar 

  8. Kusner, M.J., Paige, B., Hernández-Lobato, J.M.: Grammar variational autoencoder. In: Proceedings of the ICML, pp. 1945–1954 (2017)

    Google Scholar 

  9. 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)

    Google Scholar 

  10. 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)

    Google Scholar 

  11. Shapiro, B.A., Zhang, K.: Comparing multiple RNA secondary structures using tree comparisons. Bioinformatics 6(4), 309–318 (1990)

    Google Scholar 

  12. 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)

    Google Scholar 

  13. 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)

    Google Scholar 

  14. Zhang, K.: A constrained edit distance between unordered labeled trees. Algorithmica 15(3), 205–222 (1996)

    Google Scholar 

  15. Zhang, K., Jiang, T.: Some MAX SNP-hard results concerning unordered labeled trees. Inf. Proc. Lett. 49(5), 249–254 (1994)

    Google Scholar 

  16. Zhang, K., Shasha, D.: Simple fast algorithms for the editing distance between trees and related problems. SIAM Comput. 18(6), 1245–1262 (1989)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Benjamin Paaßen .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2021 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

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)

Publish with us

Policies and ethics