Using the Big-M method in optimization problems

Talharehman Mtrkt
3 min readFeb 5, 2024

--

Sometimes non-linear constraints arise when developing the optimization model of an energy system. The Big-M method can be utilized in such cases to linearize those constraints. The method introduces a large constant usually represented as “M” along with some binary (0–1) variables. The use cases of this method are as follows:

Case 1:

When transforming the bi-level optimization problem into a single level using Karush–Kuhn–Tucker (KKT) conditions, the complementarity constraints appearing in KKT conditions are non-linear. A simple representation of a complementarity constraint is given in the figure below.

complementarity constraint

The above constraint can be linearized by introducing a large constant “M” and a binary variable “w”. The transformed equations are represented in the following figure:

The linear form of complementarity constraints

In the above equations, if “w=0” then the variable “a” would be zero else if “w=1” then the variable “b” would be zero.

Case 2:

During the system modeling, we might have constraints such that if one variable has a value, then the other should be zero for example, we cannot charge and discharge the battery at the same time. A simple example of such a constraint is given in the below figure:

The above constraints are non-linear as there is a product of a variable and a binary variable. The above equations can be transformed into linear constraints using the Big-M method as follows:

If the third inequality constraint on binary variables is represented as an equality constraint (“u1 + u2 = 1”), then the above equations can be expressed with a single binary variable as follows.

later in upcoming blogs, we will see the application of this during the modeling of an energy system. However, for now, you can refer to this paper and find the application of the Big-M method: “https://www.sciencedirect.com/science/article/pii/S0959652623035242#appsec1

I hope this is helpful, if you have any feedback please let me know in the comments below.

--

--