Optimization, Operations Research, Python, Data Science, Editors Pick.
nodes and sets their neighbors based on edges. class DSatur: N: List[Node] C: List[Color] history: List[Node] def __init__(self, nodes: List[int], edges: List[Tuple[int, int]]): N = [Node(i) for i in nodes] for e in edges: i, j = e N[i].add_neighbor(N[j]) N[j].add_neighbor(N[i]) self.N = N self.C =