in reply to Finding Keys from data

If this is for managing database-like data, don't do it. Add an artificial primary key.

If you really need it, and your XY Problem has no better solution, you need brute force.

If you want a faster but approximate solution, read up on greedy algorithms.