Understanding spectral clustering