ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 28 Sep 2015 08:58:51 +0200Binary variable in mixed integer linear programhttps://ask.sagemath.org/question/29626/binary-variable-in-mixed-integer-linear-program/Hi asksage!
I'm using the `MixedIntegerLinearProgram` class to model a mixed integer linear program. I am using binary variables created e.g. by `x = mip.new_variable(binary=True, name="x")`. Now, I am using this variable e.g. by `x[0]` or `x[3,2]`. When I create a constraint using sums over binary variables, this sum is in the integers, as it should be. However, I am wondering if there is another way to easily add such variables together over `GF(2)` such that e.g. `x[0] + x[0]` disappears from the equation?
I ask because my model is too complicated to write by hand, so I am using some auxiliary methods to construct constraints and variables, etc.
I hope you can help me out!mmlauridsenMon, 28 Sep 2015 08:58:51 +0200https://ask.sagemath.org/question/29626/