[Networkit] Read simple edgelist

Jérôme Deschênes jeromedesch at gmail.com
Mon Sep 28 20:33:28 CEST 2015

(This is my first message to a mailing list, ever.)

First, I am kind of new to Python but I do understand the underlying
concepts of it.

I am trying to import an EdgeList (360,000 nodes and 9,000,000 edges). This
is not a huge network by any mean but somehow a large one.

The form of the file is this one :

1234 55342
1234 23232
1234 33324
2455 324525
2455 242525
... ....

It is an undirected edgelist: the first column being a node and the second
on being a node to which this one is directly connected.

Looking at the list of formats in the graphio.py file, I assume that this
is an EdegeListSpaceZero format as it starts on the first line (i.e.: no
column headers) and has a space character for delimiters.

However, when I try networkit.graphio.readGraph("myfile.txt", Format.
EdegeListSpaceZero), I get this error:

MemoryError                               Traceback (most recent call last)
/usr/local/lib/python3.4/dist-packages/networkit/graphio.py in
readGraph(path, fileformat, **kwargs)
    117                         try:
--> 118                                 G = reader.read(path)
    119                                 return G

_NetworKit.pyx in _NetworKit.EdgeListReader.read

MemoryError: std::bad_alloc

During handling of the above exception, another exception occurred:

OSError                                   Traceback (most recent call last)
<ipython-input-4-21eac3b4172f> in <module>()
----> 1 G = nkit.graphio.readGraph("myfile.txt",Format.EdgeListSpaceZero)

/usr/local/lib/python3.4/dist-packages/networkit/graphio.py in
readGraph(path, fileformat, **kwargs)
    119                                 return G
    120                         except Exception as e:
--> 121                                 raise IOError("{0} is not a valid
{1} file: {2}".format(path,fileformat,e))
    122         return None

OSError: /myfile.txt is not a valid Format.EdgeListSpaceZero file:

I run Networkit on an Ubuntu (64 bits) guest within a Windows  7 (64 bits)
using Virtualbox. The computer has 32GB of Ram but the virtual machine only
has access to 24GB (which I can increase if necessary) .

I have been able to read this exact same file in NetworkX  (as well as in
SNAP, Gephi and Cytoscape) on the same virtual machine. So, my assumption
is that I have enough RAM to store the whole file at once.

I want to use Networkit to speed up the process of computing centrality
measures as the above programs tend to use only one core for calculations
(even when asked not to). As I am using a workstation with 16 cores and 32
threads, they only use about 3% of computing power...

My first question: what is the source of the error I get?
And, of course, my second: is there a solution to get around it?

Thank you in advance and sorry for my kind of vague question.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ira.uni-karlsruhe.de/mailman/private/networkit/attachments/20150928/5559d4cf/attachment.html>

More information about the NetworKit mailing list