0

I have multiple constraints and they are straight forward to enter in linprog, but I have two constraints that has a binary component in them. Following is the one:

1 or 0 is Nabc

Mabc - 11(1) <= 0 <-- M111 - 11(1) or Mabc - 11(0) <= 0 <-- M111 - 11(0)

abc are subscripts

How do I implement this in linprog module or possibly make it such that binary is not required.

Here is the one that I can implement in python because there is no binary number associated with it:

Mabc <= 40

1 Answer 1

0

Scipy's linprog only solves Linear-programming problems.

Your problem is not an LP, but an Mixed-integer problem (MIP) and thus cannot be solved (no Branch-and-Bound or Branch-and-Cut code available there).

I don't get your example, but it is very very likely that it cannot be solved without Binary/Integer variables.

You can try pulp which would be the easiest approach getting a MIP-ready lib which supports formulation & solving (e.g. CBC and GLPK; CBC is automatically linked on at least the windows-install).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.