Convex recolorings of strings and trees: definitions, hardness results and algorithms

  • Authors:
  • Shlomo Moran;Sagi Snir

  • Affiliations:
  • Computer Science dept., Technion, Haifa, Israel;Mathematics dept., University of California, Berkeley, CA

  • Venue:
  • WADS'05 Proceedings of the 9th international conference on Algorithms and Data Structures
  • Year:
  • 2005

Quantified Score

Hi-index 0.00

Visualization

Abstract

A coloring of a tree is convex if the vertices that pertain to any color induce a connected subtree. Convex colorings of trees arise in areas such as phylogenetics, linguistics, etc. e.g., a perfect phylogenetic tree is one in which the states of each character induce a convex coloring of the tree. When a coloring of a tree is not convex, it is desirable to know ”how far” it is from a convex one, and what are the convex colorings which are ”closest” to it. In this paper we study a natural definition of this distance – the recoloring distance, which is the minimal number of color changes at the vertices needed to make the coloring convex. We show that finding this distance is NP-hard even for a path, and for some other interesting variants of the problem. In the positive side, we present algorithms for computing the recoloring distance under some natural generalizations of this concept: the uniform weighted model and the non-uniform model. Our first algorithms find optimal convex recolorings of strings and bounded degree trees under the non-uniform model in linear time for any fixed number of colors. Next we improve these algorithms for the uniform model to run in linear time for any fixed number of bad colors. Finally, we generalize the above result to hold for trees of unbounded degree.