## Abstract

We consider the tree alignment distance problem between a tree and a regular tree language. The tree alignment distance is an alternative of the tree edit-distance, in which we construct an optimal alignment between two trees and compute its cost instead of directly computing the minimum-cost of tree edits. The alignment distance is crucial for understanding the structural similarity between trees. We, in particular, consider the following problem: given a tree t and a tree automaton recognizing a regular tree language L, find the most similar tree from L with respect to t under the tree alignment metric. Regular tree languages are commonly used in practice such as XML schema or bioinformatics. We propose an O(mn) time algorithm for computing the (ordered) alignment distance between t and L when the maximum degree of t and trees in L is bounded by a constant, and O(mn^{2}) time algorithm when the maximum degree of trees in L is not bounded, where m is the size of t and n is the size of a finite tree automaton for L. We also study the case where a tree is not necessarily ordered, and show that the time complexity remains O(mn) if the maximum degree is bounded and MAX SNP-hard otherwise.

Original language | English |
---|---|

Pages (from-to) | 127-137 |

Number of pages | 11 |

Journal | Theoretical Computer Science |

Volume | 787 |

DOIs | |

Publication status | Published - 2019 Oct 1 |

### Bibliographical note

Funding Information:Han was supported by the Institute for Information & Communications Technology Promotion (IITP) grant funded by the Korea government ( MSIP ) ( 2018-0-00276 ) and Ko was supported by the Institute for Information & Communications Technology Promotion (IITP) grant funded by the Korea government ( MSIP ) ( 2017-0-00255 ).

## All Science Journal Classification (ASJC) codes

- Theoretical Computer Science
- Computer Science(all)