algorithm - Contains superset -
I'm hunting for a structure ("set of set") which will allow me to check efficiently that it has a superset Or not of my set
Example: A = {1, 2} b = {2, 3} c = {1, 3} d = {1, 2, 3}
Set set S1 = {A, B} and second S2 = {D}
in S1 = A => True S1 = C = & gt; A = & gt; in false S2 True
The solution for this should not be less complexity (asymptotic only) as possible.
Use a dictionary to convert between potentially different elements and situations in bitmap. Then store each set as a bitmap.
Taking union of set sets is a question of oring with a bit map.
Is a subset of a set set, or is not checking the result of bitmap in the bitmap of the small set of sets.
These tasks should be fast, and if you were ambitious then actually you can start and calculate how the calculation should be taken to a GPU Could.
If you have large sets and get the wrong answer correctly then you should see the Bloom Filters it lets you get the most correct answer with a much lower bitmap.
Comments
Post a Comment