Re: [xsl] Calculating groups of repeating elements

Subject: Re: [xsl] Calculating groups of repeating elements
From: Michael Ludwig <milu71@xxxxxx>
Date: Thu, 11 Dec 2008 03:56:25 +0100
Quinn Dombrowski schrieb am 10.12.2008 um 18:42:07 (-0600):
> 
> So it lists all the groups of 2+ words that appear together in 2+
> places.

Sounds like for a given place and for its set of words, you want to
generate all possible subsets of words having at least two members.

Then, you want to determine all such subsets occurring in at least two
places, longest subsets ranking first, equally long subsets ranked
according to the number of places they occur in.

I've given this some thought, but have failed to come up with an
algorithm that generates all these subsets without duplicates.

As so often, GIYF (learned a new acronym today), and I've found this:

http://reference.wolfram.com/mathematica/ref/Subsets.html
http://de.wikipedia.org/wiki/Potenzmenge
http://en.wikipedia.org/wiki/Power_set

> [...] got overwhelmed by the number of ways I'd have to plug in all
> the different words to go through the data exhaustively-- the real
> data has 250+ places and 75+ words.

A set of 75 words has 2 ^ 75 (3.77789318629572e+22) possible subsets.
The good news for you is that you can eliminate 76 out of these for
having less than two members. :-)

Michael Ludwig

Current Thread