1

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

haganov
  • 31
  • 2
  • can you like multiple it with -1 and the largest becomes the smallest? – Hi computer Aug 01 '22 at 08:56
  • I'm not sure if this is what you meant but I multiplied the Laplacian matrix by -1 and got what I wanted. So instead of solving: D^(-1/2) ( D - W ) D^(-1/2) x = lambda x , I'm solving: D^(-1/2) ( W - D ) D^(-1/2) x = lambda x Now the k largest eigenvectors work for me – haganov Aug 01 '22 at 11:42
  • Please provide enough code so others can better understand or reproduce the problem. – Community Aug 01 '22 at 17:30

1 Answers1

0

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

haganov
  • 31
  • 2