igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Retrieve nodes forming a motif with subgraph_isomorphisms


From: Tamás Nepusz
Subject: Re: [igraph] Retrieve nodes forming a motif with subgraph_isomorphisms
Date: Wed, 12 Aug 2015 08:44:37 +0200

Hi,

> Is there a similar function to as_edgelist( graph ) but only providing edges 
> incident to the specified vertices in the following way: as_edgelist( graph, 
> vertices ).
incident(graph, vertex) and incident_edges(graph, vertices) does exactly that 
if I remember correctly.

> This is based on my experience that the numeric matrix returned by 
> as_edgelist is more convenient and faster to further process than list.
It could be the case, but I'm not sure whether that's the real bottleneck in 
your code. Have you tried profiling it to see which parts are responsible for 
most of the execution time?

> On the other hand,  I'm using python as well.  So what is situation on the 
> python side?
They both rely on the same set of core C routines so I don't think there would 
be a big difference - one possible optimization would be to use Python's 
built-in set type for set intersections and exclusions (basically you 
pre-compute the incidence list for each vertex as a Python dict mapping vertex 
indices to sets). Maybe you could also use another dict as a cache that 
memorizes the computed indices for edges incident on a specific edge so you 
don't calculate it over and over again when your random walker is stuck in a 
part of a graph - but the benefits of such a solution depend on the structure 
of your graph

T.


reply via email to

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