Homology as a parsimony problem: a dynamic homology approach for morphological data