6 Nov
2009
6 Nov
'09
4:54 p.m.
Claudio Martella wrote:
yes, it's a small world of over 1.000.000 edges, at the moment, but probably will be bigger in the future. I don't understand how i could switch it to O(E) from the matrix. Can i get the non-zero elements of the matrix?
The adjacency list returned is a sparse matrix object: http://docs.scipy.org/doc/scipy/reference/sparse.html#module-scipy.sparse You can get the non-zero elements with the nonzero() method of the matrix. Cheers, Tiago