7.9.5. networkx.algorithms.coloring.strategy_independent_set¶
-
networkx.algorithms.coloring.strategy_independent_set(G, colors)[source]¶ Uses a greedy independent set removal strategy to determine the colors.
This function updates
colorsin-place and returnNone, unlike the other strategy functions in this module.This algorithm repeatedly finds and removes a maximal independent set, assigning each node in the set an unused color.
Gis a NetworkX graph.This strategy is related to
strategy_smallest_last(): in that strategy, an independent set of size one is chosen at each step instead of a maximal independent set.