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

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

Pages (from-to) | 218-232 |

Number of pages | 15 |

Journal | Lecture Notes in Computer Science |

Volume | 3608 |

DOIs | |

State | Published - 2005 |

Externally published | Yes |

Event | 9th International Workshop on Algorithms and Data Structures, WADS 2005 - Waterloo, Canada Duration: 15 Aug 2005 → 17 Aug 2005 |

## ASJC Scopus subject areas

- Theoretical Computer Science
- Computer Science (all)