[Top][All Lists]

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

Re: [igraph] k-size groups in graph

From: Simone Gabbriellini
Subject: Re: [igraph] k-size groups in graph
Date: Mon, 19 Mar 2012 20:27:30 +0100

thanks Tamas,

I didn't know about that!


2012/3/19 Tamás Nepusz <address@hidden>:
>> 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
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/igraph-help

Dr. Simone Gabbriellini

DigitalBrains srl
Head R&D

mobile: +39 3403975626
mail: address@hidden

reply via email to

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