igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] community_fastgreedy() requires integers as edge weights?


From: Kurt J
Subject: Re: [igraph] community_fastgreedy() requires integers as edge weights?
Date: Sun, 27 Apr 2008 17:32:17 +0100

well here's what happens in the interpreter:

Type "help", "copyright", "credits" or "license" for more information.
>>> import igraph
>>> G = igraph.Graph.Read_GraphML("graph15k_audio_recip.ml")
>>> G.community_fastgreedy('audio')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "build/lib.macosx-10.3-fat-2.5/igraph/__init__.py", line 437, in community_fastgreedy
igraph.core.InternalError: Error at src/igraphmodule.c:1047: Internal error, Invalid value
>>> w = []       
>>> for e in G.es:
...     w.append(e['audio'])
...
>>> G.community_fastgreedy(w)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "build/lib.macosx-10.3-fat-2.5/igraph/__init__.py", line 437, in community_fastgreedy
TypeError: sequence elements must be integers
>>>

I'm sure it's using the 'new' dev version.  I've attached a subgraph of the first 50 nodes.  The edge weights are in a property called 'audio'

cheers,
kurt j




On Sun, Apr 27, 2008 at 5:15 PM, Kurt J <address@hidden> wrote:
Thanks Tamas - able to compile the dev branch now.  To summarize for the list (and myself):

using OS X 10.4 and macports to get the dependencies:
$ sudo port install flex
$ sudo port install bison
$ sudo port install libtool
$ ./bootstrap.sh

$ ./configure
$ make
$ sudo make install
$ sudo python ./interfaces/python/setup.py install

However, I'm still getting the same error for fast_greedy().  walktrap() seems to run ok altho i've been interrupting it before it finishes to try to sort this out. 

2. All weights must be positive - have you checked that?
The are all positive, however some are really small
>>> min(weights)
1.1290599999999999e-14

Let me double verify the install went as i think and I will get back to you.  Thanks again - if you're ever in London I owe you a beer :)

-kurt j


On Sun, Apr 27, 2008 at 4:14 PM, Tamas Nepusz <address@hidden> wrote:
Hi Kurt,


i've grabbed the dev version and re-installed python interface using this:

$ tla get address@hidden/igraph--main--0.5 igraph_dev
...
$ python igraph_dev/interfaces/python setup.py install
Seems OK so far if you did the usual ./configure && make && sudo make install dance in the tree of the C core (otherwise the Python interface will still link to the old C core that was installed in /usr/lib or /usr/local/lib or whatever).

Seems ok and then when I try using weights w/ fast_greedy i get a different error:
[...]

igraph.core.InternalError: Error at src/igraphmodule.c:1047: Internal error, Invalid value
There are three causes in the fast greedy community routine that generates an "Invalid value" error message:
1. The weight vector is too short (quite unlikely in your case, since it comes from the edge attributes)
2. All weights must be positive - have you checked that?
3. A loop edge was detected - simplify the graph before starting the community detection.

If none of these applies to your case, then please send me a small dataset that reproduces the problem.


Do i need to re-compile the development version of the C core?  If so I'm a bit confused - where are the configure and make scripts?
There is a script called ./bootstrap.sh in the dev tree you checked out from our Arch repository which produces the configure script. You'll need automake and autoconf as well.

--
T.




_______________________________________________
igraph-help mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/igraph-help


Attachment: smallgraph.ml
Description: Text document


reply via email to

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