Indicator variable

An indicator variable can be useful in several cases.

Suppose we have the situation below.

Three areas, two normal ones, and one emergency area.

To use this emergency area, we need to pay a penalty to activate this area, besides the unitary cost.

Suppose we need a min value of 100.000 tons.

The question. How to model this in Linear integer programming?

Easy. With an indicator variable.

We model everything as usual.

But we add a binary variable (in B17), and a “Big M” calculation in B18.

The “big M” is a number great enough to our purposes.

If indicator is zero, 0*100000 = 0

If indicator is one, 1*100000 = 100000 > 40.000 (bigger than the emergency area).

In the constraints,

B17 = binary

B18 > B17, to force the indicator to be one if emergency area is used.

In Objective Function, we multiply the indicator and the penalty – if indicator is zero, no penalty, if it is one, add penalty.

For example, if the minimum volume is 100.000, then we do need the emergency area:

If the minimum volume is 74000, we don’t need to activate the emergency area.



File to download.

Ideias técnicas com uma pitada de filosofia:

https://ideiasesquecidas.com/

Deixe um comentário

Preencha os seus dados abaixo ou clique em um ícone para log in:

Logotipo do WordPress.com

Você está comentando utilizando sua conta WordPress.com. Sair /  Alterar )

Foto do Google

Você está comentando utilizando sua conta Google. Sair /  Alterar )

Imagem do Twitter

Você está comentando utilizando sua conta Twitter. Sair /  Alterar )

Foto do Facebook

Você está comentando utilizando sua conta Facebook. Sair /  Alterar )

Conectando a %s