A novel approach to the problem of non-uniqueness of the solution in hierarchical clustering