Midterm Resume
Midterm Resume
1
Content
1. Linear Programming Assumptions
2. Formulation
3. Graphical Solution
4. Algebraic solution: The Simplex Method
2
Assumptions of LPs
1. Linearity: both the objective function and the constraints are linear. This
means that each decision variable is multiplied by a constant coefficient, and
these products are either added or subtracted. There are no quadratic,
exponential, or other non-linear terms in the equations.
2. Certainty: It means that numbers in the objective and constraints are known
with certainty and do not change during the period being studied
3. Additivity: This assumption states that the total value of the objective
function and each constraint is the sum of the values of the individual terms. In
other words, the effect of changing a decision variable is independent of the
levels of other variables.
4. Divisibility: The divisibility assumption implies that decision variables can
take on any value, including fractional values. This means that solutions to LP
problems can include non-integer values. When integer decision variables must
be used in a program , we call it an integer linear program
3
Assumptions of LPs
5. Proportionality: the contribution of each decision variable to the total value
of the objective function, and each constraint, is directly proportional to the value
of the variable.
4
Formulation
› Formulating a problem corresponds to translating the information given in its description into a
system of linear equations. The formulation process can be summarized in the following steps:
• Identify the objective
• The objective function can be to Maximize (e.g. Max profit) or to
1 Minimize (e.g. Min cost or distance)
5
Formulation-continued
› Examples of constraints:
6
Graphical Solution
› Any point that satisfies all the constraints of the model is called a feasible solution. It can be an interior point [inside the feasible
region], a boundary point [belongs to the line of a constraint but it is not the point of intersection point with another constraint], or
an extreme (corner) one [intersection point of two constraints]. The set of all feasible solutions is called the feasible region. A
feasible solution that makes the value of the objective function an optimum (maximum or minimum) is called an optimal
solution. It is one of the extreme (corner) points.
7
Graphical Solution- continued
› To solve a problem graphically, we have to follow the following steps:
1. Rewrite the constraints of the LP as equality ones. To do that, you have to add the slack variables for
the constraints of type “≤” and the surplus variables for the constraints of type “≥”
2. Draw the axis that represent the non-negativity constraints ( this is a step that is often forgotten but
is actually crucial! , when you have non-negativity constraints, the FR is located in the upper right
side of the xy plane !)
3. Draw the 1st constraint by finding 2 points that satisfy the inequation of the constraint ( Choose a
value for one variable and deduce the other, always go for easy values first for ex x=0)
8
Graphical Solution- continued
3. Test the (0,0) point to know where is the feasible region and color it. We plug-in the point
O(0,0) in C1’s equation: 0+2*0<=0 the region limited (constrained by) C1 is OBG
4. Draw the 2nd constraint. Test the (0,0) point to locate the feasible region (that satisfies both
constraints) and color it.
5. Draw the nth constraint. Test the (0,0) point to locate the feasible region (that satisfies all constraints)
and color it.
9
Graphical Solution- continued
6. Draw Z1: Choose a value for your objective function (for example Z=0) then find two points which
coordinates satisfy this value and draw your Z1 line :
Exp : Min Z= -6x+3y , let Z= 0 , two points that satisfy this equation are: (0, 0) and (1,2)
7. Draw Z2: Choose a second constant equals to your objective function. If your objective is to maximize
the function, the second constant must be greater than the first one. However, if your objective is to
minimize the function, the second constant must be less than the first one. Then, find two points and
draw your Z2 line.
8. Now that you know the direction of your objective function, pick up a ruler and put it on the Z2 line.
Slide it in a parallel manner until it touches the last corner point before quitting the feasible region. This
point is your optimal solution.
10
Graphical Solution- continued
› Note that if the Z line touches two points simultaneously before quitting the feasible region, we have
a multiple solutions case. Here the segment containing these two optimal points is composed of an
infinite number of optimal solutions. Any weighted average of optimal solutions is also an optimal
solution. The case of multiple solutions happens when the objective function is parallel to one of the
constraints.
11
Graphical Solution- continued
› The problem can be unbounded, which can be determined graphically. The feasible region
would be “open” and the direction of the Z line follows this opening
The problem can also be unfeasible, where we cannot find a feasible region. This means that we do
not have any point that satisfies all the constraints.
12
Graphical Solution- continued
How to know if the constraint is binding (active)?
› A binding constraint is the one that when relaxing it the optimal solution changes. That is, the optimal solution is
the intersection between at least two active constraints. Note that the slack of a binding constraint is equal to zero
and any additional unit of this “resource” will improve the Z value.
13
Graphical Solution- continued
›
14
Algebraic solution: Simplex method
∙ The simplex algorithm starts from a basic feasible solution (corner point) and moves to a better
adjacent basic feasible solution, performing an optimality test at each “move” (iteration) until
optimality is reached.
∙ If an optimal solution of a LP exists, then at least one of the corner points is optimal.
∙ In order to determine analytically the basic feasible solutions of a linear problem, we start by solving
the system of binding constraints written in standard form. A basic solution is formed through a
system for which the number of equations is equal to the number of variables
15
Algebraic solution: Simplex method
› To solve a linear problem using the simplex method, follow these steps:
1) Write your LP in the standard form. You just need to add the necessary slack/surplus variables to
obtain equality constraints.
16
Algebraic solution: Simplex method
2) Write your LP in a tabular form (initial simplex tableau)
17
Algebraic solution: Simplex method
3) If your objective function is a maximization one, choose the variable having the largest ∆j value to
enter the basis. However, if your objective is a minimization one, you will choose the variable having the
most negative Cj-Zj value to enter the basis. For both cases, this variable is called the entering variable
and its column is the pivot column.
4) Perform the ratio test: divide the R.H.S value by that of the same row of the pivot column.
Independently if you are maximizing or minimizing your objective function, you will choose the variable
having the smallest positive value in the ratio test column. Note that dividing by 0 or a negative value is
not possible. The chosen variable is the leaving one and its row is called the pivot row. The intersection
between the pivot row and the pivot column is called the pivot element.
18
Algebraic solution: Simplex method
19
Algebraic solution: Simplex method
›
20
Algebraic solution: Simplex method
21
Algebraic solution: Simplex method
5) Once all values are found, check if you reached the optimal tableau. For this, check the ∆j values. If you are
maximizing your objective, you reach the optimal tableau when all values are 0 or negative. However, if you are
minimizing your objective, all ∆j values must be zero or positive to say that the tableau is optimal.If optimality is
reached, stop and provide the optimal solution. Else, find the pivot column, the pivot row, and the pivot element
and move to the next iteration. Then perform all iterations needed till optimality is reached.
› If the variable is basic, then its value is equal to the one in the R.H.S column.
› The Z value is equal to the value corresponding to the intersection between the Z row and the R.H.S
column.
22
Simplex method (special cases)
› How to know if the problem has alternate (multiple solutions) or if it is unbounded?
› If we have an unbounded solution : We only have zero or negative values in the pivot column and
hence the ratio test fails the entering variable can improve the objective value with no stop
› If we have multiple (alternate) solutions : there will be a non-basic variable with a cbar equal to zero
when optimality is reached:
23
Additional Resources
Video tutorials:
https://youtube.com/playlist?list=PLx8TC2zdR0F8MdGbkFbw9o0ZvyPBTpwab
Old class files: (if you want to check them out stick to the most recent ones)
https://drive.google.com/drive/folders/0B5BPmfTpDLYPQnR3U1U2bWxaN0E?resour
cekey=0-VWKpC_O1uVah6chrLxNdBg
24