Fastest way to perform subset test operation on a large collection of sets with same domain

后端 未结 6 724
名媛妹妹
名媛妹妹 2021-02-10 02:26

Assume we have trillions of sets stored somewhere. The domain for each of these sets is the same. It is also finite and discrete. So each set may be stored as a bit field (eg: 0

6条回答
  •  滥情空心
    2021-02-10 02:53

    If you can preprocess the sets, the subset relation is representable as a DAG (because you're describing a poset). If the transitive reduction is computed, then I think you can avoid testing all the sets by just performing a DFS starting from the biggest sets and stopping whenever Y is no longer a subset of the current set being visited.

提交回复
热议问题