Operations Research PDF
Operations Research PDF
Operations Research PDF
1. INTRODUCTION TO OR..................................................................................... 1
1.1 TERMINOLOGY ...................................................................................................... 1
1.2 THE METHODOLOGY OF OR ............................................................................. 1
1.3 HISTORY OF OR .................................................................................................... 2
2. BASIC OR CONCEPTS ...................................................................................... 6
3. LINEAR PROGRAMMING ................................................................................ 11
OPERATIONS RESEARCH 3.1 FORMULATING LP............................................................................................... 13
LECTURE NOTES 3.1.1 Giapetto Example .......................................................................................... 13
3.1.2 Advertisement Example................................................................................ 15
3.1.3 Diet Example .................................................................................................. 16
3.1.4 Post Office Example...................................................................................... 17
3.1.5 Sailco Example .............................................................................................. 18
3.1.6 Customer Service Level Example............................................................... 19
3.2 SOLVING LP .......................................................................................................... 20
Y. !lker Topcu, Ph.D. 3.2.1 LP Solutions: Four Cases............................................................................. 20
3.2.2 The Graphical Solution (Minimization) ....................................................... 21
3.2.3 The Graphical Solution (Maximization) ...................................................... 22
3.2.4 The Simplex Algorithm.................................................................................. 23
3.2.5 Example illustrating Simplex (Dakota Furniture) ...................................... 24
3.2.6 Other Solution Cases by Simplex ............................................................... 29
3.2.7 The Big M Method ......................................................................................... 31
3.2.8 Example illustrating Big M (Oranj Juice).................................................... 32
3.3 SENSITIVITY ANALYSIS..................................................................................... 35
3.3.1 Reduced Cost................................................................................................. 35
3.3.2 Shadow Price ................................................................................................. 35
3.3.3 Simple Example ............................................................................................. 36
3.3.4 Utilizing Lindo Output for Sensitivity ........................................................... 37
Acknowledgements:
We would like to acknowledge Prof. W.L. Winston's "Operations Research: Applications and 3.3.5 Additional Example (Utilizing Simplex for Sensitivity).............................. 39
Algorithms" and Prof. J.E. Beasley's lecture notes which greatly influence these notes...
We retain responsibility for all errors and would love to hear from visitors of this site!
3.4 DUALITY ................................................................................................................. 42
Istanbul Technical University OR/MS team 3.4.1 The Dual Theorem......................................................................................... 42
www.isl.itu.edu.tr/ya 3.4.2 Finding the Dual of a Normal Max Problem .............................................. 42
3.4.3 Finding the Dual of a Normal Min Problem ............................................... 43
4.1.2 Powerco Example for Balanced Transportation Problem ....................... 46 The British/Europeans refer to "operational research", the Americans to "operations
4.1.3 Balancing an Unbalanced Transportation Problem ................................. 47 research" - but both are often shortened to just "OR" (which is the term we will use).
4.1.4 Modified Powerco Example for Excess Supply ........................................ 48 Another term which is used for this field is "management science" ("MS"). The
4.1.5 Modified Powerco Example for Unmet Demand....................................... 49 Americans sometimes combine the terms OR and MS together and say "OR/MS" or
4.2.1 Northwest Corner Method ............................................................................ 51 Yet other terms sometimes used are "industrial engineering" ("IE"), "decision
4.2.3 Vogel’s Method .............................................................................................. 55 In recent years there has been a move towards a standardization upon a single term
4.3 THE TRANSPORTATION SIMPLEX METHOD ............................................... 57 for the field, namely the term "OR".
4.4 TRANSSHIPMENT PROBLEMS ........................................................................ 61 When OR is used to solve a problem of an organization, the following seven step
4.5 ASSIGNMENT PROBLEMS ................................................................................ 64 OR analyst first defines the organization's problem. Defining the problem includes
4.5.1 LP Representation......................................................................................... 64 specifying the organization's objectives and the parts of the organization (or system)
4.5.2 Hungarian Method ......................................................................................... 64 that must be studied before the problem can be solved.
Just to confuse things the mathematical model of the problem is sometimes called ! all variables continuous (i.e. can take fractional values)
proportional to the value of the decision variable (The contribution to the (Winston 3.1, p. 49)
objective function from making four soldiers (4"$3=$12) is exactly four Giapetto's wooden soldiers and trains. Each soldier sells for $27, uses $10 of raw
times the contribution to the objective function from making one soldier materials and takes $14 of labor & overhead costs. Each train sells for $21, uses $9
($3)) of raw materials, and takes $10 of overhead costs. Each soldier needs 2 hours
o The contribution of each decision variable to the LHS of each constraint is finishing and 1 hour carpentry; each train needs 1 hour finishing and 1 hour
proportional to the value of the decision variable (It takes exactly three carpentry. Raw materials are unlimited, but only 100 hours of finishing and 80 hours
times as many finishing hours (2hrs"3=6hrs) to manufacture three soldiers of carpentry are available each week. Demand for trains is unlimited; but at most 40
soldiers can be sold each week. How many of each toy should be made each week
as it takes to manufacture one soldier (2 hrs))
to maximize profits.
! Additivity
o The contribution to the objective function for any decision variable is
Answer
independent of the values of the other decision variables (No matter what
Decision variables completely describe the decisions to be made (in this case, by
the value of train (x2), the manufacture of soldier (x1) will always contribute
Giapetto). Giapetto must decide how many soldiers and trains should be
3x1 dollars to the objective function)
manufactured each week. With this in mind, we define:
o The contribution of a decision variable to LHS of each constraint is
x1 = the number of soldiers produced per week,
independent of the values of other decision variables (No matter what the
x2 = the number of trains produced per week,
value of x1, the manufacture of x2 uses x2 finishing hours and x2 carpentry
Objective function is the function of the decision variables that the decision maker
hours)
wants to maximize (revenue or profit) or minimize (costs). Giapetto can concentrate
1st implication: The value of objective function is the sum of the contributions
on maximizing the total weekly profit (z).
from each decision variables.
Here profit equals to (weekly revenues) – (raw material purchase cost) – (other
2nd implication: LHS of each constraint is the sum of the contributions from
variable costs). Hence Giapetto’s objective function is:
each decision variables.
Maximize z = 3x1 + 2x2
! Divisibility
Constraints show the restrictions on the values of the decision variables. Without
o Each decision variable is allowed to assume fractional values. If we
constraints Giapetto could make a large profit by choosing decision variables to be
actually can not produce a fractional number of decision variables, we use
very large. Here there are three constraints:
IP (It is acceptable to produce 1.69 trains)
Finishing time per week
! Certainty
Carpentry time per week
o Each parameter is known with certainty
Weekly demand for soldiers
Sign restrictions are added if the decision variables can only assume nonnegative
values (Giapetto can not manufacture negative number of soldiers or trains!)
x1 # 40 (Constraint on demand for soldiers) Each football spot costs $100K and is seen by 2M high-income women and 12M
x1, x2 > 0 (Sign restrictions) high-income men. How can Dorian reach 28M high-income women and 24M high-
A value of (x1,x2) is in the feasible region if it satisfies all the constraints and sign income men at the least cost.
restrictions.
Graphically and computationally we see the solution is (x1,x2) = (20,60) at which z = Answer: The decision variables are
Report: The minimum cost of reaching the target audience is $400K, with 4 comedy
spots and 2 football slots. The model is dubious as it does not allow for saturation
after repeated viewings.
Report:
The minimum cost diet incurs a daily cost of 90 cents by eating 3 scoops of chocolate and
drinking 1 bottle of cola (w=90, x2=3, x3=1)
y1 = 50
Report:
Lindo reveals the solution to be (x1, x2, x3, x4) = (40, 40, 40, 25) and (y1, y2, y3, y4) = yt = .95yt-1+xt-1 for t = 2,3,4,5
(0, 10, 35, 0) and the minimum cost of $78450.00 is achieved by the schedule
xt, yt > 0
Q1 Q2 Q3 Q4
Regular time (xt) 40 40 40 25
Overtime (yt) 0 10 35 0
Inventory (it) 10 10 0 0 0
Demand (dt) 40 60 75 25
Graphically,
! In the unique optimal solution case, isoprofit line last hits a point (vertex -
corner) before leaving the feasible region.
! In the alternative optimal solutions case, isoprofit line last hits an entire line
(representing one of the constraints) before leaving the feasible region.
! In the infeasible case, there is no feasible region.
! In the unbounded case, isoprofit line never lose contact with the feasible
region
80 D the late 1940's and since then a number of different versions of the algorithm have
been developed. One of these later versions, called the revised simplex algorithm
G (sometimes known as the "product form of the inverse" simplex algorithm) forms the
basis of most modern computer packages for solving LP's.
Steps
1. Convert the LP to standard form
2. Obtain a basic feasible solution (bfs) from the standard form
F 3. Determine whether the current bfs is optimal. If it is optimal, stop.
4. If the current bfs is not optimal, determine which nonbasic variable should
E A C become a basic variable and which basic variable should become a nonbasic
x1 variable to find a new bfs with a better objective function value
H 40 50 80
5. Go back to Step 3.
Points on the line between points G (20, 60) and F (40, 20) are the alternative
optimal solutions. Thus, for 0<c<1,
Related concepts:
c [20 60] + (1-c) [40 20] = [40-20c 20+40c]
! Standard form: all constraints are equations and all variables are nonnegative
will be optimal
! bfs: any basic solution where all variables are nonnegative
********************************************************************* ! Nonbasic variable: a chosen set of variables where variables equal to 0
Add constraint x2 > 90 (Constraint on demand for trains)
! Basic variable: the remaining variables that satisfy the system of equations at
No feasible region: Infeasible LP
the standard form
*********************************************************************
Only use constraint x2 > 90
Isoprofit line never lose contact with the feasible region: Unbounded LP
current basic variables nonnegative. Thus by R3, x1 can only increase to x1 = 4 R2’’ -2x2 +x3 + 2s2- 4s3 =8 x3 = 8 (R2’’)
when s3 becomes 0. (I.e. look for the least positive of the ratios 48/8 = 6, 20/4
R3’’ x1+1.25x2 - .5s2+1.5s3 =2 x1 = 2 (R3’-.5R2’’)
= 5, 8/2 = 4, 5/0 = '). We say s3 is the leaving variable and R3 is the pivot
equation. R4’’ x2 + s4 = 5 s4 = 5 (R4’)
! Now we must rewrite the system so the values of the basic variables can be The bfs is now x2 = s2 = s3 = 0, x1 = 2, x3 = 8, s1 = 24, s4 = 5 making z = 280.
read off.
Each nonbasic variable has a nonnegative coefficient in row 0
1 -60 -30 -20 0 0 0 0 0 z=0 Second and optimal tableau for the modified problem:
(
8 6 1 1 0 0 0 48 s1 = 48 z x1 x2 x3 s1 s2 s3 s4 RHS BV Ratio
2 1.5 .5 0 0 1 0 8 s3 = 8 0 0 -2 0 1 2 -8 0 24 s1=24 -
0 1 0 0 0 0 1 5 s4 = 5 0 0 -2 1 0 2 -4 0 8 x3=8 -
z x1 x2 x3 s1 s2 s3 s4 RHS BV
Therefore the optimal solution is as follows:
1 0 5 0 0 10 10 0 280 z = 280 z = 280 and for 0 < c < 1
0 -2 0 1 2 -8 0 24 s1 = 24
x1 2 0 2c
0 -2 1 0 2 -4 0 8 x3 = 8 x2 = c 0 + (1–c) 1.6 = 1.6 – 1.6c
0 1 0 0 0 0 1 5 s4 = 5
If all artificial variables are equal to zero in the optimal solution, we have found the
optimal solution to the original problem.
If any artificial variables are positive in the optimal solution, the original problem is
infeasible!!!
! new obj. fn. value = old obj. fn. value + (new RHS – old RHS) × shadow price -2x2 +s1 + 2s2 - 8s3 = 24
for minimization problems
-2x2 +x3 + 2s2 - 4s3 = 8 (1)
! new obj. fn. value = old obj. fn. value – (new RHS – old RHS) × shadow price
x1+1.25x2 - .5s2 + 1.5s3 = 2
For the above example, as the allowable increases in RHS ranges are infinity for x2 +s4 = 5
each constraint, we can increase RHS of them as much as we want. But according to
allowable decreases, RHS of the first constraint can be decreased by 100 and that of
Analysis 1
second constraint by 1.
Suppose available finishing time changes from 20 * 20++, then we have the system:
Lets assume that new RHS value of the first constraint is 60.
As the change is within allowable range, we can use the first equation (max. z' = 60x1' + 30x2' + 20x3'
x2' +s4' = 5
That is z’,x1’,x2’,x3’,x4’,s1’,s2’-+,s3’,s4’ satisfy the original problem, and hence (1) = 280+2,-(5+1.25,)x2-(10-.5,)s2-(10+1.5,)s3
Substituting in:
So the top line in the final system would be:
z’ +5x2’ + 10(s2’-+) + 10s3’ = 280 z'+(5+1.25,)x2+(10-.5,)s2+(10+1.5,)s3 = 280+2,
-2x2’ +s1’ + 2(s2’-+) - 8s3’ = 24 Provided all terms in this row are $- we are still optimal. i.e. -4 #%,%# 20 the current
-2x2’ +x3’ + 2s2’ - 4s3’ = 8 +2+ Thus the current solution is optimal for ,%# 5. But when ,%.%5 or the revenue per table
is increased past $35, it becomes better to produce tables. We say the reduced cost
x1’+1.25x2’ - .5s2’ + 1.5s3’ = 2-.5+
of tables is $5.00.
x2’ +s4’ = 5
For -4 #%+%# 4, the new system maximizes z’. In this range RHS are non-negative.
As + increases, revenue increases by 10+ and. we could pay up to $10 per hr. for
extra finishing labor and still increase revenue. Therefore, the shadow price of
finishing labor is $10 per hr. (This is valid for up to 4 extra hours or 4 fewer hours).
A tabular approach makes it easy to find the dual of an LP. If the primal is a normal 3.4.5 Finding the Dual of a Nonnormal Min Problem
max problem, it can be read across (Table 1); the dual is found by reading down the 1. Fill in Table 1 so that the primal can be read down.
table. 2. After making the following changes, the dual can be read across in the usual
fashion:
a) If the ith primal constraint is a < constraint, the corresponding dual
variable xi must satisfy xi < 0
3.4.6 An Example for Economic Interpretation (Dakota Furniture) In general, a transportation problem is specified by the following information:
Let x1, x2, x3 be the number of desks, tables and chairs produced. Let the weekly ! A set of m supply points form which a good is shipped. Supply point i can
max z = 60x1+30x2+20x3 ! A set of n demand points to which the good is shipped. Demand point j must
s.t. 8x1+ 6x2+ x3 < 48 (Lumber constraint) receive at least dj units of the shipped good.
4x1+ 2x2+1.5x3 < 20 (Finishing hour constraint) ! Each unit produced at supply point i and shipped to demand point j incurs a
2x1+1.5x2+0.5x3 < 8 (Carpentry hour constraint) variable cost of cij.
x1,x2,x3 > 0 The relevant data can be formulated in a transportation tableau:
Demand Demand Demand
..... SUPPLY
point 1 point 2 point n
Dual Supply c11 c12 c1n
s1
Suppose an entrepreneur wants to purchase all of Dakota’s resources. point 1
Supply c21 c22 c2n
In the dual problem y1, y2, y3 are the resource prices (price paid for one board ft of s2
point 2
lumber, one finishing hour, and one carpentry hour).
.....
$w is the cost of purchasing the resources.
Supply cm1 cm2 cmn
Resource prices must be set high enough to induce Dakota to sell. i.e. total sm
point m
purchasing cost equals total profit. DEMAND d1 d2 dn
min w = 48y1+ 20y2+ 8y3
s.t. 8y1+ 4y2+ 2y3 > 60 (Desk constraint) If total supply equals total demand then the problem is said to be a balanced
xij > 0
If a problem has the constraints given above and is a maximization problem, it is still Representation of the problem as a LP model
a transportation problem. xij: number of (million) kwh produced at plant i and sent to city j.
min z = 8 x11 + 6 x12 + 10 x13 + 9 x14 + 9 x21 + 12 x22 + 13 x23 + 7 x24 + 14
4.1.2 Powerco Example for Balanced Transportation Problem x31 + 9 x32 + 16 x33 + 5 x34
Powerco has three electric power plants that supply the needs of four cities. Each s.t. x11 + x12 + x13 + x14 < 35 (supply constraints)
power plant can supply the following numbers of kwh of electricity: plant 1, 35 million; x21 + x22 + x23 + x24 < 50
plant 2, 50 million; and plant 3, 40 million. The peak power demands in these cities x31 + x32 + x33 + x34 < 40
as follows (in kwh): city 1, 45 million; city 2, 20 million; city 3, 30 million; city 4, 30 x11 + x21 + x31 > 45 (demand constraints)
million. The costs of sending 1 million kwh of electricity from plant to city is given in x12 + x22 + x32 > 20
the table below. To minimize the cost of meeting each city’s peak power demand, x13 + x23 + x33 > 30
formulate a balanced transportation problem in a transportation tableau and x14 + x24 + x34 > 30
To
From City 1 City 2 City 3 City 4 4.1.3 Balancing an Unbalanced Transportation Problem
Plant 1 $8 $6 $10 $9
Plant 2 $9 $12 $13 $7
Plant 3 $14 $9 $16 $5 Excess Supply
If total supply exceeds total demand, we can balance a transportation problem by
creating a dummy demand point that has a demand equal to the amount of excess
supply.
Since shipments to the dummy demand point are not real shipments, they are
assigned a cost of zero.
These shipments indicate unused supply capacity.
To balance the problem, we would add a dummy demand point with a demand of 125 Dummy 80 80 80 80
5
(Shortage)
– 120 = 5 million kwh.
DEMAND 50 20 30 30 130
From each plant, the cost of shipping 1 million kwh to the dummy is 0.
For details see Table 4.
Table 4. Transportation Tableau for Excess Supply
City 1 City 2 City 3 City 4 Dummy SUPPLY
8 6 10 9 0
Plant 1 35
9 12 13 7 0
Plant 2 50
14 9 16 5 0
Plant 3 40
DEMAND 40 20 30 30 5 125
min /i%/j cij xij ! If x11=s1, cross out the first row of the tableau. Also change d1 to d1-s1.
! If x11=d1, cross out the first column of the tableau. Change s1 to s1-d1.
s.t. /j xij = si (i=1,2, ..., m) Supply constraints
! If x11=s1=d1, cross out either row 1 or column 1 (but not both!).
/i xij = dj (j=1,2, ..., n) Demand constraints o If you cross out row, change d1 to 0.
xij > 0 o If you cross out column, change s1 to 0.
To find a bfs to a balanced transportation problem, we need to make the following Continue applying this procedure to the most northwest cell in the tableau that does
important observation: not lie in a crossed out row or column.
If a set of values for the xij’s satisfies all but one of the constraints of a balanced Eventually, you will come to a point where there is only one cell that can be assigned
transportation problem, the values for the xij’s will automatically satisfy the other a value. Assign this cell a value equal to its row or column demand, and cross out
constraint. both the cell’s row or column.
This observation shows that when we solve a balanced transportation, we may omit A bfs has now been obtained.
from consideration any one of the problem’s constraints and solve an LP having
m+n-1 constraints. We arbitrarily assume that the first supply constraint is omitted Example:
from consideration. For example consider a balanced transportation problem given below (We omit the
In trying to find a bfs to the remaining m+n-1 constraints, you might think that any costs because they are not needed to find a bfs!).
collection of m+n-1 variables would yield a basic solution. But this is not the case: 5
If the m+n-1 variables yield a basic solution, the cells corresponding to a set of m+n-
1
1 variables contain no loop.
3
An ordered sequence of at least four different cells is called a loop if
! Any two consecutives cells lie in either the same row or same column 2 4 2 1
! No three consecutive cells lie in the same row or column Total demand equals total supply (9): this is a balanced transport’n problem.
! The last cell in the sequence has a row or column in common with the first cell
2 3
in the sequence
1
There are three methods that can be used to find a bfs for a balanced transportation
problem: 3
1. Northwest Corner method X 4 2 1
2. Minimum cost method
3. Vogel’s method
X 0 2 1 12 8 4 6
NWC method assigned values to m+n-1 (3+4-1 = 6) variables. The variables chosen 2 3 5 6
5
by NWC method can not form a loop, so a bfs is obtained.
2 1 3 5
2
8
3 8 4 6
15
12 X 4 6
2 3 5 6
5
2 1 3 5
X
2 8
3 8 4 6
15
10 X 4 6
Row
Supply
penalty
6 7 8
10 7-6=1
15 80 78
15 78-15=63
Demand 15 5 5
Column
15-6=9 80-7=73 78-8=70
penalty
Row
Supply
penalty
6 7 8
5 8-6=2
5
15 80 78
15 78-15=63
Demand 15 X 5
Column
15-6=9 - 78-8=70
penalty
Pivoting procedure
1. Find the loop (there is only one possible loop!) involving the entering variable
(determined at step 4 of the transport’n simplex method) and some of the basic
variables.
2. Counting only cells in the loop, label those that are an even number (0, 2, 4, and
so on) of cells away from the entering variable as even cells. Also label those that
are an odd number of cells away from the entering variable as odd cells.
3. Find the odd cell whose variable assumes the smallest value. Call this value 0.
The variable corresponding to this odd cell will leave the basis. To perform the
pivot, decrease the value of each odd cell by 0 and increase the value of each
even cell by 0. The values of variables not in the loop remain unchanged. The
pivot is now complete. If 0 = 0, the entering variable will equal 0, and odd variable
that has a current value of 0 will leave the basis.
u1 = 0 Since !12 is the most positive one, we would next enter x12 into the basis.
!24 = 1 + 1 – 7 = -5 8 6 10 9
0 35
25 10
!31 = 4 + 8 – 14 = -2 9 12 13 7
1 50
!32 = 4 + 11 – 9 = 6 20 30
14 9 16 5
Since !32 is the most positive one, we would next enter x32 into the basis: Each unit of 3 40
10% % 30
x32 that is entered into the basis will decrease Powerco’s cost by $6. DEMAND 45 20 30 30 125
The loop involving x32 is (3,2)-(3,3)-(2,3)-(2,2). 0 = 10 (see table)
!13 = 2, !14 = -7, !22 = -5, !24 = -4, !31 = -3, !33 = -1
City 1 City 2 City 3 City 4 SUPPLY
8 6 10 9
Plant 1 35
35 Since !13 is the most positive one, we would next enter x13 into the basis.
9 12 13 7
Plant 2 50
10 20–0 20+0
14 9 16 5
Plant 3 40
0% 10–0% 30
DEMAND 45 20 30 30 125
ui/vj 6 6 10 2 SUPPLY
Remark
8 6 10 9
0 35 As stated in “Formulating Transportation Problems”, we define a supply point to be
10 25
9 12 13 7 a point that can send goods to another point but cannot receive goods from any other
3 50
45 5
14 9 16 5 point.
3 40
10% % 30 Similarly, a demand point is a point that can receive goods from other points but
DEMAND 45 20 30 30 125 cannot send goods to any other point.
!11 = -2, !14 = -7, !22 = -3, !24 = -2, !31 = -5, !33 = -3
4.4.1 Steps
Since all !ij’s are negative, an optimal solution has been obtained. 1. If the problem is unbalanced, balance it
Let s = total available supply (or demand) for balanced problem
Report 2. Construct a transportation tableau as follows
45 million kwh of electricity would be sent from plant 2 to city 1. A row in the tableau will be needed for each supply point and transshipment point
10 million kwh of electricity would be sent from plant 1 to city 2. Similarly, 10 million A column will be needed for each demand point and transshipment point
kwh of electricity would be sent from plant 3 to city 2. Each supply point will have a supply equal to its original supply
25 million kwh of electricity would be sent from plant 1 to city 3. 5 million kwh of Each demand point will have a demand equal to its original demand
electricity would be sent from plant 2 to city 3. Each transshipment point will have a supply equal to “that point’s original supply +
30 million kwh of electricity would be sent from plant 3 to city 4 and s”
Total shipping cost is: Each transshipment point will have a demand equal to “that point’s original
z = .9 (45) + 6 (10) + 9 (10) + 10 (25) + 13 (5) + 5 (30) = $ 1020 demand + s”
3. Solve the transportation problem
In this problem Ankara and Eskisehir are transshipment points. Demand 350 350 130 130 90 1050
min /i%/j cij xij 4. Construct a new matrix (reduced cost matrix) by subtracting from each cost the
minimum cost in its column
s.t. /j xij = 1 (i=1,2, ..., m) Supply constraints
5. Draw the minimum number of lines (horizontal and/or vertical) that are needed to
/i xij = 1 (j=1,2, ..., n) Demand constraints cover all the zeros in the reduced cost matrix. If m lines are required, an optimal
xij = 0 or xij = 1 solution is available among the covered zeros in the matrix. If fewer than m lines
are needed, proceed to next step
4.5.2 Hungarian Method 6. Find the smallest nonzero cost (k) in the reduced cost matrix that is uncovered by
Since all the supplies and demands for any assignment problem are integers, all the lines drawn in Step 5
variables in optimal solution of the problem must be integers. Since the RHS of each 7. Subtract k from each uncovered element of the reduced cost matrix and add k to
constraint is equal to 1, each xij must be a nonnegative integer that is no larger than each element that is covered by two lines. Return to Step 5
Answer:
Report:
Step 1. For each row in Table 1, we find the minimum cost: 2, 2, 3, and 5
CP Selçuk should fly with FO Tuncay; CP Serkan should fly with FO Kemal; CP Ümit
respectively
should fly with FO Servet; and CP Volkan should fly with FO Önder.
Step 2 & 3. We subtract the row minimum from each cost in the row obtaining Table
2. For this new matrix, we find the minimum cost in each column
Table 2. Cost matrix after row minimums are subtracted
0 2 4 8
0 10 4 3
4 5 0 6
9 0 3 2
Column minimum 0 0 0 2
Step 4. We now subtract the column minimum from each cost in the column
obtaining reduced cost matrix in Table 3.
Table 3. Reduced cost matrix
0 2 4 6
0 10 4 1
4 5 0 4
9 0 3 0
Step 5. As shown in Table 4, lines through row 3, row 4, and column 1 cover all the
zeros in the reduced cost matrix. The minimum number of lines for this operation is 3.
Since fewer than four lines are required to cover all the zeros, solution is not optimal:
we proceed to next step.
Answer
Let xj be number of clothing produced.
Let yj be 1 if any clothing j is manufactured and 0 otherwise.
Since supply of labor and cloth is limited, Gandhi faces two constraints.
Answer
First we must calculate the losses due to lost interest for each possible assignment.
For example, if the West sends to New York, then on average there will be $560,000
(= 8 * $70.000) in process on any given day. Assuming an investment rate of 20%,
this corresponds to a yearly loss of $112,000. We can calculate the losses for the
other possibilities in a similar fashion to get the following table.
LA Chicago NY Atlanta
West 28 84 112 112
Midwest 60 20 50 50
East 96 60 24 60
South 64 40 40 16
A fire station can be placed in any city. It is able to handle the fires for both its city
and any adjacent city (any city with a non-zero border with its home city). The The first constraint states that there must be a station either in city 1 or in some
objective is to minimize the number of fire stations used. adjacent city. Notice that the constraint coefficient aij is 1 if city i is adjacent to city j or
if i=j and 0 otherwise.
The jth column of the constraint matrix represents the set of cities that can be served
by a fire station in city j. We are asked to find a set of such subsets j that covers the
set of all cities in the sense that every city appears in the service subset associated
with at least one fire station
Adding the two constraints (1’) and (2’) to the formulation will ensure our aim: To ensure this, we include the following constraints in the formulation:
f (x1, x2,…, xn) < M y (1’) – g(x1, x2,…, xn) < M y (1)
g (x1, x2,…, xn) < M ( 1 – y ) (2’) f(x1, x2,…, xn) < M ( 1 – y ) (2)
Here y is a 0-1 variable, and M is a number chosen large enough to ensure that f (x1, Here y is a 0-1 variable, and M is a large positive number.
x2,…, xn) < M and g (x1, x2,…, xn) < M are satisfied for all values of xj’s that satisfy the M must be chosen large enough so that – g < M and f < M hold for all values of xj’s
other constraints in the problem. that satisfy the other constraints in the problem.
Suppose y = 0, then (1) and possibly (2) must be satisfied. Observe that if f > 0, then (2) can be satisfied only if y = 0. (1) implies – g < 0 or g >
If y = 1, then (2) and possibly (1) must be satisfied. 0, which is the desired result.
Example Example
Suppose 1.5 tons of steel and 30 hours of labor are required for production of one For the lockbox problem, suppose we add the following constraint: If customers in
compact car. At present, 6.000 tons of steel and 60.000 hours of labor are available. region 1 send their payments to city 1, no other customers may send their payments
For an economically feasible production, at least 1000 cars of compact car must be to city 1. Mathematically,
produced. If x11 = 1, then x21 = x31 = x 41 = 0
Constraint: x1 < 0 or x1 > 1000 Since all variables are 0-1, we may write this implication as:
[f (x1, x2,…, xn) = x1; g (x1, x2,…, xn) = 1000 – x1] If x11 > 0, then x21 + x31 + x 41 < 0 (or – x21 – x31 – x 41 > 0)
Sign restriction: x1 > 0 and integer
If we define f = x11 and g = – x21 – x31 – x 41 we can use (1) and (2) to express the
We can replace this constraint by the following pair of linear constraints: implication by the following two constraints:
x1 < M1 y1 x21 + x31 + x 41 < My
1000 – x1 < M1 (1 – y1) x11 < M (1 – y)
y1 = 0 or 1 y = 0 or 1
M1 = min (6.000/1.5, 60.000/30) = 2000 Since –g and f can never exceed 3, we can choose M as 3.
5.2.3.1 Example
Consider our example multi-period capital budgeting problem:
Maximize 0.2 x1 + 0.3 x2 + 0.5 x3 + 0.1 x4
Subject to 0.5 x1 + 1 x2 + 1.5 x3 + 0.1 x4 < 3.1
0.3 x1 + 0.8 x2 + 1.5 x3 + 0.4 x4 < 2.5
0.2 x1 + 0.2 x2 + 0.3 x3 + 0.1 x4 < 0.4
xj = 0 or 1 j = 1, … 4 We now have two new LP relaxations to solve. If we do this we get:
What made this problem difficult was the fact that the variables were restricted to be P1 solution is x1=0.5, x3=1, x2=x4=0 of value 0.6
integers (zero or one). P2 solution is x2=1, x3=0.67, x1=x4=0 of value 0.63
If the variables had been allowed to be fractional (takes all values between zero and This can be represented diagrammatically as below.
one for example) then we would have had an LP which we could easily solve.
Suppose that we were to solve this LP relaxation of the problem [replace xj = 0 or 1
j=1,...,4 by 0 <= xj <= 1 j=1,...,4]. Then using any LP package we get x2=0.5, x3=1,
x1=x4=0 of value 0.65 (i.e. the objective function value of the optimal linear
programming solution is 0.65).
As a result of this we now know something about the optimal integer solution, namely
that it is <= 0.65, i.e. this value of 0.65 is an upper bound on the optimal integer
solution. To find the optimal integer solution we just repeat the process, choosing one of these
This is because when we relax the integrality constraint we (as we are maximizing) two problems, choosing one fractional variable and generating two new problems to
end up with a solution value at least that of the optimal integer solution (and maybe solve.
better).
At this stage we have identified an integer feasible solution of value 0.6 at P3. There
are no fractional variables so no branching is necessary and P3 can be dropped from
our list of LP relaxations.
Note here that this method, like complete enumeration, also involves powers of two
Hence we now have new information about our optimal (best) integer solution,
as we progress down the (binary) tree. However also note that we did not enumerate
namely that it lies between 0.6 and 0.65 (inclusive).
all possible integer solutions (of which there are 16). Instead here we solved 7 LP's.
Consider P4, it has value 0.53 and has a fractional variable (x3). However if we were
This is an important point, and indeed why tree search works at all. We do not need
to branch on x3 any objective function solution values we get after branching can
to examine as many LP's as there are possible solutions. While the computational
never be better (higher) than 0.53. As we already have an integer feasible solution of
efficiency of tree search differs for different problems it is this basic fact that enables
value 0.6, P4 can be dropped from our list of LP relaxations since branching from it
us to solve problems that would be completely beyond us were we to try complete
could never find an improved feasible solution. This is known as bounding - using a
enumeration.
known feasible solution (as a lower bound) to identify that some relaxations are not
of any interest and can be discarded.
Hence we are just left with:
P2 solution x2=1, x3=0.67, x1=x4=0 of value 0.63
NO. ITERATIONS= 15
BRANCHES= 3 DETERM.= 1.000E 0