Ca2 or
Ca2 or
ca2 assignment
sessiOn 2023-2024
Semester: 7th
Year: 4th
cOntent
Ans:
To solve this linear programming problem (LPP) using the Simplex
Method, we need to convert it into standard form by introducing slack
variables and then apply the Simplex Method to iteratively improve the
objective function value until we reach the optimal solution. The standard
form of a linear programming problem is as follows:
1. x1 + 2x2 ≤ 40
2. 3x1 + 2x2 ≤ 60
3. x1, x2 ≥ 0
Basis x1 x2 s1 s2 RHS
s1 1 2 1 0 40
s2 3 2 0 1 60
Z -60 -50 0 0 0
Page 1
Now, we'll perform the Simplex Method steps to find the optimal solution:
1. Identify the pivot column: Choose the column with the most negative
value in the Z row. In this case, the pivot column is x1 (with -60).
2. Identify the pivot row: Calculate the ratios of the right-hand side (RHS)
to the values in the pivot column for each row. Choose the row with the
smallest non-negative ratio. The pivot row is s1 (with a ratio of 40/1 = 40).
3. Pivot: Make the pivot element (the element at the intersection of the
pivot row and pivot column) equal to 1. To do this, divide the pivot row by
the pivot element (which is 1 in this case):
4. Eliminate other entries in the pivot column: Make all other entries in the
pivot column equal to 0. To do this, perform row operations to eliminate
the other entries. Adjust all rows as follows:
Basis x1 x2 s1 s2 RHS
x1 1 2 1 0 40
s2 0 -4 -3 1 -20
Z 0 10 60 0 2400
1. Identify the pivot column: Choose the column with the most negative
value in the Z row. In this case, the pivot column is x2 (with 10).
Page 2
2. Identify the pivot row: Calculate the ratios of the right-hand side (RHS)
to the values in the pivot column for each row. Choose the row with the
smallest non-negative ratio. The pivot row is s2 (with a ratio of 20/4 = 5).
3. Pivot: Make the pivot element (the element at the intersection of the
pivot row and pivot column) equal to 1. To do this, divide the pivot row by
the pivot element (which is 4 in this case):
4. Eliminate other entries in the pivot column: Make all other entries in the
pivot column equal to 0. To do this, perform row operations to eliminate
the other entries. Adjust all rows as follows:
Basis x1 x2 s1 s2 RHS
x1 1 0 1/2 -1/4 30
x2 0 1 -3/8 1/8 5
Now, all coefficients in the Z row are non-negative, and we've reached the
optimal solution. The optimal solution is:
Z = 1250
x1 = 30
x2 = 5
s1 = 0
s2 = 0
Page 3
So, the maximum value of Z is 1250, and the values of x1 and x2 that
achieve this maximum are 30 and 5, respectively. The slack variables s1
and s2 are both equal to 0 in the optimal solution.
______________________________________________
Ans:
To solve this linear programming problem (LPP) using the Simplex
Method, we first need to convert it into standard form by introducing
slack variables and then apply the Simplex Method to iteratively improve
the objective function value until we reach the optimal solution. The
standard form of a linear programming problem is as follows:
where:
Z is the objective function to be minimized.
c1, c2, ..., cn are the coefficients of the decision variables x1, x2, ..., xn in
the objective function.
aij are the coefficients of the decision variables in the constraint
equations.
s1, s2, ..., sm are slack variables introduced to convert inequalities to
equalities.
b1, b2, ..., bm are the right-hand sides of the constraints.
xi are the decision variables, and si are the slack variables.
Page 4
In your case, we have the following problem:
1. x1 + x2 - s1 = 2
2. 2x1 + x3 - s2 = 5
3. x1, x2, x3, s1, s2 ≥ 0
Basis x1 x2 x3 s1 s2 RHS
s1 1 1 0 -1 0 2
s2 2 0 1 0 -1 5
Z -4 -8 -3 0 0 0
Now, we'll perform the Simplex Method steps to find the optimal solution:
1. Identify the pivot column: Choose the column with the most negative
value in the Z row. In this case, the pivot column is x1 (with -4).
2. Identify the pivot row: Calculate the ratios of the right-hand side (RHS)
to the values in the pivot column for each row. Choose the row with the
smallest non-negative ratio. The pivot row is s1 (with a ratio of 2/1 = 2).
3. Pivot: Make the pivot element (the element at the intersection of the
pivot row and pivot column) equal to 1. To do this, divide the pivot row by
the pivot element (which is 1 in this case):
4. Eliminate other entries in the pivot column: Make all other entries in the
pivot column equal to 0. To do this, perform row operations to eliminate
the other entries. Adjust all rows as follows:
Basis x1 x2 x3 s1 s2 RHS
x1 1 1 0 -1 0 2
s2 0 -2 1 2 -1 1
Z 0 4 -3 4 0 8
1. Identify the pivot column: Choose the column with the most negative
value in the Z row. In this case, the pivot column is x2 (with 4).
2. Identify the pivot row: Calculate the ratios of the right-hand side (RHS)
to the values in the pivot column for each row. Choose the row with the
smallest non-negative ratio. The pivot row is s2 (with a ratio of 1/2).
3. Pivot: Make the pivot element (the element at the intersection of the
pivot row and pivot column) equal to 1. To do this, divide the pivot row by
the pivot element (which is -2 in this case):
4. Eliminate other entries in the pivot column: Make all other entries in the
pivot column equal to 0. To do this, perform row operations to eliminate
the other entries. Adjust all rows as follows:
Z 0 0 5/2 2 2 6
Page 6
Now, all coefficients in the Z row are non-negative, and we've reached
the optimal solution. The optimal solution is:
Z=6
x1 = 5/2
x2 = 1/2
x3 = 0
s1 = 0
s2 = 1/2
So, the minimum value of Z is 6, and the values of x1, x2, and x3 that
achieve this minimum are 5/2, 1/2, and 0, respectively. The slack variables
s1 and s2 are 0 and 1/2 in the optimal solution.
________****________
Page 7