Let's say I have two sets
Set 1: A, B, C
Set 2: X, Y, Z
When element B
is accessed we should also retrieve A
and C
together with B
, the other elements in Set 1
I can achieve this with permuting each set and creating an entry in a hashtable for each element of the set and storing/copying all values available in that set, such as;
A: A, B, C
B: A, B, C
C: A, B, C
But that has a memory cost and can become inefficient for large data sets. I'm trying to achieve this without going for a graph database. Data is stored in MySQL. Any suggestions?