Group indexing with intersections and unions

-1

There is a collection (up to 10,000) of objects, and I want to build a group structure with index and intersections and unions of them, like groups of permissions in linux, actually.

Example: got 8 objects (atoms) A, B, C...H. The index of 8 bits, where every bit position matched with atom object. So the index of atom group will be 0x000001 for A, 0x00000010 for B and so on. Then the union of A and B will be 0x00000011. This way is good because it is possible use logic bitwise operations and build a math group upon the set.

But when the number of atoms is too big and the index length (as function of number of atoms) is growing too fast, it's hard to use (2k atomic objects – 2k bits of memory?)

Is there a way/algorithm to build structures like that? Or reduce the memory cost? Thanks!

algorithm
math
indexing
grouping
asked on Stack Overflow Nov 23, 2020 by Kudryavtsev Evgeniy • edited Nov 24, 2020 by Akshay Sehgal

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0