[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] Python Interface to igraph
From: |
Lorenzo Isella |
Subject: |
Re: [igraph] Python Interface to igraph |
Date: |
Fri, 8 Feb 2008 18:28:20 +0100 |
Hello Tamas,
And thanks for your patch. I think I have now a working installation
of igraph for Python.
However, when I tried to use the igraph library (using your example
with minimal modifications) I bumped into troubles.
Most likely I am making a mistake, but you never know.
I attach the following code snippet; I seem to be having problems in
getting the membership of the connected components:
import scipy as s
import igraph as ig
r=s.random.normal(3.,3.,100)
r=s.reshape(r,(10,10))
r=abs(r)
for i in xrange(9):
for j in xrange(i+1,10):
print "i and j are, ", i, j
r[i,j]=r[j,i]
for i in xrange(10):
r[i,i]=0.0
#Now r is a fake distance matrix
g=ig.Graph.Adjacency((r <= 2.2).tolist(), ig.ADJ_UNDIRECTED)
g.simplify()
clustering=g.clusters()
print "clustering is, ", clustering
nc=len(clustering)
print "nc is, ", nc
cluster_sizes=clustering.sizes()
print "cluster_sizes are, ", cluster_sizes
Shouldn't g.clusters() return the membership of each node to a
cluster? Am I doing anything wrong? On my machine, g.clusters()
returns what looks like a memory address.
Cheers
Lorenzo
--------
>
> Message: 2
> Date: Thu, 7 Feb 2008 19:31:08 +0100
> From: Tamas Nepusz <address@hidden>
> Subject: Re: [igraph] Python Interface to igraph
> To: "Lorenzo Isella" <address@hidden>
> Cc: address@hidden
> Message-ID: <address@hidden>
> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
>
> > I tried your suggestion after realizing that the test suite was
> > failing.
> > But here is what I get:
> Oh, I think that's a bug related to the x86_64 architecture (the same
> error was reported to me a few weeks ago). The patch is already in the
> 0.4 tree but I did not make a new release since then. Are you able to
> recompile igraph if I send you a patched graphobject.c?
>
> Best,
> --
> T.
>
>
>
>
>
> ------------------------------
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help
>
>
> End of igraph-help Digest, Vol 19, Issue 6
> ******************************************
>