code
code
The goal is to find the integer values of x1 and x2 that minimize the objective function
while satisfying these constraints.
3. Solution Procedure
Step 1: Solve the LP Relaxation
The first step is to relax the integer constraints and solve the Linear Programming (LP)
problem without the integer requirement. This gives us a real-valued solution for x1 and
x2, which may or may not be integers.
By solving the relaxed LP, we obtain a solution, but in many cases, the solution may have
fractional values. These fractional solutions are not valid for the ILP, and thus, we must
apply techniques such as the Gomory cut to move toward an integer solution.
Step 2: Check for Fractional Solutions
Once the LP relaxation is solved, we check if any of the variables in the solution are
fractional. A fractional solution means that the solution is not valid for the ILP, and a
Gomory cut should be applied to eliminate this fractional solution.
Step 3: Apply the Gomory Cut
The Gomory cut method generates a cutting plane that eliminates fractional solutions
from the feasible region of the ILP. The cut is added as an additional constraint, and the
problem is re-solved to move toward an integer solution.
A Gomory cut typically takes the form:
where ai is a coefficient derived from the current solution, and the floor function ensures
that fractional solutions are removed.
Step 4: Re-solve the Problem
After applying the Gomory cut, the problem is solved again. This process can be repeated
iteratively, adding more cuts if necessary, until an optimal integer solution is found.
4. Example Solution
For this example, we use the Python package PuLP to solve the ILP problem and apply
the Gomory cut. The following steps were performed:
1. LP Relaxation: We first solve the LP relaxation of the problem (i.e., without the
integer constraints), and the solution was found to be:
o x1=2.0
o x2=1.5
2. Fractional Solution Detected: Since x2=1.5is fractional, we apply the Gomory
cut to eliminate this fractional solution.
3. Gomory Cut Application: A cut was generated based on the fractional parts of
the solution. The cut constraint is added to the problem, and the problem is solved
again.
4. Re-solved Problem: After applying the Gomory cut, the new integer solution was:
o x1=2.0
o x2=1.0
This is the final integer solution to the ILP problem.