{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/an-algorithm-for-comparing-similarity-between","title":"An Algorithm for Comparing Similarity Between Two Trees","arxiv_id":"1508.03381","date":"2015-08-13","proceeding":null,"authors":["Hangjun Xu"],"abstract":"An important problem in geometric computing is defining and computing similarity between two geometric shapes, e.g. point sets, curves and surfaces, etc. Important geometric and topological information of many shapes can be captured by defining a tree structure on them (e.g. medial axis and contour trees). Hence, it is natural to study the problem of comparing similarity between trees. We study gapped edit distance between two ordered labeled trees, first proposed by Touzet \\cite{Touzet2003}. Given two binary trees $T_{1}$ and $T_{2}$ with $m$ and $n$ nodes. We compute the general gap edit distance in $O(m^{3}n^{2} + m^{2}n^{3})$ time. The computation of this distance in the case of arbitrary trees has shown to be NP-hard \\cite{Touzet2003}. We also give an algorithm for computing the complete subtree gap edit distance, which can be applied to comparing contour trees of terrains in $\\mathbb{R}^{3}$.","url_abs":"http://arxiv.org/abs/1508.03381v1","url_pdf":"http://arxiv.org/pdf/1508.03381v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"links_only","authors_date_abstract":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license), from the Kaggle arXiv metadata snapshot of 2026-09-12"},"code_links":[{"paper_slug":"an-algorithm-for-comparing-similarity-between","repo_url":"https://github.com/EMarquer/semantic_trees","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":null},{"paper_slug":"an-algorithm-for-comparing-similarity-between","repo_url":"https://github.com/elenakhas/semantic-mining","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":null}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":null,"mcp":null,"developers":"https://syntology.ai/developers"},"arxiv_metadata":null,"syntology_extracted_results":null}