Optimization, Operations Research, Python, Data Science, Editors Pick.
pyo.Set(initialize=edges]) # Edges Next, we instantiate our decision variables. model.x = pyo.Var(model.N, model.C, within=pyo.Binary) model.y = pyo.Var(model.C, within=pyo.Binary) And then our constraints. # Fill every node with some color def fill_cstr(model, i): return sum(model.x[i, :]) == 1 #