Optimization, Operations Research, Python, Data Science, Editors Pick.
[] self.history = [] def find_next_color(self, node: Node) -> Color: next_color = None for c in self.C: if c not in node.neighbor_colors: next_color = c break if next_color is None: next_color = Color(len(self.C) + 1) self.C.append(next_color) return next_color def solve(self, save_history=False):