Given A is a large, sparse, 0-1 matrix, (not necessarily a square matrix). I want to calculate B = A*A^T
, where A^T
is the transpose of A
. Note that although A is 0-1 matrix, B is not 0-1 matrix.
In addition, this question has the following special features:
I don't need the elements on the diagonal of
B
, so it's okay to either delete them after calculation or ignore them when calculating.I only need to know the values of all non-zero elements in
B
(except for the elements on the diagonal), so it is OK if the program only gives a list which contains all non-zero elements. However, repeated elements cannot be merged: For example, ifB[2,3] = B[2,4] = 1
, then this list should contain two '1's instead of one.Since
B
must be a symmetric matrix, it is also possible to give only the upper or lower part of it.
I have tried using Eigen (http://eigen.tuxfamily.org/). But the functions of sparse matrix in Eigen are not specifically optimized for this problem, I hope to get some more efficient algorithms.
Any algorithm, open source library, or papers are welcome.
Related Questions: Which is the best way to multiply a large and sparse matrix with its transpose?