Compute a distance metric between two partitions of a set