[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[igraph] help regarding igraph write/get adjacency matrix

From: Rajeev Verma
Subject: [igraph] help regarding igraph write/get adjacency matrix
Date: Sun, 5 Nov 2017 20:25:36 +0530

I used igraph to create a citation graph from dblp dataset. I want to get adjacency matrix of the graph for further process. After saving generated graph in GraphML format, I tried using that file to generate adjacency_matrix.

 g = Graph.Read_GraphML('graph.GraphML')
>>> summary(g)
IGRAPH DN-- 629814 632751 --
+ attr: id (v), name (v), title (v), year (v)

This shows that the graph has 629814 vertices and 632751 edges. The  problem comes in adjacency matrix

 m = g.get_adjacency()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/igraph/__init__.py", line 541, in get_adjacency
    return Matrix(GraphBase.get_adjacency(self, type))
MemoryError: Error at vector.pmt:130: cannot init vector, Out of memory

The question is what are the effective ways to generate adjacency matrix considering this MemoryError.
Thanks very much for any help.
Rajeev Verma

reply via email to

[Prev in Thread] Current Thread [Next in Thread]