Replace overly-simplistic greedy search with an algorithm to
produce guaranteed minimal lists of grouping sets (using a
bipartite graph and the Hopcroft-Karp algorithm).