Consider a graph object G in python-igraph 0.7. If I want the adjacency matrix A of G, I have to write A=G.get_adjacency()
, but there are two problems:
- Even if G is sparse with 3000 nodes, A is generated in a long time on my commercial laptop. Is it possible that the creation of the adjacency matrix is so expensive?
- The output A is a Matrix object, so if I want to operate with the numpy module on A, I have to convert it first in a list and then in a numpy.matrix. Moreover if A is sparse I need a third conversion in a sparse scipy matrix.
Is there in Igraph any way to obtain a scipy.sparse matrix of a sparse graph in a reasonable time?