I have a set of objects ${O_1, O_2, O_3, ..., O_n}$. I have calculated the pairwise distances of all possible pairs. The distances are stored in a $n\times n$ matrix $M$, with $M_{ij}$ being the distance between $O_i$ and $O_j$. Then it is natural to see $M$ is a symmetric matrix.

Now I wish to perform unsupervised clustering to these objects. After some searching, I find Spectral Clustering may be a good candidate, since it deals with such pairwise-distance cases.

However, after carefully reading its description, I find it unsuitable in my case, as it requires the number of clusters as the input. Before clustering, I don't know the number of clusters. It has to be figured out by the algorithm while performing the clustering, like DBSCAN.

Considering these, please suggest me some clustering methods that fit my case, where

  1. The pairwise distances are all available.
  2. The number of clusters is unknown.

1 Answer 1


There are many possible clustering methods, and none of them can be considered "best", everything depends on the data, as always:

  • $\begingroup$ Thanks for the answer. But as I said, given my case where I have already the pairwise distances and don't know the number of the clusters, what method may be suggested? So the methods that you suggest all deal with the pairwise distance? You didn;t mention the fitness to my case here. COuld you please kindly confirm? THanks! $\endgroup$ Commented Sep 20, 2013 at 14:16
  • $\begingroup$ DBScan, Optics and HC can be used with custom distances, and all of them do not require number of clusers, density link is a hybrid of these approaches so shares their characteristic. Spectral clustering was your choice, I only provided you with the modifications that deal with the number of clusters. $\endgroup$
    – lejlot
    Commented Sep 20, 2013 at 14:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.