igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] how to build a bipartite graph with python


From: Simone Gabbriellini
Subject: Re: [igraph] how to build a bipartite graph with python
Date: Tue, 18 Jan 2011 00:27:01 +0100

ok, thanks Tamas!

Il giorno 18/gen/2011, alle ore 00.16, Tamás Nepusz ha scritto:

>> File "/Users/ogabbrie/Desktop/PANMIND/models/ABMsimulator/Model.py", line 7, 
>> in __init__
>>   self.vs["type"] = 0
>> TypeError: object of type 'int' has no len()
> My bad; igraph 0.5.* does not support this yet, igraph 0.6 will. Use this:
> 
> self.vs["type"] = [int(i >= n1) for i in xrange(n1+n2)]
> 
>> what I am trying to accomplish is to build a graph object after setting some 
>> parameters. Should I build my Model class as an extension of the Graph class?
> Composition is usually better than inheritance in such cases; i.e. make  your 
> model class *contain* a graph instance instead of making your model inherit 
> from Graph.
> 
> -- 
> Tamas
> 
> 
> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help




reply via email to

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