You are on page 1of 40

Introduction to Operations Research

prof. dr. K.J. Roodbergen

Introduction to Operations Research

Lecture 2A

Introduction to Operations Research () Lecture 2A 1 / 40


Contents

1 Taha Chapter 5
Transportation problem
Assignment problem
2 Compulsory material that is not in book:
Some modeling issues
Facility layout problem
Note
The slides contain some information that the book does not.
The book contains some information that the slides do not.
The union of both sets needs to be studied for the exam.

Introduction to Operations Research () Lecture 2A 2 / 40


Transportation problem
Sections 5.1-5.3

Introduction to Operations Research () Lecture 2A 3 / 40


Transportation problem

Introduction to Operations Research () Lecture 2A 4 / 40


Transportation problem

Introduction to Operations Research () Lecture 2A 5 / 40


Description

Given
m facilities that supply a product
n customers with demand for the product
set of distances between facilities and customers
More formally
we have sources i = 1, ..., m with supply si
we have destinations j = 1, ..., n with demand dj
we have cost cij for transporting a unit from i to j
Requirement:
m n
∑ si = ∑ dj
i =1 j =1

Introduction to Operations Research () Lecture 2A 6 / 40


Model

Decision variable: xij , the amount shipped from source i to


destination j
m n
min Z = ∑ ∑ cij xij
i =1 j =1
s.t.
n
∑ xij = si for i = 1, 2, ..., m
j =1
m
∑ xij = dj for j = 1, 2, ..., n
i =1
xij 0 for all i, j

m n
Note that it is implicitly assumed that ∑ si = ∑ dj holds!
i =1 j =1

Introduction to Operations Research () Lecture 2A 7 / 40


Dummy destination or source
If requirement ∑m n
i =1 si = ∑j =1 dj not met, then introduce dummy
destination or source.
Example
A machine manufacturer has closed several contracts to install respectively
10, 15, 25, 20 machines in the upcoming four months. Machines may be
produced in the month of delivery or in an earlier month. Production
capacity per month is limited and costs of production vary. Formulate this
problem as a transportation problem.

Introduction to Operations Research () Lecture 2A 8 / 40


Dummy destination or source

xij number of machines produced in month i for installation in month


j
cij cost associated with each unit of xij
production + storage costs, if i j
cij =
??????, if i > j
i > j implies an impossible relation (i.e., produce the machine only
after it has been installed), thus
We want xij to be 0 if i > j.
Solution: use big-M. Speci…cally, set cij = M if i > j.

Introduction to Operations Research () Lecture 2A 9 / 40


Dummy destination or source

Destination j: installation of machines in month j (j = 1, 2, 3, 4)


dj = number of installations in month j.
Source i: production of machines in month i (i = 1, 2, 3, 4)
si = ? (this is what we must determine!)
Trick: simply set si equal to the maximum possible production.
In the …nal solution we can see what the actual production is by
checking which part of production goes to the destinations.
But, where does the rest (i.e. the "non-existing" production) go to?
To a dummy destination, with demand d5
4 4
d5 = ∑ si ∑ dj
i =1 i =1

Introduction to Operations Research () Lecture 2A 10 / 40


Dummy destination or source

In Simplex terms the dummy destination, with demand d5 gives us


slack variables!
We had x11 + x12 + x13 + x14 25
(that is, total production in month 1 for the upcoming four months
has to be less than or equal to the maximum production capacity of
25)
Now we get x11 + x12 + x13 + x14 + x15 = 25
The di¤erence between actual production (x11 + x12 + x13 + x14 ) and
maximum production (25) goes to slack variable x15 .
Same holds for the other constraints.
Cost associated with the dummy ci 5 = 0 for i = 1, 2, 3, 4

Introduction to Operations Research () Lecture 2A 11 / 40


Dummy destination or source

Overview of structure for Transportation Problem formulation

Introduction to Operations Research () Lecture 2A 12 / 40


Transportation Simplex Method

Introduction to Operations Research () Lecture 2A 13 / 40


