A direct approach to graph clustering