I have a theoretical social network where two people, A & C, can become friends if and only if, they have a common friend B amongst them. The simplest solution is to iterate over the two lists and see if they have any friends in common. My question is, can I use bloom filters instead? I will have a bloom filter for every user with their friend list added. When I need to check if a common friend exists I check A's friend list with C's bloom filter first and if I get a positive result I actually perform iteration to confirm.Given that the average friend list size if 100 friends, will this implementation be better than simple iteration?
Is it a good idea to use bloom filters for this scenario?
data structures