Notation

The model as we already know it:

m n
min Z = ∑ ∑ cij xij
i =1 j =1
s.t.
n
∑ xij = si for i = 1, 2, ..., m
j =1
m
∑ xij = dj for j = 1, 2, ..., n
i =1
xij 0 for all i, j

Introduction to Operations Research () Lecture 2A 14 / 40


Notation

min c11 x11 +c12 x12 + +c1n x1n +c21 x21 + +c2n x2n + +cm1 xm1 +cm2 xm2 + +cmn xmn

s.t.

x11 +x12 +x1n = s1


x21 +x22 ... +x2n = s2
.. ..
. .
xm 1,1 +xm 1,2 +xm 1,n = sm 1
xm1 +xm2 +xmn = sm

x11 +x21 +xm 1,1 +xm1 = d1


x12 +x22 +xm 1,2 +xm2 = d2
.. .. .. .. .. ..
. . . . . .
x1n +x2n +xm 1,n +xmn = dn

xij 0, for all i, j

Introduction to Operations Research () Lecture 2A 15 / 40


Dual model

Create dual, but with specially de…ned dual variables.


Each column gets two variables, ui for row i and vj for row m + j.
So dual now becomes:

m n
max W = ∑ si ui + ∑ dj vj
i =1 j =1
s.t.
ui + vj cij for i = 1, 2, ..., m, j = 1, 2, ..., n
ui , vj unrestricted

Thus the values of the slack variables of the dual are given by
ui + vj cij .

Introduction to Operations Research () Lecture 2A 16 / 40


Transportation Simplex Method

The dual slack variables form (part of) the top row of the Simplex
tableau.
We could use the Simplex method to determine the dual slack
variables. But, it can be done faster here.
Each (primal) basic variable xij should have a zero entry in the top
row after each iteration. So at that point, we have that cij = ui + vj
must hold for all basic xij (compare to book page 226).
We can solve this set of m + n equations with m + n unknown, to get
ui and vj .
Note: actually we only have m + n 1 equations (why?), so we can
freely choose one variable.
Next, when you have ui and vj , you can calculate ui + vj cij for all
nonbasic xij and …nd out which is the largest positive number, which
will identify the entering basic variable.

Introduction to Operations Research () Lecture 2A 17 / 40


Transportation Simplex Method

Note that since the primal is a "min" problem and the dual a "max"
problem, a number things reverse compared to the standard theory
outlined in previous lectures.
We are now looking for the largest positive number in the top row
instead of the smallest negative number.
The Dual now has slack variables instead of surplus variables.

Introduction to Operations Research () Lecture 2A 18 / 40


Assignment problem
Section 5.4

Introduction to Operations Research () Lecture 2A 19 / 40


Description

Given
A number of tasks that must be performed
A number of employees that can do the tasks
Cost to complete a task (di¤ers per employee-task combination)
Goal
Find unique employee-task pairs for all tasks and all employees, such
that costs are minimized.

Introduction to Operations Research () Lecture 2A 20 / 40


Graphical representation

Introduction to Operations Research () Lecture 2A 21 / 40


Model

Cost cij for employee i doing task j (i = 1, 2, ...n, j = 1, 2, ..., n)


1 if employee i does task j
Variables xij =
0 if not
Model
n n
min Z = ∑ ∑ cij xij
i =1 j =1
s.t.
n
∑ xij = 1 for i = 1, 2, ..., n
j =1
n
∑ xij = 1 for j = 1, 2, ..., n
i =1
xij 0 for all i and j
xij 2 f0, 1g

Introduction to Operations Research () Lecture 2A 22 / 40


Compare to transportation problem

m=n
si = 1 for all i
dj = 1 for all j
Similarly, if not balanced, add dummies (can be plural this time!)

Introduction to Operations Research () Lecture 2A 23 / 40


Some modeling issues
Not in book

Introduction to Operations Research () Lecture 2A 24 / 40


Either-or constraints / If-Then constraints

