Optimization, Operations Research, Python, Data Science, Editors Pick.
Do not repeat colors on edges and indicator that color is used def edge_cstr(model, i, j, c): return model.x[i, c] + model.x[j, c] <= model.y[c] # Break symmetry by setting a preference order (not required) def break_symmetry(model, c): if model.C.first() == c: return 0 <= model.y[c] else: c_prev =