grinpy.invariants.independence.is_independent_set

grinpy.invariants.independence.is_independent_set(G, nodes)

Return whether or not the nodes comprises an independent set.

An set S of nodes in G is called an independent set if no two nodes in S are neighbors of one another.

Parameters:
  • G (NetworkX graph) – An undirected graph.
  • nodes (list, set) – An iterable container of nodes in G.
Returns:

True if the the nodes in nodes comprise an independent set, False otherwise.

Return type:

bool