igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] reading large, sparse graph with read.graph


From: Gábor Csárdi
Subject: Re: [igraph] reading large, sparse graph with read.graph
Date: Tue, 27 Apr 2010 10:35:43 +0200

On Tue, Apr 27, 2010 at 10:00 AM, Tamas Nepusz <address@hidden> wrote:
> Heloo David,
>
>> I would have thought that the time it would take read.graph to load into 
>> memory would be O(|V|+|E|).
> That might approximately be true for simple edge lists and other similar 
> formats, but it is definitely not true for Pajek files because Pajek files 
> are much more complicated to parse. If you need only the edges and the 
> weights from your file (i.e. there are no other attributes to keep), I'd try 
> to load the Pajek file first, then save it in LGL format, which can be read 
> back faster.
>

Actually, I think the Pajek format should be linear in time, as well.
But anyway, an easy way to speed up the import is to convert the file
to a three-column edge list, and then read it in with the scan() R
function. The conversion itself should be pretty simple with the
standard Unix text tools, the Pajek format is usually pretty close to
an edge list. (But not always, the Pajek format has different
subformats.)

Tell us if you need more help on this. Best,
Gabor

>> If it helps to answer, I am contemplating going outside R, and using the 
>> igraph library for Ruby (in alpha). Would graphs load significantly faster 
>> outside of R?
> I don't think it would really matter, all the graph IO calls go down into the 
> C layer of igraph, which is the same for igraph-R and igraph-Ruby.
>
> --
> Tamas
>
>
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help
>



-- 
Gabor Csardi <address@hidden>     UNIL DGM




reply via email to

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