How to define summation type equation as constraints in Python optimization
Clash Royale CLAN TAG #URR8PPP How to define summation type equation as constraints in Python optimization I was trying to solve a optimization problem using scipy package of python. But i don't know how to represent summation type equation as constraints and how to pass those constraint as argumnet to minimize function. The equation is the following : ∑ (Xrij + Xrji) - Yri >= 0,∀r,i j∈V For r=2, V=5 and i=5 I expanded the equation And defined every equation as separate constraint. x[1][1][1]+ x[1][1][1]+ x[1][1][2]+ x[1][2][1]+ x[1][1][3]+ x[1][3][1]+ x[1][1][4]+ x[1][4][1]+ x[1][1][5]+ x[1][5][1] - y[1][1] >= 0 x[1][2][1]+ x[1][1][2]+ x[1][2][2]+ x[1][2][2]+ x[1][2][3]+ x[1][3][2]+ x[1][2][4]+ x[1][4][2]+ x[1][2][5]+ x[1][5][2] - y[1][2] >= 0 x[1][3][1]+ x[1][1][3]+ x[1][3][2]+ x[1][2][3]+ x[1][3][3]+ x[1][3][3]+ x[1][3][4]+ x[1][4][3]+ x[1][3][5]+ x[1][5][3] - y[1][3] >= 0 x[1][4][1]+ x[1][1][4]+ x[1][4][2]+ x[1][2][4]+ x[1][4][3]+ x[1][3][4]+ x[1][4][4]+ x[1][4]...