Dear OR experts,

I have this equation in my model:

X_it + Y_it - Z_it - N_i = 0 where all of these variables are continues. The problem is that Y_it and Z_it cannot have values greater than zero in the same time step (t). In other words, if Y_it is greater than zero, Z_it has to be zero and vise versa.

Could you please give me your idea about how to formulate this condition in my model.



asked 03 Jan '14, 04:27

Kam's gravatar image

accept rate: 0%

Florian's solution certainly handles it, at the cost of turning something that might have been a linear program into an integer program. Depending on how Y and Z are used otherwise, do you need to force the "one is zero" constraint or might it happen naturally? If Z measures the negative amount for X_it-N_i and Y is the positive amount, a lot of formulations will naturally have only one be positive (for instance, in a linear program where Y and Z don't occur otherwise except in the objective function).


answered 03 Jan '14, 06:36

Mike%20Trick's gravatar image

Mike Trick ♦♦
accept rate: 21%

Let Y_it, Z_it <= M, M const:

Y_it <= M * w
Z_it <= M * (1 - w)
w binary

answered 03 Jan '14, 04:46

fbahr's gravatar image

fbahr ♦
accept rate: 13%

Hi Florian,

Thanks for your good idea.


(03 Jan '14, 04:50) Kam

As an alternative to Florian's solution, you can declare \(Y_{it}\) and \(Z_{it}\) to be a type 1 special ordered set (SOS1). If you know a tight, valid bound M, I suspect you are better off with Florian's approach. (This assumes that Mike's approach does not work.)


answered 04 Jan '14, 15:21

Paul%20Rubin's gravatar image

Paul Rubin ♦♦
accept rate: 19%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 03 Jan '14, 04:27

Seen: 807 times

Last updated: 04 Jan '14, 15:21

OR-Exchange! Your site for questions, answers, and announcements about operations research.