Spectral clustering example

So what is the graph Laplacian good for? One place it is used is to detect clusters in data sets. It turns out that the eigenvector of the graph Laplacian corresponding to the second smallest eigenvalue partitions the graph into two parts, identified by the sign of the eigenvector components.

The MATLAB code to generate this example is here.