Cutting Plane - Gomory Cut

Consider the following Integer Programming problem:

Max $Z = c^{t} x$
Subject to:
$Ax \leq b$
$ x \geq 0$ and $x$ is integer.


To solve this problem we first solve it as a Linear Programming problem using the simplex method.

If the optimum obtained is integer, then we can use it as a solution to the given problem.
If it is not, we generate another constraint (Gomory cut) that excludes the non-integer solution just obtained, add that constraint to the LP and solve it. Repeat this until an integer solution is obtained.

Now to generate a Gomory cut we follow the following procedure:

When the given problem is solved as an LP problem by the simplerx method, we arrive at the final dictionary. Let us denote it as

$x_{B(i)} + \Sigma_{j \not \in B} y_{ij}x_{j} = y_{i0}$, $\forall i \in B$. -- (1)
Here $B$ denote the basis (corresponding to the basic feasible variables).

Now for any $i$ $\lfloor y_{ij} \rfloor \leq y_{ij}$.
Since all the variables are nonnegative,
$x_{B(i)} + \Sigma_{j \not \in B} \lfloor y_{ij} \rfloor x_{j}$ $ \leq x_{B(i)} + \Sigma_{j \not\in B} y_{ij}x_{j} = y_{i0}$
Since we are looking for an integer solution, optimum values of the variables are integers. Hence


$x_{B(i)} + \Sigma_{j \not \in B} \lfloor y_{ij} \rfloor x_{j}$ $ \leq \lfloor y_{i0} \rfloor $-- (2)

By subtracting (2) from (1) we obtain
$\Sigma_{j \not\in B} ( y_{ij} - \lfloor y_{ij} \rfloor )x_{j}$ $\geq y_{i0} - \lfloor y_{i0} \rfloor $ -- (3)

Let $f_{ij} = y_{ij} - \lfloor y_{ij} \rfloor $ and $f_{i0} = y_{i0} - \lfloor y_{i0} \rfloor $.
Then (3) becomes

$\Sigma_{j \not\in B} f_{ij}x_{j} \geq f_{i0} $ or
$-\Sigma_{j \not\in B} f_{ij}x_{j} \leq -f_{i0} $ matching the other constraints.

Introducing a salck variable $s_{i}$, we get


$-\Sigma_{j \not\in B} f_{ij}x_{j} + s_{i} = -f_{i0}$

Thus we have the following dictionary:

$x_{B(i)} + \Sigma_{j \not \in B} y_{ij}x_{j} = y_{i0}$, $\forall i \in B$
$s_{k} - \Sigma_{j \not\in B} f_{kj}x_{j} = -f_{k0}$, for an arbitrary $k \in B$.

Note that this basic solution (corresponding to $B$) is infeasible since $x_{j} = 0$ and $s_{k} = -f_{k0}$.
Thus the current optimum, which is non-integer, is excluded from the new LP problem. Note also that it does not exclude any integer solutions because the new constraint is obtained by restricting the original constraints to integers.
However, its dual is feasible since it is an optimum for the LP problem and the coefficients of $Z$ are all negative (can not increase $Z$ any more by inceasing the values of $x$'s). So we can proceed with it applying the simplex method.

Example:
Max $7x_{1} + 9x_{2}$
Subject to:
$-x_{1} + 3x_{2} \leq 6$
$7x_{1} + x_{2} \leq 35$ $x_{1}$ and $x_{2}$ are nonnegative integers.

When this is solved by simplex after introducint slack variables $x_{3}$ for the first constraint and $x_{4}$ for the second, we get the following dictionary:

$x_{1} = 9/2 + (1/22)x_{3} - (3/22)x_{4}$
$x_{2} = 7/2 - (7/22)x_{3} - (1/22)x_{4}$
$z = 63 - (28/11)x_{3} - (3/22)x_{4}$

It is optimal but $x_{1}$ and $x_{2}$ are not integers. So we generate a Gomory cut from the equation for $x_{2}$ (you can also use any of the other two).
Colleting the variables to the left hand side, we get from the equation for $x_{2}$
$x_{2} + (7/22)x_{3} + (1/22)x_{4}$ = $7/2$ -- (E1)
Consider the part of the left hand side consisting of the integer coefficients. Since only $x_{2}$ has an integer coefficient, it is equal to $x_{2}$. It is less than or equal to the right hand side of (E1). Hence $x_{2} \leq 7/2$. Since we are looking for an integer solution, $x_{2}$ need to be integer. Hence
$x_{2} \leq 3$ -- (E2)
Subtracting (E2) from (E1) we get
$(7/22)x_{3} + (1/22)x_{4} \geq 1/2$
Hence our new constraint is
$-(7/22)x_{3} - (1/22)x_{4} \leq -1/2$
By introducing a slack variable $x_{5}$ we get
$-(7/22)x_{3} - (1/22)x_{4}+ x_{5} = -1/2$ -- (E3)

With (E3) our new dictionary is
$x_{1} = 9/2 + (1/22)x_{3} - (3/22)x_{4}$
$x_{2} = 7/2 - (7/22)x_{3} - (1/22)x_{4}$
$x_{5} = -1/2 +(7/22)x_{3} + (1/22)x_{4}$
$z = 63 - (28/11)x_{3} - (3/22)x_{4}$

The integer solution we are looking for certainly must satisfy these equations.

The basic solutin corresponding to this dictionary is infeasible since $x_{5} = -1/2$. However, since its dual is feasible we can go to the dual and see which way to proceed.

By inspecting the dual (or by dual simplex), we can see that $x_{4}$ and $x_{5}$ should be interchanged. Thus we get

$x_{1} = 3 + x_{3} - 3x_{5}$
$x_{2} = 3 - x_{5}$
$x_{4} = 11 -7x_{3} + 22x_{5}$
$z = 123/2 + (49/22)x_{3} - 3x_{5}$


Proceeding with simplex the following final dictionary is reached:

$x_{1} = 5 - (1/7)x_{2} - (1/7)x_{4}$
$x_{5} = 3 - x_{2}$
$x_{3} = 11 - (22/7)x_{2} - (1/4)x_{4}$
$z = 86 -7x_{2} - (73/22)x_{4}$

Since $Z$ is maximum and all the variables have integer values, this is the optimum for our Integer Programming problem.