Either f1 (x ) b1 Or f2 (x ) b2 must hold


Model as:
f1 (x ) b1 + Mz
f2 (x ) b2 + M (1 z )
z 2 f0, 1g, M large

If f (x ) > 0, Then g (x ) 0
Equivalent to: If f (x ) > 0, Then z = 1, and, If z = 1, Then
g (x ) 0
Model as:
f (x ) Mz
g (x ) M (1 z )
z 2 f0, 1g, M large

Introduction to Operations Research () Lecture 2A 25 / 40


K out of N constraints

From the following N constraints K must hold


f1 (x ) b1
f2 (x ) b2
...
fN (x ) bN

Model as:
f1 (x ) b1 + Mz1
f2 (x ) b2 + Mz2
...
fN (x ) bN + MzN
∑N i =1 zi = N K
zi 2 f0, 1g, M large

Introduction to Operations Research () Lecture 2A 26 / 40


Absolute value: objective
Any real number can be expressed as the di¤erence of two
nonnegative numbers
xj = xj+ xj , for xj+ 0, xj 0
+
(add xj , xj to the nonnegativity constraints)
Then jxj j = jxj+ xj j = xj+ + xj ,
The above is only true, if we somehow can force xj+ xj = 0 to hold.
If the sum (not the di¤erence) appears in the objective function,
then under minimization, the optimal value of at least one of the
two parts will be equal to zero.
Example
min x1 + 5jx2 j + 3x3
min x1 + 5(x2+ + x2 ) + 3x3
If the optimal value of x2 is negative, then x2+ will be equal to zero.
If the optimal value of x2 is positive, then x2 will be equal to zero.
Note: this does not hold for maximization problems.
That would create an unbounded objective function (why?)
Introduction to Operations Research () Lecture 2A 27 / 40
Absolute value: constraint

Distinguish four cases (for b 0):


case 1: jf (x )j b
case 2: jf (x )j b
case 3: jf (x )j b
case 4: jf (x )j b
Note that case 3 is always infeasible, and case 4 is always true (so
redundant). We therefore only focus on cases 1 and 2.
Case 1: jf (x )j b
Rewrite as:
f (x ) b
f (x ) b

Introduction to Operations Research () Lecture 2A 28 / 40


Absolute value: constraint

Case 2: jf (x )j b
This can be restated as:
Either f (x ) b
Or f (x ) b
(obviously not both)
Which we can write as:
f (x ) + Mz b
f (x ) + M (1 z ) b
z 2 f0, 1g, M large

Introduction to Operations Research () Lecture 2A 29 / 40


Absolute value: constraint

How about: jf1 (x )j + jf2 (x )j b


If simply doing the same as before, then f1 (x ) and f2 (x ) might cancel
each other out.
Write as:
f1 ( x ) + f2 ( x ) b
f1 ( x ) f2 ( x ) b
f1 ( x ) f2 ( x ) b
f1 ( x ) + f2 ( x ) b
These constraints are "active" respectively if:
f1 ( x ) 0, f2 (x ) 0
f1 ( x ) 0, f2 (x ) 0
f1 ( x ) 0, f2 (x ) 0
f1 ( x ) 0, f2 (x ) 0

Introduction to Operations Research () Lecture 2A 30 / 40


Max min objective function

max minff1 (x ), ..., fk (x )g


x
Replace the min{ } by a new decision variable, say t.
Use the new variable as a lower bound for all the terms in min { . . . }

max t
s.t.
f1 ( x ) t
f2 ( x ) t
..
.
fk ( x ) t

At an optimum, at least one new constraint must be binding (why?).

Introduction to Operations Research () Lecture 2A 31 / 40


Min max objective function

min maxff1 (x ), ..., fk (x )g


x
Used for example to minimize makespan of production lines
Replace the max{ } by a new decision variable, say t.
Use the new variable as an upper bound for all the terms in max { . . . }

min t
s.t.
f1 ( x ) t
f2 ( x ) t
..
.
fk ( x ) t

