{"@context":"https:\/\/schema.org\/","@type":"ScholarlyArticle","@id":"#article11055","name":"Edit Distance between Unrooted Trees in Cubic Time","abstract":"Edit distance between trees is a natural generalization of the classical edit distance between strings, in which the allowed elementary operations are contraction, uncontraction and relabeling of an edge. Demaine et al. [ACM Trans. on Algorithms, 6(1), 2009] showed how to compute the edit distance between rooted trees on n nodes in O(n^3) time. However, generalizing their method to unrooted trees seems quite problematic, and the most efficient known solution remains to be the previous O(n^3 log n) time algorithm by Klein [ESA 1998]. Given the lack of progress on improving this complexity, it might appear that unrooted trees are simply more difficult than rooted trees. We show that this is, in fact, not the case, and edit distance between unrooted trees on n nodes can be computed in O(n^3) time. A significantly faster solution is unlikely to exist, as Bringmann et al. [SODA 2018] proved that the complexity of computing the edit distance between rooted trees cannot be decreased to O(n^{3-epsilon}) unless some popular conjecture fails, and the lower bound easily extends to unrooted trees. We also show that for two unrooted trees of size m and n, where m <=n, our algorithm can be modified to run in O(nm^2(1+log(n\/m))). This, again, matches the complexity achieved by Demaine et al. for rooted trees, who also showed that this is optimal if we restrict ourselves to the so-called decomposition algorithms.","keywords":["tree edit distance","dynamic programming","heavy light decomposition"],"author":[{"@type":"Person","name":"Dudek, Bartlomiej","givenName":"Bartlomiej","familyName":"Dudek","affiliation":"Institute of Computer Science, University of Wroc\u0142aw, Poland"},{"@type":"Person","name":"Gawrychowski, Pawel","givenName":"Pawel","familyName":"Gawrychowski","affiliation":"Institute of Computer Science, University of Wroc\u0142aw, Poland"}],"position":45,"pageStart":"45:1","pageEnd":"45:14","dateCreated":"2018-07-04","datePublished":"2018-07-04","isAccessibleForFree":true,"license":"https:\/\/creativecommons.org\/licenses\/by\/3.0\/legalcode","copyrightHolder":[{"@type":"Person","name":"Dudek, Bartlomiej","givenName":"Bartlomiej","familyName":"Dudek","affiliation":"Institute of Computer Science, University of Wroc\u0142aw, Poland"},{"@type":"Person","name":"Gawrychowski, Pawel","givenName":"Pawel","familyName":"Gawrychowski","affiliation":"Institute of Computer Science, University of Wroc\u0142aw, Poland"}],"copyrightYear":"2018","accessMode":"textual","accessModeSufficient":"textual","creativeWorkStatus":"Published","inLanguage":"en-US","sameAs":"https:\/\/doi.org\/10.4230\/LIPIcs.ICALP.2018.45","publisher":"Schloss Dagstuhl \u2013 Leibniz-Zentrum f\u00fcr Informatik","citation":"http:\/\/arxiv.org\/abs\/1804.10186","isPartOf":{"@type":"PublicationVolume","@id":"#volume6310","volumeNumber":107,"name":"45th International Colloquium on Automata, Languages, and Programming (ICALP 2018)","dateCreated":"2018-07-04","datePublished":"2018-07-04","editor":[{"@type":"Person","name":"Chatzigiannakis, Ioannis","givenName":"Ioannis","familyName":"Chatzigiannakis"},{"@type":"Person","name":"Kaklamanis, Christos","givenName":"Christos","familyName":"Kaklamanis"},{"@type":"Person","name":"Marx, D\u00e1niel","givenName":"D\u00e1niel","familyName":"Marx"},{"@type":"Person","name":"Sannella, Donald","givenName":"Donald","familyName":"Sannella"}],"isAccessibleForFree":true,"publisher":"Schloss Dagstuhl \u2013 Leibniz-Zentrum f\u00fcr Informatik","hasPart":"#article11055","isPartOf":{"@type":"Periodical","@id":"#series116","name":"Leibniz International Proceedings in Informatics","issn":"1868-8969","isAccessibleForFree":true,"publisher":"Schloss Dagstuhl \u2013 Leibniz-Zentrum f\u00fcr Informatik","hasPart":"#volume6310"}}}