Pairwise Clustering and Graphical Models