thanks Tamas,

I didn't know about that!

best,
Simone

2012/3/19 Tamás Nepusz <[email protected]>:
>> I need to enumerate all combinations of nodes in my graph (a very
>> small one, 10 nodes maximum) for a value k that express the size of
>> the configuration, like 2 for dyads, 3 for triads and so on until
>> then no bigger order is possible, because there are only 4 nodes. Is
>> further configuration exists… […]
>> Is there something already made in igraph to accomplish this task?
>
> You don't even need igraph for this; essentially you are looking for all the 
> possible subsets of a given set (e.g., {A, B, C, D}). In R, this can be 
> achieved by the sets package:
>
> library(sets)
> vs <- as.set(1:vcount(g) - 1)
> 2^vs
>
> In Python, you can use the powerset() function that is to be found as an 
> example in the documentation for the itertools module: 
> http://docs.python.org/library/itertools.html#recipes
>
> Best,
> Tamas
>
>
>
>
> _______________________________________________
> igraph-help mailing list
> [email protected]
> https://lists.nongnu.org/mailman/listinfo/igraph-help



-- 
Dr. Simone Gabbriellini

DigitalBrains srl
Amministratore
Head R&D

mobile: +39 3403975626
mail: [email protected]

_______________________________________________
igraph-help mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/igraph-help

Reply via email to