grinpy.invariants.domination.is_k_dominating_set¶
-
grinpy.invariants.domination.
is_k_dominating_set
(G, nodes, k)¶ Return whether or not nodes comprises a k-dominating set.
A k-dominating set is a set of nodes with the property that every node in the graph is either in the set or adjacent at least 1 and at most k nodes in the set.
This is a generalization of the well known concept of a dominating set (take k = 1).
Parameters: - G (NetworkX graph) – An undirected graph.
- nodes (list, set) – An iterable container of nodes in G.
- k (int) – A positive integer.
Returns: True if the nodes in nbunch comprise a k-dominating set, and False otherwise.
Return type: boolean