Finding first K smallest eigenvectors of Sparse Matrix

115 views Asked by At

I'm trying to implement a segmentation algorithm in Java called Normalized Cuts. I am working with a Sparse Matrix and I need to compute its first k smallest eigenvectors. In the original paper (Shi & Malik), they use the Lanczos eigensolver. I couldn't find any package in Java besides the Smile package but their Lanczos implementation solves the largest k eigenvectors while I need the opposite. Do you know of any other Java package that can be useful to me ? Whether implementing Lanczos or any other eigensolver. Also, any ideas on how to modify the Smile algorithm to compute the smallest values instead would be of great help.

The Smile implementation of Lanczos: https://www.javatips.net/api/smile-master/math/src/main/java/smile/math/matrix/Lanczos.java

Thanks

1

There are 1 answers

0
haganov On

The solution was simple. I just modified the eigensystem presented in the original paper by multiplying the Laplacian Matrix by -1, and now I can work with the k largest eigenvectors.

So instead of solving:
D^(-1/2) ( D - W ) D^(-1/2) x = lambda x
I solve:
D^(-1/2) ( W - D ) D^(-1/2) x = lambda x