compute laplacian matrix