def maximum_clique(G): for k in range(n(G), 1, -1): for S in combinations(V(G), k): if is_clique(G, list(S)) == True: return list(S)
def maximum_matching(G): for k in range(floor(n(G) / 2), 1, -1): for m in combinations(E(G), k): if is_matching(G, list(m)) == True: return list(m)
def minimum_dominating(G): for k in range(1, n(G)): for S in combinations(V(G), k): if is_dominating(G, list(S)) == True: return list(S)
def maximum_independent_set(G): for k in range (n(G), 1, -1): for S in combinations(V(G), k): if is_independent(G, list(S)) == True: return list(S)