I'm solving an algorithmic problem and managed to decompose it. Here is the sub problem I have:
I have n sets, let's say {1,2},{2,3},{3,4}
I need to find the smallest set that have at least one element in every of these n sets, the solution here is: {2,3}
.
It's not a greedy problem, think about {1},{1,3},{1,3,4},{2,3,4},{2,3},{2}
the solution is {1,2}
even though 3
have the biggest frequency.
Maybe there is also a common name for that algorithm, I tried to search but didn't manage to find anything useful.