Given a set S = {si : {zj : z ∈ N} }, what is a time-efficient algorithm for computing the unique sets of intersections of the subsets of S?
For background, I am dealing with several versions of this problem, some larger than others. In the smallest one |S| ≈ 1,000, |si| ≈ 10,000 and the values are zip codes.
Tiny example for clarity:
Input: S = {{},{1},{2,3},{3,4,5,6,7,8,9,10}}
Output: {{},{1},{2,3},{3,4,5,6,7,8,9,10},{3}}
|S| = 4 and there are 24 = 16 subsets of S. However, there are only five unique sets of subset intersections. The first four are the members of S themselves. The fifth is {3}. The empty set is already a member of S. All other 10 subset intersections produce empty sets also.
subsetandintersection? For example,S1 = {{1}, {2,3}}andS2 = {{}, {1}, {2,3}}are subsets ofSand their intersection is(S1 & S2) == {{1}, {2,3}}i.e., members of an intersection are sets themselves therefore a set of intersections is a set of sets (intersections) of sets (members ofS). How do you get the output to be just a set of sets? - jfs