I'm developing a model that organises items of different classes into a dendrogram, like the one here:
Consider the next dendrogram, it is clearly more homogeneous, i.e. verteces of the same colour are more likely to be next to each other:
I'm wondering how I can assess the homogeneity (or heterogeneity) of a dendrogram. To illustrate this, consider the following two dendrograms:
The first one (right) shows high “homogeneity”, since items of the some colour (class) are nicely grouped together. The second one (left), shows low homogeneity, since the items with the same colour are not close at all.
To make matters more complex, the distance between the groups matters, too. Consider the following two dendrograms:
While both dendrograms would have a low-ish homogeneity, the one on the right displays the lower homogeneity, since $x_1$ is farer away from $x_2$ than in the first one.
So, what is a good measure to assess the "homogeneity" of my dendrograms, which takes into account the caveats mentioned above?