Clustering problem

Suppose we are in the unsupervised learning set up an we have sense of distance on , (we assume for ). We want to be a set of categories such that maps items that are close to one another to the same category.