Linear programming
Chapter 1:Formulation
Fedia Daami Remadi Asma Ben Yaghlane Riahi Roua Ben Ammar
Tunis Business School
1
Content
1 •Operations research
2 •Fields of applications
3 •Scientific steps in Operations Research
4 •Linear Programming
5 •Formulation
Operations research:
Definitions
“Operations research is the Science of better”
(INFORMS)
OR deals with a set of scientific approaches and tools allowing decision
makers to make the most effective decisions.
Operations Research (OR) or decision science is the discipline of scientific
methods that can be used to make the best decisions.
3
Operations research :
Fields of applications
o Anyone who seeks to obtain optimal results under given conditions,
does OR.
o OR in practice is used to solve all types of difficult problems (from
industry or finance) from:
Production: maximizing profits or minimizing the price..
Transport: minimize total distance traveled according to
quantities of materials to be transported, capacity of
transporters ..
Project planning.
Etc.,
4
Operations research:
Scientific steps
The organizational problems encountered in a company are not
mathematical in their nature, but mathematics can make it possible to
solve them.
Therefore, the problem must be translated into a mathematical
framework in which the techniques of OR can be applied.
collect the data No
yes
Problem Modeling Validation Solved
5
Resolution
Linear programming:
Definitions
• Linear programming (LP) is a branch of operations research.
• A Linear Programming model: maximize or minimize a linear
function subject
Thetolinear
a setmodel’s
of linear constraints
components
A set of decision An objective A set of
variables function constraints
6
Formulation
The Decision variables
• The unknowns that we want to determine to provide a solution to our
problem.
• There are 3 types of decision variable:
Continuous variable (≥0)
Integer variable (𝞊 ℕ)
Binary variable ({0,1})
The Objective function (or economic function):
• The function to be optimized (maximize or minimize).
• It must be written in the form of a linear relationship between the 7
decision variables.
Formulation
The Constraints:
• The conditions that must be respected in a problem.
• Expressed by a set of linear equality/inequality.
• The left part of each constraint should be a linear
relationship between the decision variables and the right part
should be a constant.
The constraints also include non-negativity restrictions 8
on the variables
Steps in formulating a LP
1. Understanding the problem (often difficult in
practice).
2. Identify decision variables.
3. Formulate the constraints as linear
combinations of the decision variables.
4. Pose the objective function as a linear
combination of the decision variables.
Linear Programming Assumptions
1) The decision variable are continuous
2) The parameters are known with certainty
3) The objective function and constraints present
constant return to scale
4) The decision variables are independent. There is no
interaction between it
10
Note
max f(x) = -min (-f(x))
Any maximization problem may be replaced by a minimization problem:
Max f(x)“=“-Min –f(x)"
Any minimization problem may be replaced by a maximization problem:
Min f(x)" =“-Max –f(x)"
11
Linear Programming
Example 1 – Apple Profits
“I am a manager at an Apple manufacturer in
Asia. We specialize in making iPods and
iPhones. The business objective is to
maximize profits”.
Steve Jobs just asked us how much of each
product will we be producing this week, and
what kind of profits he can expect to pocket.
12
LP Problem Formulation
1
• Identify the problem objective
(OF)
2
• Identify the decision variables
(DV)
13
Example 1 – Apple Profits
1. Maximize profits from
manufacturing iPods ($75)
2. Number of iPods and
and iPhones ($100) iPhones to produce
14
Example 1 – Apple Profits
4. Write the objective function and constraints in terms
of the decision variables:
Recall:
Decision Variables I want to maximize Steve Jobs’
Let x1 = iPhones profit! How many iPhones and
iPods should I make this week?
x2 = iPods
Net profit gained from selling a
Objective Function iPhone is $100
Let z = profit Net profit gained from selling a
Thus, iPod is $75
Max. z = 100x1 +
75x2 Objective Function
Coefficients 15
LP Problem Formulation
3 • Identify the constraints (C)
4 • Add any implicit C (e.g.; ≥ 0)
16
Example 1 – Apple Profits
Total assembly time: Raw material supply:
limited to 9,000 hours per limited to 5,000 Piece of
week. Circuit Board per week
Each iPhone: 3 hours Each iPhone: 2 PCBs Each
Each iPod: 2 hours iPod:1PCB
Consumers demand:
minimum of 500
iPhones and 3000
iPods per week
17
Example 1 – Apple Profits
4. Write the objective function and constraints in terms
of the decision variables, cont’d:
Technological Recall:
Coefficients • Total assembly time is limited to
3x1 + 2x2 <= 9,000 9,000 hours per week. Each iPhone
takes 3 hours to assemble and an
iPod 2 hours.
• PCB supply is limited to 5,000 PCBs
2x1 + x2 <= 5,000 per week. Each iPhone needs 2
PCBs, whereas an iPod needs only
1.
x1 >= 500 • Consumers demand a minimum of
x2 >= 3,000 500 iPhones and 3,000 iPods.
x1, x2 𝞊 ℕ Step 5: Implicit constraints (non-negative
decision variables) 18
LP Problem Formulation
6
• Arrange the system of
equations in a consistent form
19
Example 1 – Apple Profits Checking LP
Assumptions
Maximize: z = 100x1 + 75x2 1. Linearity
Subject to: • Proportionality
3x1 + 2x2 ≤ 9 000
2x1 + x2 ≤ 5 000
• Additivity
x1 ≥ 500 2. Divisibility
x2 ≥ 3 000
3. Certainty
x1, x2 𝞊ℕ
20
Example 2: A Transportation Problem
A production company has 3 plants 1, 2, and 3 in
different locations. The company is interested in
determining a transportation policy to monthly deliver
its product to different warehouses at four cities: 1, 2,
3, and 4. Transportation costs depend on the traveled
distance and are detailed in the table below:
21
Warehouse 1 2 3 4
Plant
1 4 6 9 13
2 16 12 15 14
3 6 5 8 7
Given that the plants produce respectively 10, 8 and 9 tons per
month and that the warehouses capacities are of 6 tons each,
Formulate the problem as a LP.
22
Decision Variables
Xij : the quantity of the product to deliver from plant i to warehouse
j, i = 1, 2, 3 & j = 1, …, 4.
Objective Function
The objective has to do with minimizing the total transportation cost
from the different plants to the warehouses.
Min Z = 4X11 + 6X12 + 9X13 + 13X14 + 16X21 + 12X22 + 15X23
+ 14X24 + 6X31 + 5X32 + 8X33 + 7X34
23
Constraints
The total quantity to deliver from plant i cannot exceed the
production capacity of the plant, i=1,2,3.
X11 + X12 + X13 + X14 ≤ 10
X21 + X22 + X23 + X24 ≤ 8
X31 + X32 + X33 + X34 ≤ 9
24
The quantity to deliver to warehouse j cannot exceed its
storing capacity, j=1,2,3,4.
X11 + X21 + X31 ≤ 6
X12 + X22 + X32 ≤ 6
X13 + X23 + X33 ≤ 6
X14 + X24 + X34 ≤ 6
25
Min Z = 4X11 + 6X12 + 9X13 + 13X14 + 16X21 + 12X22 +
15X23 + 14X24 + 6X31 + 5X32 + 8X33 + 7X34
X11 + X12 + X13 + X14 ≤ 10
X21 + X22 + X23 + X24 ≤ 8
X31 + X32 + X33 + X34 ≤ 9
X11 + X21 + X31 ≤ 6
X12 + X22 + X32 ≤ 6
X13 + X23 + X33 ≤ 6
X14 + X24 + X34 ≤ 6
Xij ≥ 0 with i = 1, 2, 3 and j = 1, …, 4. 26
Example 3: An investment Problem
The decision-maker should select among four investment
projects for the next two years. Implementation costs and
expected revenues are estimated as given in the Table below in
thousands of Tunisian Dinars, TDN
27
Annual Costs
Project Revenues
Year 1 Year 2
1 60 90 350
2 80 100 370
3 100 70 380
4 70 80 330
28
An investment Problem, continued
Formulate a LP that maximizes the total expected revenues given
that the available budget at the start of each year is of 300 000
TDN
29
Solution
Define
1 if project i is chosen
Xi =
0 otherwise
i {1,2,3,4}
30
Max Z = 350X1 + 370X2 + 380X3 + 330X4
60X1 + 80X2 + 100X3 + 70X4 300
90X1 + 100X2 + 70X3 + 80X4 300
X1 , X2 , X3 , X4 {0,1}
31
Write the following conditions as linear constraints:
At least 2 of the four projects must be chosen
X1 + X2 + X3 + X4 ≥ 2
Projects 1 & 4 are mutually exclusive
X1 + X 4 ≤ 1
32
Project 3 cannot be selected unless project 2 is
also selected
X3 X2
33