As I think I've said elsewhere, Limbic~Region's solution has a time complexity that goes up as O(K!/(N!(K-N)!)), that is as "K choose N", where K is the number of keywords and N the size of your tuples. However, I think that the memory requirements of his solution are only O(K*I), where I is the number of items.
Contrast my solution, which while it wins on this set of data (5 seconds for what takes L~R's 30 minutes), has a time complexity of at least O(I*L!/(N!(L-N)!)), and so bogs down if the size of the sets increases, (just change rand(8) to rand(80) and watch it fall over) and has a memory complexity of something like that as well. (where "L" is the average size of a set)
--
@/=map{[/./g]}qw/.h_nJ Xapou cets krht ele_ r_ra/;
map{y/X_/\n /;print}map{pop@$_}@/for@/
| [reply] [Watch: Dir/Any] [d/l] |