jpearl has asked for the wisdom of the Perl Monks concerning the following question:
I have an interesting problem that i've been thinking about. Basically we have a series of different "things" (say 4 of them). I would like to group each thing together by a given set of attributes. The way this is calculated is something like:
a1 a2 a3 t1 y y n t2 y n y t3 n y y t4 y y n
From the table we can see similarities and differences between the things. For example the difference between t1 and t4 is 0, and the similarity is 3. My idea is to group the "t#"s together by maximizing the average difference between them, and minimize the similarity. To do that, however I need to be able to split the "things" into multiple different subsets. For example:
Subset(s)1 = {t1,t2}{t3}{t4} Subset(s)2 = {t1}{t2,t3}{t4} Subset(s)3 = {t1}{t2}{t3,t4}
etc.
Then basically iterate over all different possible combinations and find the maximum average distance and/or minimum similarity resulting from a comparison of the groups. My question is: is there a module available which will return sets of subsets like this? I'm finding a lot of modules that return permutations and the like, but not subsets. I can of course write my own, but reinventing the wheel and all that. Any suggestions of a better/different way to do a grouping of this nature are of course completely appreciated.
Thanks!
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Sets of subsets
by ELISHEVA (Prior) on Jul 22, 2009 at 20:49 UTC | |
Re: Sets of subsets
by ig (Vicar) on Jul 22, 2009 at 20:48 UTC | |
by jpearl (Scribe) on Jul 22, 2009 at 21:41 UTC | |
Re: Sets of subsets
by mzedeler (Pilgrim) on Jul 22, 2009 at 20:59 UTC | |
Re: Sets of subsets
by JavaFan (Canon) on Jul 22, 2009 at 20:17 UTC | |
by jpearl (Scribe) on Jul 22, 2009 at 20:44 UTC | |
by JavaFan (Canon) on Jul 22, 2009 at 21:16 UTC | |
by jpearl (Scribe) on Jul 22, 2009 at 22:00 UTC | |
Re: Sets of subsets
by blokhead (Monsignor) on Jul 23, 2009 at 16:41 UTC |