|
From: | Jack Zellweger |
Subject: | Re: [igraph] g.es.find() Bottleneck |
Date: | Fri, 15 Jul 2016 11:08:54 -0400 |
Hello,
Simply use g.es[g.get_eid(source.index, target.index)]; g.es.find()
does a linear scan of all the edges, while g.get_eid() uses a faster
lookup.
Best,
T.
> _______________________________________________
On Thu, Jul 14, 2016 at 8:57 PM, Jack Zellweger <address@hidden> wrote:
> Hello all,
>
> The Problem:
> I am having trouble with program execution speed on a Python implementation
> of igraph. I import a complete weighted graph of 4268 nodes, and 9105778
> edges into a variable g. My program executes quickly and efficiently, but
> get stopped up when the function g.es.find() is executed.
>
> Code Snippet:
> Here's an example of the bottleneck...
>
> source = g.vs.find(name='1234')
>
> target = g.vs.find(name='3456')
>
> # This function call takes ~2 seconds
>
> neighborEdge = g.es.find(_source=source.index, _target=target.index)
>
>
> This last line of code alone takes about 2 seconds, where as all the other
> lines of code execute in an instant.
>
> The Question:
> Is there a faster way identify and set an edge between two nodes equal to
> the variable neighborEdge? This implementation takes too long with this huge
> graph I'm handling. Any help is greatly appreciated. Thanks so much for your
> time.
>
> Best,
> Jack Zellweger
> LIGO Research
> Kenyon College
>
> igraph-help mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/igraph-help
>
_______________________________________________
igraph-help mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/igraph-help
[Prev in Thread] | Current Thread | [Next in Thread] |