I have a problem to determine whether a object contains subset of given properties. For instance, I want to look for a object has property of a,b,c,d.. M within N number of objects.
for example
search a,b,c,d object A - e,g,a,c
object B - a,b,c
object C - d,c,b
object D - a,b,c,d,e
would return object B and object C.
The most straight forward solution is check every single object and see if it has property of a,b,c..M. The worst case would be O(mn) since I need to go through all object and check all property a,b,c..M. You can assume N is quite big, and running time will increase cruelly if M increase. Is there any other efficient way to solve this problem? Thanks