Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I write an IF condition for my decision variable for Mixed Integer Linear Programming (MILP) using DOCPLEX CP on Python? #4

Open
Alizak97 opened this issue Nov 13, 2019 · 0 comments

Comments

@Alizak97
Copy link

Alizak97 commented Nov 13, 2019

I am trying to solve an optimization problem using mixed integer linear programming on DOCPLEX CP on Python. For example,

Objective Function:

x1 + x2 + x3 = x4 + x5 + x6

where x1, x2, x3, x4. x5 and x6 are decision variables.

How can I add an if condition constraint, such as:

x2 + x4 >= 0 if x6 - x1 >= 0

and

x2 + x4 < 0 if x6 - x1 < 0

here the sum of x2 and x1 are constrained based on the difference between x6 and x1.

@Alizak97 Alizak97 changed the title How can I write an IF condition for my decision variable for Mixed Integer Linear Programming (MILP) using PuLP GLPK on Python? How can I write an IF condition for my decision variable for Mixed Integer Linear Programming (MILP) using DOCPLEX CP on Python? Nov 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant