Clustering with a new distance measure based on a dual-rooted tree