def is_clique(G, nodes):
    H = G.subgraph(nodes)
    n = len(H)
    return H.number_of_edges() == n * (n - 1) // 2
Returns True if and only if `nodes` is an independent set
dataset/ETHPy150Open networkx/networkx/networkx/algorithms/approximation/tests/test_clique.py/is_clique