Ask Your Question

Binary variable in mixed integer linear program

asked 2015-09-28 08:58:51 +0200

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

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!

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2015-09-28 09:18:03 +0200

Nathann gravatar image

No sorry, I do not think that any of the solvers we use support that.

Did you think of modelling your problem as a SAT problem instead? Could it help? Obviously it may not be possible depending on what you want to solve, but it may also be easier with this other formalism.

edit flag offensive delete link more


Hi Nathann, thanks for your quick reply. That is unfortunately. Alternatively, if only I could find a way that I can make a list of binary symbolic variables x[0] , ..., x[n-1] that I can work with over GF(2), this would give me something to go from. While this is somewhat unrelated, would you know how to accomplish this?

mmlauridsen gravatar imagemmlauridsen ( 2015-09-28 09:34:05 +0200 )edit

I do not know, but you should ask on sage-support. Other will know better than I, and they may not read this thread.

Nathann gravatar imageNathann ( 2015-09-28 20:20:06 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2015-09-28 08:58:51 +0200

Seen: 389 times

Last updated: Sep 28 '15