def is_independent_set(G, nodes):
    return G.subgraph(nodes).number_of_edges() == 0
Returns True if and only if `nodes` is a clique in `G`.
dataset/ETHPy150Open networkx/networkx/networkx/algorithms/approximation/tests/test_clique.py/is_independent_set