Hierarchical clustering with prototypes