Introduction To OR + Model Formulation
Introduction To OR + Model Formulation
Research
20 October 2019
Course Outline
1. Introduction.
2. Construction of the LP Model.
3. Graphical LP Solution.
1. Solution of a Maximization Model.
2. Solution of a Minimization Model.
3. Slack, Surplus, and Unrestricted Model.
1. Introduction.
20 October 2019 3
Introduction
20 October 2019 6
Introduction
Phases of OR
1. Definition of the problem includes:-
• The description of the decision variables
(alternatives)
• The determination of the objective of the study
• The specification of the limitations under which
the modeled system operates.
20 October 2019 6
2. Model Construction
Translating the real world problem into
mathematical relationships (the most
suitable
model to represent the system, LP, dynamic
programming, integer programming, ………..)
3.Solution of the model
Using well-defined optimization techniques.
An important aspectof model solution is
sensitivity analysis.
20 October 2019
4.Model validity
Testing and evaluation of the model. A common
method for testing a validity of a model is to
compare its performance with some past data
available for the actual system.
5.Implementation of the solution
Implementation of the solution of validated model
involves the translation of the model's results into
instructions issued in understandable form to the
individual
20 October 2019
2-8
Basic components of the model
1. Decision Variables
It is the unknown to determine from the solution of a
model (what does the model seek to determine). It
is one of the specific decisions made by a decision
maker (DM).
2. Objective Function
It is the end result (goal) desired to be achieved by
the system. A common objective is to maximize
profit or minimize cost. It is expressed as a
mathematical function of the system decision
variables.
20 October 2019
3.Constraints
These are the limitations imposed on the
variables to satisfy the restriction of the modeled
system. They must be expressed as
mathematical functions of the system decision
variables (D.V.).
20 October 2019
Mathematical modeling formulation:
subject to
Constraints
20 October 2019
Example 1:
• A company manufactures two products A&B.
with 4 & 3 units of price. A&B take 3&2
minutes respectively to be machined. The total
time available at machining department is 800
hours (100 days or 20 weeks). A market
research showed that at least 10000 units of A
and not more than 6000 units of B are needed.
It is required to determine the number of units
of A&B to be produced to maximize profit.
• Decision variables
X1= number of units produced of A.
X2= number of units produced of B.
• Objective Function
Maximize Z= 4 X1 + 3 X2
• Constraints
3X +2
1 ≤ 800x60
X2 X1 ≥ 10000
X2 ≤ 6000
X1 , X2 ≥ 0
Example 2: Feed mix problem
• A farmer is interested in feeding his cattle at
minimum cost. Two feeds are used A&B. Each cow
must get at least 400 grams/day of protein, at least
800 grams/day of carbohydrates, and not more than
100 grams/day of fat. Given that A contains 10%
protein, 80% carbohydrates and 10% fat while B
contains 40% protein, 60% carbohydrates and no fat.
A costs Rs 20/kg, and B costs Rs 50 /kg. Formulate
the problem to determine the optimum amount of
each feed to minimize cost.
• Decision variables
X1= weight of feed A kg/day/animal
X2= weight of feed B kg/day/animal
• Objective Function
Minimize Z= 20X1 + Cost function
50X2
• Constraints
Protein 0.1 X1 + 0.4 ≥ 0.4
Carbohydrates X2 ≥ 0.8
Fats 0.8 X1 + 0.6 ≤ 0.1
X2
X1 , X2 ≥ 0
0.1 X1
Example 3: Blending Problem
Constraints
20 October 2019
OR
Constraints
Σn <= bi Xi >=0 i = 1, …., m j = 1, …., n
j=1
Where aijXi
n = Number of activities.
Xj = Level of activity j
Cj =Contribution of the objective function/unit of activity j
m = Number of resources
Bi = Amount of resource i available.
Aij=Amount of resource i consumed by one unit of activity j
Other forms
1. Minimize Z= Σnj=1 CjXj
2. Σn A X >= B for some values of i
j=1 ij i i
3. for some values of i
A X =B
4. XΣi nj=1unrestricted in sign for some values of i
ij i i
20 October 2019
Terminology of solutions for a LP model:
A Solution
Any specifications of values of X1, X2, ………, Xn is
called a solution.
A Feasible Solution
Is a solution for which all the constraints are satisfied.
An Optimal Solution
Is a feasible solution that has the most favorable value
of the objective function (largest for maximize or
smallest for minimize).
20 October 2019
Note
20 October 2019
Graphical Solution
20 October 2019
A market survey indicates that the daily demand for interior
paint cannot exceed that of exterior paint by more than 1 ton.
Also, the maximum daily demand of interior paint is 2 ton.
20 October 2019
Problem Formulation
Decision variables
X1= Tons produced daily of exterior paint.
X2= Tons produced daily of interior paint.
Objective Function
Maximize Z= 5 X1 + 4 X2
Constraints
6 X1 + 4 X2 <= 24
- X1 + X1 + <= 1 <= 6
2 X2
X2 <= 2
X2 >=0
Any solution that satisfies
X1,all
X2the constraints of
the model is
a feasible solution. For example, X1=3 tons and X2=1 ton is a
feasible solution. We have an infinite number of feasible
solutions, but we are interested in the optimum feasible
solution that yields the maximum total profit.
20 October 2019
Graphical Solution
20 October 2019
.
Farm uses at least 800lb of special feed daily. The special feed is a
mixture of corn and soybean with the following composition.
The food mixture must contain at least 30% protein and at most
5% fiber. They want to determine the daily minimum cost feed
mix.
20 October 2019
Problem Formulation
Decision variables
Objective Function
Constraints
X1 + X2 >= 800
0.09X1+0.6 X2 >= 0.3(X1+X2) = -0.21X1+0.3 X2 >= 0
0.02X1+0.06 X2 <= 0.05(X1+X2) = 0.03X1-0.01 X2 >= 0
X1, X2 >= 0
20 October 2019
20 October 2019
Slack, Surplus, and Unrestricted variables
Slack Variable:
20 October 2019
Surplus
Variable:
It is used in the constraints of type (>=) normally set minimum
specification requirements.
Unrestricted Variable:
The variable which can be positive or negative.
20 October 2019
The Simplex Method
Introduction
It is a general algebraic method to solve a set
of linear
equations.
20 October 2019
Standard LP Form and its Basic Solution
Example 1:
S.T X1 + X2 - X3 >=
-5
-6X1 + + X 72X+4X
2
- 39X3 <= 4
X1X, 1X2 = >=
10 0
X3 unrestricted = X+3 -
X-3 ,X X-3
where
+3
Standard LP form
Maximize Z= 5X1 + 6 X2
S.T 2X1 + 3X2 >= 18
2X1 +X2 <= 12
3X1 + 3X2 = 24
X 1, X2 >=0
Standard LP form
20 October 2019
The Simplex Algorithm
We solve the Reddy Mikks model,
where
X1= Tons produced daily of exterior paint.
X2= Tons produced daily of interior paint.
Exterior and interior paints are produced from two types of
materials M1 and M2 raw
Maximize Z- 5 X1 - 4 X2 + 0 X3 + 0 X4 + 0 X5 +0 X6 = 0
S.T. 6 X1 +4 X2 + X3 <= 24
X1 +2 X2 + X4 <= 6
- X1 + X2 + X5 <= 1
X2 + X6 <=2
X1, X2, X3, X4, X5, X6 >=0
The variables X3, X4, X5, X6 are the slacks associated with the four
(<=) constraints.
20 October 2019
The Starting Basic Feasible Solution is
20 October 2019
Since none of the Z-row coefficients associated with the non-basic
variables X3, X4 is negative the last table is optimal.
20 October 2019 43
Dr.Farouk Sha'ban
The rules for selecting the entering and leaving variables are referred to
as the optimality and feasibility conditions
for both the maximum and minimum problems the leaving variables is
the basic variables associated with the smallest non-negative ratio. Ties
are broken arbitrarily.
The steps of the simplex method are:
1. Determine a starting basic feasible solution
2. Select an entering variable using the optimality condition. Stop if
there is no entering variable.
3. Select a leaving variable using the feasibility condition.
4. Determine the new basic solution by using the appropriate Gauss-
Jordan computation.
20 October
5. Go 2019
to step Dr.Farouk Sha'ban 44