Introduction to Operations Research () Lecture 2A 32 / 40


Facility Layout Model

We have a factory or warehouse, for example.


There are several departments that must be arranged with respect to
each other.
Product ‡ows occur between departments.
Size and shape of each department is given.
Find the arrangment for the deparments such that product ‡ow is
minimized.
Let’s focus on arranging departments on a line …rst.

Introduction to Operations Research () Lecture 2A 33 / 40


Variables and parameters

Parameters:
n number of departments in the problem

cost of moving an unit load by an unit distance


cij
between departments i and j

fij number of unit loads between departments i and j

`i length of the horizontal side of department i

minimum distance by which departments i and j


dij
are to be separated horizontally

Decision Variable:
distance between center of department i and
xi
vertical reference line (VRL)

Introduction to Operations Research () Lecture 2A 34 / 40


Picture of Single row facility layout

Introduction to Operations Research () Lecture 2A 35 / 40


Base model (not linear)

n 1 n
min Z = ∑ ∑ cij fij jxi xj j
i =1 j =i +1
s.t.
1
jxi xj j 2 (`i
+ `j ) + dij for i = 1, 2, ..., n 1, j = i + 1, ..., n
xi 0 for i = 1, 2, ..., n

Introduction to Operations Research () Lecture 2A 36 / 40


Linearizing the objective function

n 1 n
min Z = ∑ ∑ cij fij jxi xj j
i =1 j =i +1
Perform replacement xi xj = xij .
Then jxi xj j = jxij j.
We know how to addres that:
jxij j = jxij+ xij j = xij+ + xij with xij+ 0, xij 0
This is usable provided xij+ xij = 0, (which is true since it is a
minimization problem).
n 1 n
min Z = ∑ ∑ cij fij (xij+ + xij )
i =1 j =i +1

Introduction to Operations Research () Lecture 2A 37 / 40


Linearizing the objective function

However, we cannot simply stop here, because we now have lost the
connection to the original xi and xj we have in the constraints:
jxi xj j 12 (`i + `j ) + dij
Total reformulation
n 1 n
min Z = ∑ ∑ cij fij (xij+ + xij )
i =1 j =i +1
s.t.
jxi xj j 12 (`i + `j ) + dij
xi xj = xij+ xij
xi 0 for i = 1, 2, ..., n
+
xij , xij 0 for i = 1, 2, ..., n 1, j = i + 1, ..., n

Introduction to Operations Research () Lecture 2A 38 / 40


Linearizing the constraints

jxi xj j 12 (`i + `j ) + dij


Can be written as:
Either xi xj 1 (` + ` ) + d
2 i j ij
Or xj xi 1 (` + ` ) + d
2 i j ij

This results in two new constraints:


xi xj + Mzij 1 (` + `j ) + dij
2 i
xj xi + M (1 zij ) 1
2 (`i + `j ) + dij
zij 2 f0, 1g
Note that there are quite a lot of these pairs of constraints
(i = 1, 2, ..., n 1, j = i + 1, ..., n). Hence there is not just one z,
but a lot of them.

Introduction to Operations Research () Lecture 2A 39 / 40


Final mixed integer linear programming model

n 1 n
min Z = ∑ ∑ cij fij (xij+ + xij )
i =1 j =i +1
s.t.
1
xi xj + Mzij 2 (`i + `j ) + dij i = 1, 2, ..., n 1, j = i + 1, ..., n
1
xj xi + M (1 zij ) 2 (`i + `j ) + dij i = 1, 2, ..., n 1, j = i + 1, ..., n
+
xi xj = xij xij i = 1, 2, ..., n 1, j = i + 1, ..., n
xi 0 i = 1, 2, ..., n
xij+ , xij 0 i = 1, 2, ..., n 1, j = i + 1, ..., n
zij 2 f0, 1g i = 1, 2, ..., n 1, j = i + 1, ..., n

Introduction to Operations Research () Lecture 2A 40 / 40

You might also like