I have a (symmetric) matrix M that represents the distance between each pair of nodes. For example,
M
A B C D E F G H I J K L
One more possible way is using Partitioning Around Medoids which often called K-Medoids. If you look at R-clustering package you will see pam function which recieves distance matrix as input data.