Dissimilarity and similarity measures for comparing dendrograms and their applications