Optimization, Operations Research, Python, Data Science, Editors Pick.
node_set.add(int(j)) nodes = sorted(node_set) assert len(nodes) == n_nodes, "Wrong number of nodes specified" Then we just parse these to a new DSatur instance and solve the problem (or at least get a good-quality approximation). dsatur = DSatur(nodes, edges) dsatur.solve() The code to create that