Académique Documents
Professionnel Documents
Culture Documents
The basic aim of production systems is to profit. Using some inputs such as workers, machines,
materials, knowledge, energy etc. they produce products or services, satisfies demand and earn
money. Inputs have a cost. So, in order to increase their total profits production systems search the
best ways of using their resources. Also, the competitiveness in the market forces them to do it.
Industrial engineers try to find these ways in production systems.
Operations research is a discipline that deals with the application of advanced analytical methods to
help make better decisions. Industrial engineers use the operations research discipline in their
decision making processes related with the ways of using the resources and time in production
systems.
Operations research studies consist of developing the linear programming (LP) or integer
programming (IP) or mixed integer programming (MIP) or non-linear programming
formulations/models of the problems and their solution methods.
In this course, we will focus on the modeling part of the operations research studies. Over several
modeling examples we will try to improve students modeling abilities. However, for some special
problems specific solution methods will be covered.
Linear Programming
Fixed values, based on the underlying nature of the problem being solved, are called parameters.
They are used as coefficients and constants in the mathematical models.
The variables in the mathematical model are a set of quantities that need to be determined in order to
solve the problem. These variables are called decision variables because the problem is to decide
what value each variable should take.
Parameters are fixed values, so we cannot change them. However, they affect our solution.
Objective is to maximize or minimize an evaluating criteria. The mathematical representation of the
evaluating criteria and the objective is called objective function.
We evaluate and compare solutions by the objective function. If a solution is better than another one,
we determine the better one by comparing them with their objective function values.
The properties (limitations, restrictions, relations, etc.) that a solution has to satisfy are called
constraints.
A solution which satisfies all constraints is called feasible solution. A solution which is not a
feasible solution is called infeasible solution. According to the objective function values the best
feasible solution is called optimum solution.
Linear programming (LP) is a mathematical technique for finding optimal solutions to problems that
can be expressed using linear equations and inequalities.
In an LP model the following properties should be satisfied:
Proportionality: a change in the value of a decision variable results in proportionate change in that
variables contribution to the value of the function.
Additivity: the value of a function is the sum of the contributions of each term
Divisibility: the decision variables can take fractional values
Deterministic: parameters are known with certainty
In a LP model a constraint may have the , or = form. < and > forms are not allowed.
As a conclusion an LP model may have the following form:
kg. Lets write the total milk amount (in kg) for producing x 1 kg yogurt and x2 kg cheese. It is 1.2x1 +
1.5x2. This amount cannot exceed 200. Thus the constraint is:
1.2x1 + 1.5x2 200.
Logically the production amounts cannot be negative. So we have the following constraints:
x1, x2 0.
Here is the entire model:
max TI = 5x1 + 12x2
s.t.
1.2x1 + 1.5x2 200
x1, x2 0
Example 2:
A company produces two types of products (P1, P2) using two machines (machine A and machine B).
Each unit of P1 products require 2 hours for being processed on A and 4 hours for being processed on
B. Each unit of P2 products require 5 hours for being processed on A and 3 hours for being processed
on B. Machine A can be used at most 40 hours and machine B can be used at most 55 hours, weekly.
Selling prices are $18 and $25 for P1 and P2 products, respectively. The company wants to determine
the weekly P1 and P2 production amounts in order to maximize its weekly total income. Develop the
LP model of the problem.
Solution:
Decision variable definitions:
x1 : the weekly P1 production amount
x2 : the weekly P2 production amount
Objective function: max 18x1 + 25x2 (maximization of weekly total income)
Constraints:
2x1 + 5x2 40 (weekly total processing time on machine A needed for producing x 1 units of P1 and
x2 units of P2 cannot exceed weekly total available time on machine A)
4x1 + 3x2 55 (weekly total processing time on machine B needed for producing x 1 units of P1 and x2
units of P2 cannot exceed weekly total available time on machine B)
x1, x2 0 (production amounts cannot be negative)
Here is the entire model:
max 18x1 + 25x2
s.t.
2x1 + 5x2 40
4x1 + 3x2 55
x1, x2 0
Example 3:
A farmer has 50 acres to plant wheat and corn. Each acre of wheat costs $120 to plant and each acre
of corn costs $180 to plant. He has only $8000 to spend for planting. Furthermore, each acre of wheat
takes 2 hours to plant and each acre of corn takes 1.3 hours to plant. The farmer has to complete
planting in 48 hours. He has to plant at least 30 acres. The profit is $700 per acre of wheat and $900
per acre of corn. How many acres of each should be planted to maximize total profit? Develop the LP
model of the problem.
Solution:
Decision variable definitions:
x1 : the amount of land planted with wheat (in acre)
x2 : the amount of land planted with corn (in acre)
Objective function: max 700x1 + 900x2 (maximization of total profit)
Constraints:
x1 + x2 50 (total planted land cannot exceed the total land he has)
120x1 + 180x2 8000 (total planting cost cannot exceed his budget)
2x1 + 1.3x2 48 (total planting time cannot exceed 48 hours)
x1 + x2 30 (total planted land has to be at least 30 acres)
x1 , x2 0 (planted land amounts cannot be negative)
The entire model is:
max 700x1 + 900x2
s.t.
x1 + x2 50
120x1 + 180x2 8000
2x1 + 1.3x2 48
x1 + x2 30
x1 , x2 0
Example 4: (A case of the Diet Problem)
A company uses at least 800 lb of special feed daily. The special feed is a mixture of earn and
soybean with the following compositions.
Feedstuff
Protein (%)
Fiber (%)
Cost ($/lb)
Corn
9
2
0.30
Soybean
60
6
0.90
The dietary requirements of the special feed stipulate at least 30% protein and at most 5% fiber. The
company wishes to determine the daily minimum cost feed mix. Formulate the problem as an LP
model.
Solution:
x1 : lb of corn in the daily feed mix
x2 : lb of soybean in the daily feed mix
Objective function: min 0.3x1 + 0.9x2 (minimization of total daily cost)
Constraints:
x1 + x2 800 (the daily total feed mix must be at least 800 lb)
0.09x1 + 0.60x2 0.30(x1 + x2) (the amount of protein obtained from x 1 lb corn is 0.09x1 lb and the
amount of protein obtained from x2 lb soybean is 0.60x2 lb. The total protein amount must not be less
than 30% of total mix amount. Note that total mix amount is not 800 lb, it is (x 1 + x2) and it can be
higher than 800 lb. Please see the first constraint.)
In a constraint, generally, we collect the terms with decision variables in the left hand side and give
the constant value in the right hand side of the equality (or inequality) sign. So, one can easily reexpress this constraint after some very simply calculations as,
-0.21x1 + 0.30x2 0
0.02x1 + 0.06x2 0.05(x1 + x2) (the amount of fiber obtained from x1 lb corn is 0.02x1 lb and the
amount of fiber obtained from x2 lb soybean is 0.06x2 lb. The total fiber amount must not exceed 5%
of total mix amount.) After simple calculations this constraint can be written as,
-0.03x1 + 0.01x2 0
x1 , x2 0 (lb of corn and lb of soybean in the daily mix cannot be negative)
Here is the entire model:
min 0.3x1 + 0.9x2
s.t.
x1 + x2 800
-0.21x1 + 0.30x2 0
-0.03x1 + 0.01x2 0
x1 , x2 0
The Graphical Solution Method
When there are two decision variables (let they are x1 and x2) in an LP model the feasible solution
space (FSS) of the model can be shown in a plane (2-dimensional space). One axis is x1 axis and the
other is x2 axis.
Example 4:
Max z = 3x1 + x2
s.t.
x1 <= 4
x1 + x2 <= 7
x1>=0
x2>=0
Our empty plane is:
Then we consider our constraints one by one. Let us consider first constraint: x1<=4.
We should determine the part of our plane that satisfies this constraint. First draw the x1=4 line. This
line is drawn in red below.
The red line is the x1=4 line. But, according to our first constraint (x1<=4) the points having smaller
x1 values than 4 are also valid. So we should select the side of the line x1=4 that satisfies the
constraint x1<=4. The invalid side is scrabbled with red dashes. The valid side is the clean side.
Now, lets consider our second constraint: x1+x2<=7. First we should draw the line: x1 + x2 = 7. The
line is drawn in blue and the side of the line which is invalid according to the constrain is scrabbled.
The remaining clean part of our plane is the solutions satisfying the first and second constraints
simultaneously.
Now, lets consider our third constraint: x1>=0. The invalid part is scrabbled below.
Now, the last constraint (x2>=0) is considered and the invalid side is scrabbled below.
The final clean part, the region OABC, is the feasible solution space (FSS) of the model. The FSS is
shown more clearly in the following figure.
FSS
The last work is searching the optimal solution in this FSS region. Our objective function is:
Max z = 3x1 + x2. Lets draw the line 3x1 + x2 = 3 (i.e., z = 3). The intersection points of the FSS
and 3x1 + x2 = 3 line are the feasible solution with objective function value 3.
Lets draw another line with a higher z value, for example the line 3x1 + x2 = 6 (i.e., z = 6). The
intersection points of the FSS and 3x1 + x2 = 6 line are the feasible solution with objective function
value 6. When we move the objective function in the direction shown below the objective function
value increases. So, in order to find the feasible solution with the maximum z value (the optimal
solution), we should move the objective function line in this direction as much as possible.
increasin
g
direction
Corner point B is the last feasible solution that touches the objective function line when we move the
line in the increasing direction. So, after that point we dont have any other feasible solution in the
increasing direction of the objective function. Then, corner point B is the OPTIMAL solution of the
model.
increasin
g
direction
We should determine the coordinates of the corner point B. Point B is the intersection point of the
constraint lines x1=4 and x1 + x2 = 7. We can use these equations and find the coordinates of point
B. We have two unknowns and two equations.
x1 = 4
x1 + x2 = 7
Solution is: x1=4, x2=3.
At this point B(4,3) the optimal objective function value is:
z = 3x1 + x2 = 3*4 + 3 = 15.
Example 5: Search the optimal solution of the following LP model by the graphical solution method.
Min z = x1 + x2
s.t.
-x1 + x2 <= 2
x1 + x2 >= 4
x2 >= 2
x1, x2 >= 0
The FSS of the model is depicted below. Notice that the right hand side of the FSS is open ended.
A
FSS
The z = x1 + x2 = 7 line and the decreasing direction of the objective function is shown below.
decreasi
ng
direction
A
B
In order to find the feasible solution(s) with the minimum z value (the optimal solution), we should
move the objective function line in this direction as much as possible. When we move the objective
function in its decreasing direction just before it leaves the FSS it coincides with a surface of the FSS
(the line part between points A and B). At this moment the value of z is 4 (i.e, z = x1 + x2 = 4). So, in
this example we have alternative optimal solutions. All the feasible solutions on this surface
(including corner points A and B) are alternate optimal solutions.
A
B
Example 6: Search the optimal solution of the following LP model by the graphical solution method.
Max z = x1 + x2
s.t.
-x1 + x2 <= 2
x1 + x2 >= 4
x2 >= 2
x1, x2 >= 0
This example is almost same with the Example 2. The only difference is that in this example we want
to maximize the objective function. So, the FSS and slope of the objective function is same. Now, we
should consider its increasing direction. It is shown below.
increasin
g
direction
A
B
In order to find the feasible solution(s) with the maximum z value (the optimal solution), we should
move the objective function line in this direction as much as possible. Since, the FSS is open ended
in this direction always we can find a better feasible solution then our current solution. So, we cannot
determine any specific solution as our optimal solution. In this case it is said that the model has
unbounded solution.
Example 7: Search the optimal solution of the following LP model by the graphical solution method.
Max z = x1 + x2
s.t.
-x1 + x2 <= 2
x1 + x2 <= 1
x2 >= 4
x1, x2 >= 0
When you try to determine the FSS you will see that the entire plane will be cancelled and no FSS
will be remained. In this example the FSS is an empty set. The answer is infeasible solution. (Hint:
Last three constraints cannot be satisfied at the same time)
Important Property 1: The feasible solution space of an LP model is an empty set or a convex set.
Important Property 2: If there is an optimal solution of an LP model it is always a corner point of
the FSS.
Redundant Constraint: If a constraint has no active affect on the FSS then it is called redundant
constraint. Deleting a redundant constraint does not change the FSS.
Shortage of the Graphical Method: When the number of the decision variables is more than two
the graphical method is not applicable since we cannot visualize n-dimensional FSS (n>2).
Example 8: (Bankloan Policy)
A bank is in the process of formulating a loan policy involving a maximum of $12 million.
Type of loan
Yearly
Interest rate
Probability of
bad debt
Personal
Car
Home
Farm
Commercial
0.140
0.130
0.120
0.125
0.100
0.10
0.07
0.03
0.05
0.02
Bad debts are uncoverable and hence produce no interest revenue and furthermore loan itself is lost.
Competition in the area requires the bank to allocate at least 40% of total loan to farm and
commercial loans. To assist the housing industry in the region, home loans must be at least 50% of
total of personal, car and home loans. The bank wishes to maximize total expected return after one
year. (Assume that loans start today and return after one year) Develop the LP model of the problem.
Solution:
Decision variables:
x1: personal loan amount (in million dollar)
x2: car loan amount (in million dollar)
x3: home loan amount (in million dollar)
x4: farm loan amount (in million dollar)
x5: commercial loan amount (in million dollar)
If a customer takes 1 dollar personal loan from the bank after 1 year he pays this 1 dollar and its
interest which is 0.140 dollar, in total 1.140 dollar. With the probability 0.10 this personal loan does
not return and it is lost. But with the probability 0.90 it returns as 1.140 dollar. So, the expected
return from 1 dollar personal loan is 0.90*1.140 dollar.
Objective function:
Max z = 0.90*1.140x1 + 0.93*1.130x2 + 0.97*1.120x3 + 0.95*1.125x4 + 0.98*1.100x5
(maximization of total expected return)
Constraints:
x4 + x5 >= 0.40(x1 + x2 + x3 + x4 + x5) (farm and commercial loans must be at least the 40% of
total loans)
x3 >= 0.50(x1 + x2 + x3) (home loans must be at least 50% of total of personal, car and home loans)
x1, x2, x3, x4, x5 >= 0 (there cannot be negative loan)
The entire model is:
Max z = 0.90*1.140x1 + 0.93*1.130x2 + 0.97*1.120x3 + 0.95*1.125x4 + 0.98*1.100x5
s.t.
x4 + x5 >= 0.40(x1 + x2 + x3 + x4 + x5)
x3 >= 0.50(x1 + x2 + x3)
x1, x2, x3, x4, x5 >= 0
Example 9:
John must work at least 20 hours a week to supplement his income while attending school. He has the
opportunity to work in two retail stores: in store1, John can work between 5 and 12 hours a week, and
in store 2, he is allowed to work between 6 and 10 hours. Both stores pay the same hourly wage. John
thus wants to base his decision about how many hours to work in each store on a different criterion:
work stress factor. Based on interviews with present employees, John estimates that, on a scale of 1
to 10, the stress factors are 8 and 6 at stores 1 and 2, respectively. Because stress mounts by the hour,
he presumes that the total stress at the end of the week is proportional to the number of hours he
works in the store. How many hours should John work in each store?
Solution:
x1: working hours in store 1
x2: working hours in store 2
Min z c j x j
j 1
cij x j bi
i 1,2,3,..., m
xj 0
j 1,2,3,..., n
j 1
s.t.
n
xij Si
i 1,2,3,..., m
(capacity constraint s)
xij d j
j 1,2,3,..., n
(demand constraint s)
xij 0
(nonnegati vity)
j 1
m
i 1
Example 14:
Powerco has three electric power plants that supply the needs of four cities. Each power plant can
supply the following numbers of kWhr of electricity: Plant 1 35 million; Plant 2 50 million; Plant
3 40 million. The peak power demands in these cities, which occur at the same time, are as follows
(in kWhr): City 1 45 million; City 2 20 million; City 3 30 million; City 4 30 million. The
costs of sending 1 million kWhr of electricity from plant to city depend on the distance the electricity
must travel (see Table). Formulate an LP problem to minimize the cost of meeting each citys peak
power demand.
To
From
City 1
City 2
City 3
City 4
Supply(M kWhr)
Plant 1
$8
6
10
9
35
Plant 2
9
12
13
7
50
Plant 3
14
9
16
5
40
Demand
45
20
30
30
We begin by defining a variable for each decision that Powerco must make. We define, (for i = 1, 2, 3
and j = 1, 2, 3, 4)
Xij = number of (million) kWhr produced at plant i and sent to city j
Then,
Min Z = 8X11 + 6X12 + 10X13 + 9X14 + 9X21 + 12X22 + 13X23 + 7X24 + 14X31 + 9X32 + 16X33 +
5X34
s.t.
X11 + X12 + X13 + X14 35
(Supply constraints)
X21 + X22 + X23 + X24 50
X31 + X32 + X33 + X34 40
X11 + X21 + X31 45
X12 + X22 + X32 20
X13 + X23 + X33 30
X14 + X24 + X34 30
(Demand constraints)
Xij 0
When the total supply is equal to total demand the problem is called the balanced transportation
problem. The balanced transportation problem can be solved by the Transportation Table Method.
This method actually is a special case of the Simplex Algorithm. The solution procedure starts with a
initial feasible solution and explores the optimal solution in the subsequent iterations. Three methods
are given below to find an initial feasible solution.
Network Models
A network consists of a set of nodes linked by edges. A directed edge is called arc. A directed
network consists of only arcs. The notation for describing a network is (N, E), where N is the set of
nodes and E is the set of edges.
Example: G = (N, E) where N = {1, 2, 3, 4, 5} and E = {(1,2), (1,3), (2,4), (2,5), (3,4), (4,5)}. Draw
the network G.
A path is a sequence of district edges (or arcs) that join two nodes regardless of the directions of arcs.
A path forms a loop (or a cycle) if it connects a node to itself. In a network if there is at least one path
between all different node pairs then this network is called connected network. A tree is a network
that contains no loop. Spanning tree is a tree that links all the nodes of a network to each others.
Some weights may be assigned to the nodes and edges (arcs).
2
7
12
2
6
9
7
3
1
15
5
4
4
Solution:
Step 1:
2
2
7
12
2
[-,0]*
1
9
7
3
1
15
5
4
4
Step 2: Go to Step 3
Step 3:
[1,12]
2
7
12
2
[-,0]*
1
[1,6]
3
1
15
5
4
[1,2]
Step 4:
2
[1,12]
2
7
12
2
[-,0]*
1
[1,6]
3
1
15
5
4
[1,2]*
Step 2: Go to Step 3
Step 3:
[4,17]
2
[1,12]
2
7
12
2
[-,0]*
1
[1,6]
[4,10]
7
3 [4,3]
1
15
5
[1,2]*
4
4
5 [4,6]
Step 4:
2
[1,12]
2
7
12
2
[-,0]*
1
[1,6]
[4,10]
7
3 [4,3]*
1
15
5
[1,2]*
4
4
5 [4,6]
Step 2: Go to Step 3
Step 3:
[1,12] [3,5]
2
12
2
[-,0]*
1
[1,6]
[4,10]
7
3 [4,3]*
1
15
5
[1,2]*
4
4
5 [4,6]
Step 4:
[1,12] [3,5]*
2
12
2
[-,0]*
1
[1,6]
[4,10]
7
3 [4,3]*
1
15
5
[1,2]*
Step 2: Go to Step 3
Step 3:
4
4
5 [4,6]
[1,12] [3,5]*
2
12
2
[-,0]*
1
[1,6]
[4,10]
7 [2,12]
3 [4,3]*
1
15
5
[1,2]*
4
4
5 [4,6]
[2,14]
Step 4:
[1,12] [3,5]*
2
7
2
[1,6]
[2,7]*
12
[-,0]*
1
[2,7]
[4,10]
7 [2,12]
3 [4,3]*
1
15
5
[1,2]*
4
4
5 [4,6]
[2,14]
Step 2: Go to Step 3
Step 3:
[1,12] [3,5]*
2
12
2
[-,0]*
1
[1,6]
[2,7]*
[4,10]
7 [2,12]
3 [4,3]*
1
15
[6,9]
5
[1,2]*
4
4
5 [4,6]
[2,14]
Step 4:
[1,12] [3,5]*
2
12
2
[-,0]*
1
[1,6]
[2,7]*
[4,10]
7 [2,12]
3 [4,3]*
1
15
[6,9]
5
[1,2]*
4
4
5 [4,6]*
[2,14]
Step 2: Go to Step 3
Step 3:
[1,12] [3,5]*
2
12
2
[-,0]*
1
[1,6]
[2,7]*
[4,10]
7 [2,12]
3 [4,3]*
1
15
[6,9]
[5,11]
5
[1,2]*
4
4
5 [4,6]*
[2,14]
Step 4:
[1,12] [3,5]*
2
12
2
[-,0]*
1
[1,6]
[2,7]*
[4,10]
7 [2,12]
3 [4,3]*
1
15
[6,9]*
[5,11]
5
[1,2]*
4
4
5 [4,6]*
[2,14]
( i , j )E
(i v ) ( j u )
dij xij
xuj 1
(1)
xiv 1
(2)
( u , j )E
( i , v )E
xij x ji
j N {u , v}
(3)
xij {0,1}
(i, j ) E | (i v) ( j u )
(4)
( i , j )E
i v
( j , i )E
i u
Objective function is the minimization of total weight on the path. Constraint (1) guarantees the
departure from the origin node. Constraint (2) guarantees the arrival to the destination node.
Constraint (3) balances the number of arrivals and departures for the remaining nodes. Notice that
arrival to origin node and departure from destination node are forbidden by not using the
corresponding decision variables.
The Minimum Spanning Tree Problem
In the minimum spanning tree problem the minimum total weighted spanning tree is searched over a
given network.
xij: if edge (i,j) is on the minimum spanning tree 1, otherwise 0.
min z d ij xij
s.t.
( i , j )E
( i , j )E
iS j N S
xij 1
xij {0,1}
S N | 1 | S |
(1)
(i, j ) E
( 2)
Prim Algorithm
Let Ck be the set of nodes that have been covered by the minimum spanning tree up to iteration k, and
Uk be the set of remaining nodes.
Step 1: Select any node i in set N. Set C1 = {i}, U1 = N-{i}, k = 2.
Step 2: Select the node j in the set Uk-1 that yields the shortest edge to a node in Ck-1. This edge is an
element of the minimum spanning tree. Set Ck=Ck-1 + {j}, and Uk = Uk-1 {j}.
Step 3: If Ck = N STOP, otherwise k=k+1 and go to Step 2.
2
7
10
12
2
1
9
7
3
1
15
13
15
4
4
Solution:
Step 1: Lets select node 2. C1 = {2}. U1 = {1, 3, 4, 5, 6, 7}. k = 2.
2
10
12
2
1
9
7
3
1
15
13
15
4
4
Step 2: Shortest edge from node 2 to remaining nodes is 2. (There are two edges having length 2, one
of them can be selected arbitrarily. Lets select node 3). C2 = {2, 3}. U2 = {1, 4, 5, 6, 7}.
2
10
12
2
1
9
7
15
13
15
4
4
Step 3: C2 N. k = 3. Go to Step 2.
Step 2: Shortest edge from node 2 and node 3 to remaining nodes is 1. C3={2, 3, 4}. U3={1, 5, 6, 7}.
2
10
12
2
1
9
7
15
13
15
4
Step 3: C3 N. k = 4. Go to Step 2.
Step 2: Shortest edge from nodes 2, 3 and 4 to remaining nodes is 2. C4={2, 3, 4, 6}. U4={1, 5, 7}.
2
10
12
2
1
9
7
15
13
15
4
Step 3: C4 N. k = 5. Go to Step 2.
Step 2: Shortest edge from nodes 2, 3, 4 and 6 to remaining nodes is 4. C5={2, 3, 4, 6, 5}. U5={1, 7}.
2
10
12
2
1
9
7
15
13
15
4
Step 3: C5 N. k = 6. Go to Step 2.
Step 2: Shortest edge from nodes 2, 3, 4, 5 and 6 to remaining nodes is 6. C6={2, 3, 4, 6, 5, 1}.
U6={7}.
2
10
12
2
1
9
7
15
13
15
4
5
Step 3: C6 N. k = 7. Go to Step 2.
Step 2: Shortest edge from nodes 1, 2, 3, 4, 5 and 6 to remaining node is 7. C7={2, 3, 4, 6, 5, 1, 7}.
U7={}.
2
10
12
2
1
9
7
15
13
15
4
Step 3: C7 = N, STOP.