s = {1, 2, 3, 4, 5, 6, 7, 8, 9}
k = 3
seen = set()
subset_sizes = reversed(list(range(2, k + 1)))
for item in chain.from_iterable(combinations(s, i) for i in subset_sizes):
    pass
Generate k most subsets unique pair of elements