# Hierarchical ranking/clustering algorithm?

Consider two situations:

1st situation

You ordered a number of cubes by their weight (from light to heavy). Then you notice that most of the cubes are grey, but there're a lot of the cubes with different colors but similar weights in the middle of your ranking. So, you make the ranking more dependent on the color in this area.

2nd situation

You ordered a number of cubes by their weight (from light to heavy). Each cube consists of different parts that have different weights, but you just measure the total weight. Then you notice that most of the cubes are grey, but there're a lot of the cubes with different colors but similar weights in the middle of your ranking. So, you pay attention to the weights of different parts of those cubes. If there's a correlation with the color, you measure the weight differently in this area.

In the 2nd situation, the interpretation of what is measured can change if it helps to describe more variability of the data.

An illustration of the situations: image. "w" means weight. In the first situation, cubes with the same weight (w3) are sorted by color. In the second situation, cubes with the same total weight (w3) are sorted by the size of the difference between weights of their parts.

Do you know any ranking/clustering algorithms that work like the 1st or the 2nd method? I called it "hierarchical" in the title because you can imagine different measurement rules nested inside each other. But this hierarchical clustering is not what I'm looking for.

• It is similar to how you rank numbers, that's hierarchical ranking. Jun 16 at 10:19
• @frank, could you expand on this? Though now that you mention it, I remember that some exotic numbers are ordered in a very similar way (e.g. "infinitesimals" and "infinities"). But I found only a couple of links about "hierarchical ranking aggregation", is that what you're talking about? en.wikipedia.org/wiki/Infinitesimal Jun 16 at 10:49
• It is like how you order e.g. the numbers between 10 and 99: first, you rank them all according to the first digit, and then, those which have the same first digit, are ordered according to the second digit. Jun 16 at 11:01
• @frank, I see, thank you! But an algorithm for a practical problem could be a little bit different, so I wanted to know if there're known algorithms like this. Jun 16 at 20:49