if such a function does not exist elsewhere it should be in utils as it's a common problem. Can you check that a similar solver is not already implemented for laplacian eigenmaps for example?