grinpy.invariants.independence.is_k_independent_set(G, nbunch, k)

Return whether or not the nodes in nbunch comprise an a k-independent set.

A set S of nodes in G is called a k-independent set it every node in S has at most k-1 neighbors in S. Notice that a 1-independent set is equivalent to an independent set.

G : graph
A Networkx graph.

nbunch : a single node or iterable container of nodes.

k : int
A positive integer.
isKIndependent : bool
True if the nodes in nbunch comprise a k-independent set, False otherwise.