def makeA(laplacian_matrix):
n = laplacian_matrix.shape[<NUM_LIT:0>]<EOL>row,col = sp.sparse.triu(laplacian_matrix,k=<NUM_LIT:1>).nonzero()<EOL>pairs = np.asarray((row,col)).T<EOL>N = row.shape[<NUM_LIT:0>]<EOL>A = sp.sparse.csr_matrix((np.ones(N), (np.arange(N),row)), shape=(N,n)) +sp.sparse.csr_matrix((-<NUM_LIT:1>*np.ones(N), (np.arange(N),col)), shape=(N,n))<EOL>return A, pairs<EOL>
This function create the all neighbor permutations.
The output A multiply by Y will be [ Y_i - Y_j ].T for all j > i
So the maximum will be C^n_2. But it will be less than this value
because of the sparseness of L.

Returns
-------
A : sparse matrix, shape (N_pairs, n_samples)
    Operator for Y projection transformation.
pairs : matrix, shape (N_pairs, 2)
    Pairs index for A, first column is the row and second is the col.