This is a brute force method for computing the most parsimonious tree. It's based on Section 12.3 of the book: Deonier, Richard C., Simon Tavaré, and Michael Waterman. Computational genome analysis: an introduction. Springer Science & Business Media, 2005.