Warning

This documents an unmaintained version of NetworkX. Please upgrade to a maintained version and see the current NetworkX documentation.

networkx.algorithms.coloring.strategy_independent_set

strategy_independent_set(G, colors)[source]

Uses a greedy independent set removal strategy to determine the colors.

This function updates colors in-place and return None, 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.

G is 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.