igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] efficiency


From: Gábor Csárdi
Subject: Re: [igraph] efficiency
Date: Sun, 29 Nov 2009 14:55:22 +0100

On Sat, Nov 28, 2009 at 4:15 PM, zhengjun chen <address@hidden> wrote:
> Hmmmm, I think the reason why Igraph python is slow is list operation in
> python.
> When using Igraph python, I put the edge information (it is stored in a .txt
> file) into a list, then call add_edges() function to add edges in the list
> to graph. If the graph grows large (i.e. more than 100,000 edges)
> It becomes very slow to add these edges into graph.
> If you have a better way to add edges into graph, and thus to reduce the
> time, please tell me.

If the edges are indeed in a text file, then read them in using
read_graph and create the union (or disjoint union) of the two graphs.
That should be much faster.

If you are computing the edges to add in Python, then I don't know how
to do this faster, but I am not very familiar with python-igraph.

Best,
Gabor

> On Sat, Nov 28, 2009 at 4:11 AM, Gábor Csárdi <address@hidden> wrote:
>>
>> On Sat, Nov 28, 2009 at 2:45 AM, zhengjun chen <address@hidden>
>> wrote:
>> > Hi,
>> > I do not know the performance of Igraph R. I know a bit about the
>> > performance of Igraph Python. It is much slower than C version when the
>> > graph grows large. So, if you want to experiment on large graphs, You
>> > should
>> > choose C version.
>> > On Fri, Nov 27, 2009 at 8:41 PM, Roberto Pagliari <address@hidden>
>> > wrote:
>> >>
>> >> Hi All,
>> >> I was wondering if there are results about performance evaluation of
>> >> igraph R vs igraph for C. Does R use C routines? Because I'm interested
>> >> in
>> >> simulating over large graphs. So if there's a huge difference in terms
>> >> of
>> >> performances, I'd better off using the C version.
>>
>> Hmmmm, can you show an example for which it is much slower?
>>
>> It should not be slower at all. See e.g. this thread:
>> http://lists.gnu.org/archive/html/igraph-help/2009-06/msg00091.html
>>
>> I would definitely go with the R or Python version, the one that you
>> are more familiar with. R and Python are _much_ more productive than
>> programming in C. Only use C if you really need to.
>>
>> Best,
>> Gabor
>>
>> [...]
>>
>>
>> _______________________________________________
>> igraph-help mailing list
>> address@hidden
>> http://lists.nongnu.org/mailman/listinfo/igraph-help
>
>
>
> --
> Thanks
> zhengjun
>
> Graduate research assistant
> Dept of Computer Science and Engineering
> Lehigh University
>
> _______________________________________________
> 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]