Bayesian methods for graph clustering