0

Imagine that I have two variables fw (>= 0) and a (binary) and my objective function is to minimize: fw.

In the constraints part, I want to ensure (among other things that are not important here) that if fw > 0, then a == 1. To ensure this, I used the following expression:

M * a >= fw; #(M is a big constant)

The problem is I also want to ensure that when fw == 0, then a == 0 , and the restriction above is not sufficient (due to the fact that a is not in the objective function). Is there any way to ensure this without adding a to the objective function?

Conhada
  • 103

1 Answers1

0

Let's assume M=upper bound of fw (choose as small as possible). Then

0.01 a <= fw <= M a