How to: handle capacity constraints for different commodities measured in different units

I have been working on a vehicle routing problem in which the truck transports several commodities, but these are measured in different units. Hence, we know the capacity of the truck for each of these commodities alone, but we don’t know how to convert them into one another so that we can load two commodities and still respect the capacity.

Continue reading

Linearization of the product of two variables

Often when writing a model, the most straightforward way of writing a constraint is by multiplying two variables. Then, in order to solve the model we need to linearize it. There comes the problem, as I always have problems reminding how to linearize a product of variables.

Linearizing the product of two binary variables

Suppose your model has the product z = x \times y, where z, x and y are binary. There is an easy way of linearizing that equation. Add the three inequalities below

Continue reading