|
From: | Tamas Nepusz |
Subject: | Re: [igraph] Igraph-python load bug? |
Date: | Thu, 23 Oct 2008 23:20:08 +0100 |
Hi,
The thing is that if you treat this file as an edge list, then igraph assumes that vertices are indexed from zero. Whenever it sees an ID like "1234567890" in the first, it immediately creates 1234567890 other vertices, assuming that if there's a vertex with ID 1234567890, then there must be ones all the way from ID=0 up to ID=1234567889.If I change ‘tmp’ to have the following lines: 1234567890 123456120 12345 23457then the igraph.load command is VERY slow and basically hangs my terminal.
The solution is to use the NCOL format which is practically equivalent to an edge list as long as you have only two IDs (the source and the target) in a line. The good thing is that NCOL treats IDs as symbolic names and reassigns them to continuous IDs from zero, storing the "real" IDs in an attribute called "name".
For more info: http://cneurocvs.rmki.kfki.hu/igraph/doc/python/igraph.GraphBase-class.html#Read_Ncol http://bioinformatics.icmb.utexas.edu/lgl/ -- Tamas
[Prev in Thread] | Current Thread | [Next in Thread] |