Alex Rivera | Logout

Fast Data structure for finding strict subsets (from a given list)

Asked 2011-06-28T20:00:27.290
22

I have a large set of sets e.g. {{2,4,5} , {4,5}, ...}. Given one of these subsets, I would like to iterate through all other subsets which are strict subsets of this subset. That is, if I am interested in set A, e.g. {2,4,5}, I want to find all sets B where the relative complement B / A = {}, the empty set. Some possibilities could be {2,4}, {2,5} but not {2,3}

I could of course search linearly and check each time, but am looking for an efficient data structure both for the larger set and the subset (if it matters). The number of subsets is typically in the 10s of thousands, but if it makes a difference I would be interested in cases where it could be in the hundreds of millions. The size of the subsets is typically in 10s.

I am programming in C++

Thanks

Edit
Report

1 Answer

0

Have a look at this python library that implements Hasse diagrams python-lattice]1

answered 2013-01-18T09:21:46.127

Your Answer