[Top][All Lists]

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

Re: [igraph] problems with counting motifs

From: Tamas Nepusz
Subject: Re: [igraph] problems with counting motifs
Date: Wed, 21 May 2008 23:04:11 +0200

Number of V - shaped motifs I am getting from igraph is 117, however the correct number should be 129 (calculated using MAvisto tool). Either you have different definition for motifs or there is a bug in igraph.
I think the number returned by igraph is right. I did a 'brute force' V-shaped motif counting on your network using the following (very simple and slow) Python code, and the result was 117 again:

In [1]: g = load("Austria.gml")
In [2]: el = set(g.get_edgelist())
In [3]: x=0
In [4]: for v1 in xrange(g.vcount()):
    for v2 in xrange(v1+1, g.vcount()):
        for v3 in xrange(v2+1, g.vcount()):
            e1 = (v1,v2) in el or (v2,v1) in el
            e2 = (v2,v3) in el or (v3,v2) in el
            e3 = (v3,v1) in el or (v1,v3) in el
            s = sum(map(int, [e1,e2,e3]))
            if s == 2: x += 1
In [5]: print x

So the bug is either in MAvisto or in the GML reader of igraph, or our interpretation of V-shaped motifs is different. The loaded graph has 75 vertices and 82 edges in my case, is this the correct number?


reply via email to

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