Transportation and Assignment Problems

68 downloads 157 Views 767KB Size Report
Systems Analysis. 104. Dr. Emad Elbeltagi. 4.1.3 Solving the Transportation Problem Using Vogel's Approximation Method. General procedure for constructing ...
CHAPTER 4 THE TRANSPORTATION AND ASSIGNMENT PROBLEMS

In this chapter, we will discuss the transportation and assignment problems which are two special kinds of linear programming. The transportation problem deals with transporting goods from their sources to their destinations. The assignment problem, on the other hand, deals with assigning people or machines to jobs.

4.1 The Transportation Problem Example 4.1 Consider the following snow removal problem: there are a number of districts in a city. After a snowfall, the snow in each area must be moved out of the district into a convenient location. In a city, these locations are large grates (leading to the sewer system), a couple large pits, and a couple entry points to the river. Each of these destinations has a capacity. The goal is to minimize the distance traveled to handle all of the snow.

This problem is an example of a transportation problem. In such a problem, there are a set of nodes called sources (4 sources where snow is collected), and a set of nodes called destinations (3 destinations where snow will be transported). All arcs go from a source to a destination. There is a per unit cost on each arc (the cost of transporting one unit from a source to a destination). Each source has a supply of material, and each destination has a demand. We assume that the total supply equals the total demand (possibly adding a fake source or destination as needed). For the snow removal problem, the network might look like that in Fig. 4.1.

Operations Research

91

Dr. Emad Elbeltagi

Transportation problems are often used in transportation planning. For instance, in an application where goods are at a warehouse, one problem might be to assign customers to a warehouse so as to meet their demands. In such a case, the warehouses are the sources, the customers are the destinations, and the costs represent the per unit transportation costs.

Demand

Supply 2

(1000) S1

d1 (3000)

3

10 3

(2000) S2

2 2 4

d2 (2000) 7

(2500) S3 9

(1500) S4

1

d3 (2000)

7

5

Destinations

Sources

Figure 4.1: Snow transportation network

Example 4.2 One of the main products of Qaha Company is canned peas. The peas are prepared at three canneries (Qaha, Benha, and Tanta) and are then shipped by trucks to four distributing warehouses in Cairo, Alexandria, Portsaid, and Aswan. Because shipping costs are a major expense, management has begun a study to reduce them. For the upcoming season, an estimate has been made of what the output will be from each cannery, and how much each warehouse will require to satisfy its customers. The shipping costs from each cannery to each warehouse have also been determined. This is summarized in Table 4.1 and Fig. 4.2. Formulate this transportation problem as a linear programming problem by defining the variables, the objective and the constraints. Operations Research

92

Dr. Emad Elbeltagi

Table 4.1: Shipping data for example 4.2 Warehouse Shipping cost per truck load

Cannery

Supply

1

2

3

4

1

464

513

654

867

75

2

352

416

690

791

125

3

995

682

388

685

100

80

65

70

85

Demand

Supply

Demand d1 (80) 464

(75) S1

(125) S2

(100) S3

513 654

867 352 416 690 791

d2 (65)

959 682

d3 (70) 388

685

d4 (85) Source

Destination

Figure 4.2: Network representation of example 4.2

You should find it an easy exercise to model this as a linear program. If we let xij be the number of truckloads shipped from cannery i to warehouse j, the problem is to:

minimize Z = 464x11 + 513x12 + 654x13 + 867x14 + 352x21 + 416x22 + 690x23 + 791x24 + 995x31 + 682x32 + 388x33 + 685x34 subject to x11 + x12 + x13 + x14 = 75 Operations Research

93

Dr. Emad Elbeltagi

x21 + x22 + x23 + x24 = 125 x31 + x32 + x33 + x34 = 100 x11 + x21 + x31 = 80 x12 + x22 + x32 = 65 x13 + x23 + x33 = 70 x14 + x24 + x34 = 85 xij ≥ 0 for all i and j. This is an example of the transportation model. As has been pointed out, this problem has a specific structure. All the coefficients of the variables in the constraint equations are 1 and every variable appears in exactly two constraints. All constraint equations are formed using the equal sign not the ≥ or the ≤ signs. This is the special structure that distinguishes this problem as a transportation problem.

4.1.1

The Transportation Problem Model

In general, the transportation model is concerned with distributing (literally or figuratively) a commodity from a group of supply centers, called sources to a group of receiving centers, called destinations to minimize total cost. In general, source i (i = 1, 2, 3, ….., m) has a supply of si units, and destination j (j = 1, 2, 3, ……, n) has a demand for dj units. The cost of distributing items from a source to a destination is proportional to the number of units. This data can be conveniently represented in a table like that for the sample problem of example 4.2. Each source has a fixed supply of units, si, where the entire supply must be distributed to the destinations. Each destination has a fixed demand for units, dj, and the entire demand must be received from the sources. The cost of distributing units from any particular source i to any particular destination j, cij, is directly proportional to the number of units distributed, xij, (i = 1, 2, ….., m; j = 1, 2, …., n) from source i to destination j.

Any transportation model can be described completely by a parameter table as given in Table 4.2. In transportation problems every si and dj has integer values and also all other variables. Operations Research

94

Dr. Emad Elbeltagi

Table 4.2: Transportation problem representation Cost per distributed unit Destination

Source

Supply

1

2



n

1

c11

c12



c1n

s1

2

c21

c22



c2n

s2

:

:

:

:

:

m

cm1

cm2



cmn

sm

d1

d2



dn

Demand

A typical transportation problem is shown in Table 4.2, using a matrix with the rows representing sources and columns representing destinations. The algorithms for solving the problem are based on this matrix representation. The costs of shipping from sources to destinations are indicated by the entries in the matrix. If shipment is impossible between a given source and destination, a large cost of M is entered. This discourages the solution from using such cells. Supplies and demands are shown along the margins of the matrix. In general, Let Z represents the total distribution cost and xij (i = 1, 2, ….., m; j = 1, 2, …., n) be the number of units to be distributed from source i to destination j. Accordingly, the formulation of the transportation problem becomes:

Minimize

Z=

m

n

i 1

j 1

 C

n

Subject to

x j 1

ij

m

x i 1

ij

xij

 Si

i  1, 2, ........, m

 dj

j  1, 2, ........, n

xij  0

Operations Research

ij

for all i and j

95

Dr. Emad Elbeltagi

For a transportation problem to posses a feasible solution, the following property indicates when this will occur. A necessary and sufficient condition for a transportation problem to have any feasible solution is that:

m

n

i 1

j 1

 si   d j This property may be verified by observing that the constraints require that both

m

m

n

n

 and  s i  dj d j i s i 1

i 1

j 1

j 1

equal

m

n

i 1

j 1

 x

ij

As shown, the number of functional constraints equals the number of sources (m) and destinations (n). However, number of basic variables = m + n – 1. The reason behind that, the functional constraints are equality constraints, and this set of m + n equations has one extra (redundant) equation that can be deleted without changing the feasible region (i.e., any one of the constraints is automatically satisfied whenever the other m + n – 1 constraints are satisfied. This can be verified as any supply constraint exactly equals the sum of the demand constraints minus the sum of other supply constraints. Therefore, any basic feasible (BF) solution will have only m + n – 1 basic variables (non-zero variables) while all other variables will have zero value. Also, the sum of allocations for each row or each column equals its supply or demand.

We will generally assume that the total supply equals the total demand. If this is not true for a particular problem, dummy sources or destinations can be added to make it true. The text refers to such a problem as a balanced transportation problem. These dummy centers may have zero distribution costs, or costs may be assigned to represent unmet supply or demand.

For example, suppose that cannery 3, in Example 4.2, makes only 75 truckloads. The total supply is now 25 units little. A dummy supply node can be added with supply 25 to Operations Research

96

Dr. Emad Elbeltagi

balance the problem and the cost from the dummy to each warehouse can be added to represent the cost of not meeting the warehouse's demand.

In the pea shipping example, a basic solution might be to ship 20 truckloads from cannery 1 to warehouse 2 and the remaining 55 to warehouse 4, 80 from cannery 2 to warehouse 1 and 45 to warehouse 2 and, finally, 70 truckloads from cannery 3 to warehouse 3 and 30 to warehouse 4. Even though the linear programming formulation of the pea shipping example has seven constraints other than non-negativity, a basic solution has only six basic variables! This is because the constraints are linearly dependent: the sum of the first three is identical to the sum of the last four. As a consequence, the feasible region defined by the constraints would remain the same if we only kept six of them. In general, a basic solution to the transportation model will have a number of basic variables equal to the number of sources plus the number of destinations minus one.

Note that the resulting table of constraint coefficients has a special structure as shown below in Table 4.3. Any linear programming problem that fits this special formulation is classified as a transportation problem; this is why the transportation problem is generally considered a special type of linear programming problem.

x11

x12

…….

x1n

1

1

…….

1

x21

x22

…….

x2n

1

1

…….

1

…….

.

.

.

xm1

xm2

…….

xmn

1

1

…….

1

1

.

Supply constraints

Table 4.3: Constraint coefficients of the transportation problem

1

1 1

.

1 1

.

.

Demand constraints

A= .

.

…….

.

1

1

.

. 1

For many applications as the supply and demand quantities have integer values, all the basic variables in every basic feasible solution also have integer values. Operations Research

97

Dr. Emad Elbeltagi

Example 4.3 Assume three sources and three destinations with the cost of supply as given in Fig. 4.3. No transport between source S3 and destination D1, and Source S1 and destination D3. The matrix representation of this example is sown in Table 4.4.

Table 4.4: Matrix representation of the transportation problem Destinations

Sources

Supply

1

2

3

1

3

1

M

5

2 3

4 M 7

2 3 3

4 3 5

7 3

Demand

The network model of the transportation problem is shown in Fig. 4.3. Sources are identified as the nodes on the left and destinations on the right. Allowable shipping links are shown as arcs, while disallowed links are not included.

(5)

3

S1

D1

(7)

D2

(3)

D3

(5)

1 4

(7)

2

S2

4 3

(3)

S3

3

Figure 4.3: Network flow model of the transportation problem On each supply node the positive external flow indicates supply flow entering the network. On each destination node a demand is a negative fixed external flow indicating that this amount must leave the network.

Operations Research

98

Dr. Emad Elbeltagi

Example 4.4 A contractor must transmit workers to four work sites each day. The travel time in minutes between each dispatch location and work site is shown in Fig. 4.4. In order to maximize the number of productive work hours per day of each worker, the contractor wishes to minimize the total worker travel time. Formulate a mathematical model to minimize total travel time. Also, set the problem in the tabular format.

40

Dispatch location (30)

1

20 50

2 (20)

50 20

20

(50)

Work site 1 (20)

3 (30)

10

2 60

4 (10) Figure 4.4: Network flow diagram of Example 4.4 Solution Assume the variables are xij, number of worker to be dispatched from location i to work site j, where i = 1 and 2 and j = 1, 2, 3, and 4. Since the total supply equals total demand, the total travel time equals: minimize Z = 40 x11 + 20 x12 + 20 x13 + 50 x14 + 20 x21 + 50 x22 + 10 x23 + 60 x24 subject to x11 + x12 + x13 + x14 = 30

(supply)

x21 + x22 + x23 + x24 = 50

(supply)

x11 + x21 = 20

(demand)

x12 + x22 = 20

(demand)

x13 + x23 = 30

(demand)

x14 + x24 = 10

(demand)

xij ≥ 0 for all i and j. Operations Research

99

Dr. Emad Elbeltagi

The above formulation can be represented as shown in the following table: Destination

Source

Supply

1

2

3

4

1

40

20

20

50

30

2

20

50

10

60

50

20

20

30

10

Demand Example 4.5

Solve Example 4.4 considering that there is no workers are dispatched from location 1 to worksite 1.

Solution The same previous table will be constructed again with very large time to be assigned between location 1 and worksite 1 “called the big M method”. This discourages the solution from using such cell. Destination Supply

Source

1

2

3

4

1

M

20

20

50

30

2

20

50

10

60

50

20

20

30

10

Demand Example 4.6

Solve Example 4.4 considering that the demand at work site 1 is 15 instead of 20 workers.

Solution In this case there is no balance as the number of workers at locations 1 and 2 equals 80 workers, while the number of workers needed are 75 only. Then, a fictitious destination “dummy destination” will be added to balance both sides (Fig. 4.5).

Operations Research

100

Dr. Emad Elbeltagi

Work site Dispatch location

1 (15)

40

(30) 1

20

2 (20)

50 50 20

20

(50)

3 (30)

10

2 60

4 0

(10)

0

5

(5)

Figure 4.5: Network flow diagram of Example 4.6

The mathematical model in this case becomes:

minimize Z = 40 x11 + 20 x12 + 20 x13 + 50 x14 + 20 x21 + 50 x22 + 10 x23 + 60 x24 subject to x11 + x12 + x13 + x14 + x15 = 30

(supply)

x21 + x22 + x23 + x24 + x25 = 50

(supply)

x11 + x21 = 15

(demand)

x12 + x22 = 20

(demand)

x13 + x23 = 30

(demand)

x14 + x24 = 10

(demand)

x15 + x25 = 5

(demand)

xij ≥ 0 for all i and j.

Operations Research

101

Dr. Emad Elbeltagi

This formulation can be represented in the table format as follow:

Destination

Source

1

2

3

4

5

1

40

20

20

50

0

30

2

20

50

10

60

0

50

15

20

30

10

5

Demand

4.1.2

Supply

The Simplex Method for the Transportation Problem

Because the transportation problem is just a special type of linear programming problem, it can be solved by applying the simplex method as described in Chapter 3. However, the special structure of the transportation problem, as given in table 4.3, allows for using a simplified simplex method that achieving great computational savings. This simplified simplex method is called transportation simplex method.

After constructing the table of constraint coefficients as shown in Table 4.3, converting the objective function to maximization form, and using the Big M method to introduce artificial variables z1, z2, ….., zm+n into the (m+n) equality constraints to get a typical simplex tableau as shown in Table 4.5.

Table 4.5: Original simplex tableau for the transportation problem Coefficient of

Basic variable

Eq. No.

Z

0

Right side Z

….

xij

…..

zi

-1

cij

M

1

…..

zm+j

…….

M

0

1 zi

i

0

1

Zm+j

m+j

0

1

……. 1

si dj

m+n

Operations Research

102

Dr. Emad Elbeltagi

All entries not shown in Table 4.5 are zeros. Before starting the simplex method (the first iteration), it is necessary to eliminate the non-zero coefficients of the artificial basic variables in row 0. Accordingly, after any subsequent iteration, row 0 would have the form shown in Table 4.6.

Table 4.6: Row 0 of simplex tableau for the transportation problem Basic variable

Eq. No.

Z

0

Coefficient of Right side Z

-1

….

xij

cij – ui - vj

….

zi

….

M - ui

zm+j



M - vj

The values ui and vj have the following interpretation: ui = multiple of original row 0 that have subtracted directly or indirectly from original row 0 during all iterations leading to the current simplex tableau.

vj = multiple of original row m + j that have subtracted directly or indirectly from original row 0 during all iterations leading to the current simplex tableau. m

n

  si u j   d j v j

In Table 4.6, if xij is a non-basic variable, (cij – ui - vj) is interpreted as the rate at which Z i 1 would change as xij is increased. Since each basic variable must have a coefficient of zero in row 0, the values ui and vj are obtained by solving the set of equations: cij – ui - vj = 0 for each i and j such that xij is a basic variable. To solve the transportation problem, an initial basic feasible solution must be obtained first. Then, an optimality test is then performed.

As mentioned before, the number of basic variables equals the number of supply sources and the number of demand destinations minus 1. So, any feasible solution should have no more than (m + n – 1) variables with non-zero values.

Operations Research

103

Dr. Emad Elbeltagi

j 1

The procedure for constructing an initial basic feasible solution selects the m + n – 1 basic variables one at a time. After each selection, a value that will satisfy one constraint is assigned to that variable, accordingly, eliminating the constraint row or column from further consideration. Thus after an entire m + n – 1 selections, an entire basic solution has been constructed to satisfy all constraints. Many methods have been proposed for selecting the basic variables. In this chapter, the Vogel’s approximation method is used. Solving the Transportation Problem Using Vogel’s Approximation Method General procedure for constructing an initial basic feasible solution (BFS): To begin: all source rows and destination columns of the transportation simplex tableau are initially under consideration for providing a basic variable.

1. From the rows and columns still under consideration, select the next basic variable (allocation) according to some criterion. 2. Make the allocation large enough to exactly use up the remaining supply in its row or the remaining demand in its column (whichever is smaller). 3. Eliminate that row or column from further consideration. (If the row and column have the same remaining supply and demand, then arbitrarily select the row as the one to be eliminated). 4. If only one row or one column remains under consideration, then the procedure is completed by selecting every remaining variable associated with that row or column to be basic with the only feasible allocation. Otherwise, return to the first step. Vogel’s approximation method: For each row and column remaining under consideration, calculate its difference, the arithmetic difference between the smallest and next-to-the-smallest unit cost cij still remaining in that row or column. In that row or column having the largest difference, select the variable having the smallest remaining unit cost. Ties for the largest difference, or for the smallest remaining unit cost, may be broken arbitrarily.

Operations Research

104

Dr. Emad Elbeltagi

Example 4.7 Find an initial basic feasible solution for the problem presented in Example 4.4 using Vogel’s approximation method.

Solution

1

1 40

Destination 2 3 20 20

4 50

2

20

50

10

60

Demand

20

20

30

10

x12 = 20

Col. Diff.

20

30

10

10

Eliminate col. 2

(1) Source

30

Row diff. 0

50

10

Supply

First step: The highest difference is in column 2. The least value in this column is 20. Accordingly, the first basic variable to be assigned a value is x12. Then x12 = 20, the value is shown in the demand row. So, column 2 will be eliminated as its all demand is satisfied. Also, the supply value of row number 1 will be equal to 10 as a 20 of the original value has been assigned to variable x12.

(2) 1 2 Demand Col. Diff.

Source

1 40 20 20 20

Destination 3 20 10 30 10

4 50 60 10 10

Row diff. 10 20 50 10 x21 = 20 Eliminate col. 1

Supply

Second step: The highest difference is in column 1 and row 1; this tie may be broken arbitrary by either choosing row1 or column 1. Choosing column 1, the least value in this column is 20. Accordingly, the second basic variable to be assigned a value is x21. Then x21 = 20, the value is shown in the demand row. So, column 1 will be eliminated as its all demand is satisfied. Also, the supply value of row number 2 will be equal to 30 as a 20 of the original value has been assigned to variable x21.

Operations Research

105

Dr. Emad Elbeltagi

Destination 3 20 10 30 10

(3) 1 2 Demand Col. Diff.

Source

4 50 60 10 10

Supply

Row diff.

10 30

30 50 x23 = 30 Eliminate row 2

Third step: The highest difference is in row 2. The least value in this row is 10. Accordingly, the third basic variable to be assigned a value is x23. Then x23 = 30, the value is shown in the demand row. So, row 2 will be eliminated as its all supply is used (i.e, equal zero). Also, all the demand of column 3 is satisfied. Accordingly, the last basic variable, x14, equals 10. Hence, the basic variables are: x12 = 20,

x21 = 20,

x23 = 30,

x13 = 0,

and x14 = 10

The sum of all basic variables = 20 + 20 + 30 + 10 = 80 = Σ si = Σ dj Z = 20 x 20 + 20 x 20 + 30 x 10 + 10 x 50 = 1600 minutes. Example 4.8 Solve Example 4.5 using Vogel’s approximation method. Solution

1

1 M

Destination 2 3 20 20

4 50

2

20

50

10

60

Demand

20

20

30

10

x21 = 20

Col. Diff.

M-20

30

10

10

Eliminate col. 1

(1) Source

Destination

(2)

2

3

4

1 2

20 50

20 10

50 60

Demand Col. Diff.

20 30

30 10

10 10

Source

Operations Research

106

Supply

Row diff.

30

0

50

10

Supply 30 30

Row diff. 0 40

x23 = 30 Eliminate row 2 Dr. Emad Elbeltagi

(3) 1

Source

Demand

Destination 2 3 20 20

4 50

20

10

0

Row diff.

Supply 30

x12 = 20, x13 = 0 x14 = 10

Col. Diff. Hence, the basic variables are: x21 = 20,

x23 = 30,

x12 = 20,

and x14 = 10

The sum of all basic variables = 20 + 30 + 20 + 10 = 80 = Σ si = Σ dj Z = 20 x 20 + 50 x 10 + 20 x 20 + 10 x 30 = 1600 minutes.

Example 4.9 Solve Example 4.6 using Vogel’s approximation method. Solution Destination

(1)

Supply

Row diff.

1

2

3

4

5

1

40

20

20

50

0

30

20

2

20

50

10

60

0

50

10

Demand

15

20

30

10

5

x12 = 20

Col. Diff.

20

30

10

10

0

Eliminate col. 2

Source

Destination

(2)

Supply

Row diff.

1

3

4

5

1

40

20

50

0

10

20

2

20

10

60

0

50

10

Demand

15

30

10

5

x21 = 15

Col. Diff.

20

10

10

0

Eliminate col. 1

Source

Operations Research

107

Dr. Emad Elbeltagi

Destination (3)

Supply

Row diff.

3

4

5

1

20

50

0

10

20

2

10

60

0

35

10

Demand

30

10

5

x15 = 5

Col. Diff.

10

10

0

Eliminate col. 5

Source

Destination

(4)

Supply

Row diff.

3

4

1

20

50

5

30

2

10

60

35

50

Demand

30

10

x23 = 30

Col. Diff.

10

10

Eliminate col. 3

Source

Destination

(5) Source

Supply

4 50 60

1 2

Demand

Row diff.

5 5

10

x14 = 5, x24 = 5

Col. Diff. Hence, the basic variables are: x12 = 20,

x14 = 5,

x15 = 5,

x21 = 15, x23 = 30,

and

x24 = 5

The sum of all basic variables = 20 + 5 + 5 + 15 + 30 + 5 = 80 = Σ si = Σ dj Z = 20 x 20 + 50 x 5 + 0 x 5 + 20 x 15 + 10 x 30 + 60 x 5 = 1550 minutes.

Optimality Test As mentioned before, the number of basic variables equals the number of supply sources and the number of demand destinations minus one. So, any feasible solution should have no more than (m + n – 1) variables with non-zero values. So, a basic feasible solution is Operations Research

108

Dr. Emad Elbeltagi

optimal if and only if (cij – ui - vj) ≥ 0 for every (i, j) such that xij is a non-basic. Thus, the only work required by the optimality test is the derivation of the values of the ui and vj for the current basic solution and then the calculation of these (cij – ui - vj). Since (cij – ui - vj) is required to be zero if xij is a basic variable, the ui and vj satisfy the set of equations: cij = ui + vj for each i and j such that xij is a basic variable. There are (m + n – 1) basic variables, and accordingly there are (m + n – 1) of these equations. Since the number of unknowns (the ui and vj) is (m + n), one of these variables can be assigned a value arbitrarily without violating the equations. The rule adopted here is to select the ui that has the largest number of allocations in its row and assign it the value of zero. Because of the simple structure of these equations, it is then very simple to solve for the remaining variables.

Example 4.10 The following table shows the transportation cost of shipping one unit of a given product from the sources 1, 2 and 3 to destinations 1, 2, 3 and 4. The demand of each destination and the supply of each source are also given in the table. Destinations Supply

Sources

Demand

1

2

3

4

1

1

2

-

3

20

2

7

1

2

3

12

3

-

6

5

4

12

16

7

11

10

An initial basic feasible solution for this problem was determined as shown in the next table. Check if this solution is optimal or not and if not, determine the optimal solution.

Operations Research

109

Dr. Emad Elbeltagi

Destinations 1 x11=16

1 2 3

Sources

2 x12=4 x22=1 x32=2

3

4

x23=11 x34=10

Solution To calculate the ui and vj, set the equation that corresponds to each basic variable in the initial basic feasible solution as follows: x11 : 1 = u1 + v1

Set u1 = 0, then,

v1 = 1,

x12 : 2 = u1 + v2

v2 = 2,

x22 : 1 = u2 + v2

u2 = -1,

x23 : 2 = u2 + v3

v3 = 3,

x32 : 6 = u3 + v2

u3 = 4,

x34 : 4 = u3 + v4

v4 = 0

Calculate the (cij-ui-vj) for variable. For a given solution to be optimal, this value should equal zero for basic variables, for other variables, it should be greater than or equal to zero.

Table 4.7: Initial transportation simplex tableau

1

1

2

3

4

1

2

M

3

2

3

16 2 3 Demand vj

7

ui

20

0

12

-1

12

4

4 1 1

M

Supply

6

11 5

4

2

10

16

7

11

10

1

2

3

0

Z=99

It might be more convenient to solve these equations without writing them down by working directly on the transportation simplex tableau. Thus, in Table 4.7, one may start by writing down the value u1 = 0 (largest allocation value) and then picked out the circled Operations Research

110

Dr. Emad Elbeltagi

allocations (x11, x12) in that row. For each allocated value one may set vj = c1j, accordingly v1 = 1 and v2 = 2 (as shown in Table 4.7). Then, visually calculate u2 = c22 - v2 = -1. Move to the circled allocation x23, v3 = c23 - u2 = 3. Then, using x32, u3 = c32 – v3 = 4. Finally, v4 = c34 – u3 = 0. Now, we could check the optimality test by checking the value (cij – ui - vj) for all nonbasic variables. These values should be positive or zero. If any of these values are negative, then the solution is not optimal and another iterative is required to optimize the solution. Such check yields the values shown in Table 4.18 (the upper right non-circled values). Because one of these values (c33 – u3 – v3) = -2 (negative), we conclude that, the current basic feasible solution is not optimal. Thus, the transportation simplex method must next go to the iterative step to find a better basic feasible solution. Table 4.8: Completed initial transportation simplex tableau

1

1

2

3

1

2

M

16 2 3 Demand vj

7

M-3 3

3

3

4

Supply

ui

20

0

12

-1

12

4

4 7 1

2 1

M

4

M-5

6

11 5

-2 4

2

10

16

7

11

10

Z=99

1

2

3

0

Not optimal

Iterative Step In this step, we must find an entering basic variable, a leaving basic variable and then identifying the resulting new basic feasible solution. Since (cij – ui – vj) represents the rate at which the objective function would change as the non-basic variable xij is increased, the entering basic variable must have a negative (cij – ui – vj) to decrease the total cost Z. if there more than one negative value exists, select the one having the largest absolute negative value. In this example, x33 is the entering basic variable.

Operations Research

111

Dr. Emad Elbeltagi

Increasing the non-basic variable from zero sets off a chain reaction of compensating changes in other basic variables (allocations) in order to continue satisfying the supply and demand constraints. The basic variable to be decreased to zero becomes the leaving basic variable. With x33 being the entering basic variable, the chain reaction is shown in Table 4.9. The entering basic variable is denoted by a box with + sign in its cell (Table 4.9). Table 4.9: Chain reaction caused by increasing the entering basic variable x33

1

1

2

3

1

2

M

16 2 3

7

M-3

3

3

3

4

Supply

ui

20

0

12

-1

12

4

4 7 1

2 1

+ M

4

M-5

6

11

5

2

-

-2 4 +

10

+

Demand

16

7

11

10

vj

1

2

3

0

Increasing the value of x33 requires decreasing the value of x23 (denoted by a circle with negative sign) by the same amount to restore the demand of 10 in column 4, which in turn requires increasing the amount of variable x22 by the same amount to restore the supply of 12 in the second row, which in turn requires decreasing the amount of variable x31 by the same amount to restore the demand of 7 in column 2. This decrease in x31 successfully completes the chain reaction because it also restores the supply of 4 in row 3. The cells (3, 3) and (2, 2) are called the recipient cells (indicated in Table 4.9 by + signs), each receiving additional allocation from one of the cells (2, 3) and (3, 2) which are called the donor cells (indicated in Table 4.9 by – signs). After identifying the chain reaction, the donor cell having the smallest allocation becomes the leaving basic variable. In case of a tie for the donor cell (more than one cell having the smallest allocation value) any one can be chosen arbitrarily. In this case, x32 is identified as the leaving basic variable and its allocation is changed to zero. And accordingly, the allocation values of

Operations Research

112

Dr. Emad Elbeltagi

all the cell of the chain reaction is changed by the same amount. The new basic feasible solution is shown in Table 4.10. Table 4.10: New feasible transportation simplex tableau

1 2 3

1

2

3

1

2

M

7 M

16 7 M-3

4 M-3 3

1

3

2

16

vj

1

20

0

12

-1

12

2

4 1 6

2 3 2

9 5

4 2

Demand

Supply ui

7 2

11 3

10 10

Z=95

2

optimal

Thus the effect of increasing x33 from 0 to 2 resulted in decreasing the total cost from 99 to 95. Again, calculate the ui and vj values as shown in Table 4.10. Then, calculate the (cij-ui-vj) for each non-basic variable. As all (cij-ui-vj) values are positive, then the obtained solution is optimal.

Operations Research

113

Dr. Emad Elbeltagi

4.2 The Assignment Problem A special case of the transportation problem is the assignment problem which occurs when each supply is one and each demand is one. In this case, the integrity implies that every supplier will be assigned one destination and every destination will have one supplier. The costs give the charge for assigning a supplier and destination to each other.

Example 4.11 A company has three new machines of different types. There are four different plants that could receive the machines. Each plant can only receive one machine, and each machine can only be given to one plant. The expected profit that can be made by each plant if assigned a machine is as follows:

Plant

Machine

1

1 15

2 16

3 12

4 11

2

15

0

13

20

3

5

7

10

6

This is a transportation problem with all supplies and demands equal to one, so it is an assignment problem. Note that a balanced problem must have the same number of supplies and demands, so we must add a dummy machine (corresponding to receiving no machine) and assign a zero cost for assigning the dummy machine to a plant. The problem is, then, to find the minimum cost matching of machines to plants. The network flow diagram in Fig. 4.6 is very similar to the transportation model except the external flows are all ones. The only relevant parameter for the assignment model is the cost of assigning a machine to a job or plant. The solution for an assignment problem as shown will have a total flow of one in every column and row, and is the assignment that minimizes total cost.

Operations Research

114

Dr. Emad Elbeltagi

Plant

Machine

P1

(1)

P2

(1)

P3

(1)

P4

(1)

13 M1

(1)

16 12

11 15

(1)

M2

0 13

20 5

7

M3

(1)

10 6

Figure 4.6: Network flow diagram of Example 4.10 Considering the variable, xij, of assigning machine i (i = 1, 2, and 3) to plant j (j = 1, 2, 3, and 4), the mathematical formulation for this example can be stated as follow: maximixe Z = 13x11 + 16x12 + 12x13 + 11x14 + 15x21 + 0x22 + 13x23 + 20x24 + 5x31 + 7x32 + 10x33 + 6x34 subject to x11 + x12 + x13 + x14 = 1 x21 + x22 + x23 + x24 = 1 x31 + x32 + x33 + x34 = 1 x11 + x21 + x31 = 1 x12 + x22 + x32 = 1 x13 + x23 + x33 = 1 x14 + x24 + x34 = 1 xij ≥ 0 for all i and j.

4.2.1

The Assignment Problem Model

In the assignment problem there are n resources or assignee (e.g., employee, machine) is to be assigned uniquely to a particular activity or assignment (e.g., task, job). There is a cost cij associated with assignee i (i = 1, 2,3, …., n) assigned (performing) assignment j (j Operations Research

115

Dr. Emad Elbeltagi

= 1, 2, 3, ……, n), so that the objective is to determine how all the assignments should be made in order to minimize the total cost z, considering that: -

The number of assignees = the number of assignments (tasks).

-

Each assignee is to be assigned to exactly one task.

-

Each task is to be performed by exactly one assignee.

Accordingly and as the assignment problem is a special case from the transportation problem, the decision variable xij of assigning machine (assignee) i to job (task) j always take a value of one or zero as follow: 1, if assignee i performs assignment j xij = 0, if not

Thus, xij is a binary variable (0 or 1), which represents a yes or no decisions. In this case, the yes or no decisions are: should assignee i performs assignment j? The assignment problem can be described completely by a parameter table as given in Table 4.11. The classic statement of the assignment problem uses a matrix with the rows representing assignees and columns representing assignments. The algorithms for solving the problem are based on this matrix representation. The costs of performing assignment j by assignee i is indicated by the entries in the matrix.

Table 4.11: Cost and requirements table for the transportation problem Cost of assigning i to j Assignment

Assignee

Demand Operations Research

Supply

1

2



n

1

c11

c12



c1n

1

2

c21

c22



c2n

1

:

:

:

:

:

n

cn1

cn2



cnn

1

1

1



1

116

Dr. Emad Elbeltagi

Minimize

Z=

n

n

i 1

j 1

 C

n

x

Subject to

j 1

ij

n

x i 1

ij

ij

xij

1

i  1, 2, ........, n

1

j  1, 2, ........, n

xij  0

for all i and j

The first set of functional constraints specifies that each assignee performs exactly one assignment, whereas the second set requires each assignment to be performed by exactly one assignee. Comparing this formulation with the formulation of the transportation problem given in section 4.1.1, we found that this is a special case of the transportation problem where the sources now are the assignees and the destinations are the assignments, number of sources equal number of destinations, every supply =1 and every demand =1. If it is impossible to perform a given assignment by a specific assignee, a large cost of M is entered. This discourages the solution from using such cells. We will generally assume that the total number of assignee equals the total number of assignments (i.e., i = j). If this is not true for a particular problem, dummy assignees or assignments can be added to make it true. Such problem refers to as a balanced assignment problem. These dummy centers may have zero assignment costs. Example 4.12 A contractor has three different types of excavation equipment that are needed to be assigned to three different excavation sites. The production cost for each 1 m3 of the excavated soil is as given in the following table. Job site

Machine

Operations Research

1

2

3

1

8

3

7

2

-

10

3

3

6

5

4

117

Dr. Emad Elbeltagi

The contractor desires to make the optimum assignment to minimize total cost. Formulate the mathematical model to optimally assign the equipment to the excavation sits. Solution (S1=1)

1

8

x11 3

7

x12

1

(d1=1)

2

(d2=1)

3

(d3=1)

X31

x13

(S2=1)

10

2

X22 X32

3

X23

6 5

(S3=1)

3

X33

4

Figure 4.7: Network flow diagram of Example 4.11 Control variables x11 to x33 are defined between each assignee i and assignment j as show in Figure 4.7. Also, as the number of assignees equals the number of assignments, then the feasible solution is met.

The mathematical model in this case becomes:

minimize z = 8 x11 + 3 x12 + 7 x13 + 10 x22 + 3 x23 + 6 x31 + 5 x32 + 4 x33 subject to x11 + x12 + x13 = 1

(supply)

x21 + x22 + x23 = 1

(supply)

x31 + x32 + x33 = 1

(supply)

x11 + x21 + x31 = 1

(demand)

x12 + x22+ x32 = 1

(demand)

x13 + x23+ x33= 1

(demand)

xij ≥ 0 for all i and j.

Operations Research

118

Dr. Emad Elbeltagi

The above formulation can be represented as shown in the following table: Assignment Supply

Assignee

1

2

3

1

8

3

7

1

2

M

10

3

1

3

6

5

4

1

1

1

1

Demand

4.2.2

Solving the Assignment Problem Using Vogel’s Approximation Method

As explained in section 4.1.1, the number of constraints equals m + n and the number of basic variables equal m + n – 1. In the assignment problem, m = n, then the number of constraints = 2n and the number of basic variables = 2n – 1. But, exactly n only of these xij should equal one. Therefore, there always are n - 1 basic variables with xij = 0 (degenerate variables). The assignment problem is solved the same way as described previously in solving the transportation problem.

Example 4.13 Solve example 4.12 using Vogel’s approximation method to determine an initial basic feasible solution.

Assignment

(1)

Supply

Row diff.

1

2

3

1

8

3

7

1

4

2

M

10

3

1

7

3

6

5

4

1

1

Demand

1

1

1

x23 = 1

Col. Diff.

2

2

1

Eliminate row 2

Assignee

Operations Research

119

Dr. Emad Elbeltagi

The highest difference is in row 2. The least value in this row is 3. Accordingly, the first basic variable is x23, then x23 = 1. So, row 2 will be eliminated as its all demand is satisfied. Also, the demand value of column number 3 will be equal to 0 (i.e., x13 = 0 and x33 = 0).

Assignment

(2)

Supply

Row diff.

1

2

3

1

8

3

7

1

4

3

6

5

4

1

1

Demand

1

1

0

x12 = 1

Col. Diff.

2

2

3

Eliminate row 1

Assignee

By eliminating row then the needs of column two has been satisfied (i.e., x21 = 0 and x32 = 0). Then the last basic variable is x31 = 1. Hence, the basic variables are: x12 = 1, x23 = 1, x31 = 1, x32 = 0, and x33 = 0. Minimum z = 8 x 0 + 3 x 1 + 7 x 0 + 10 x 0 + 3 x 1 + 6 x 1 + 5 x 0 + 4 x 0 = 12

4.3 Solved Examples 4.3.1

Example 1

Formulate the following production problem as a transportation model. The demands for a given item are 150, 250, 200 units for the next three months. The demand may be satisfied by - Excess production in an earlier month held in stock for later consumption, - Production in the current month, - Excess production in a later month backordered for preceding months.

Operations Research

120

Dr. Emad Elbeltagi

The variable production cost per unit in any month is $6.00. A unit produced for later consumption will incur a storage cost at the rate of $1 per unit per month. On the other hand, backordered items incur a penalty cost of $3.00 per unit per month. The production capacity in each of the next three months is 200 units. The objective is to devise a minimum cost production plan.

Solution

7

Destination

(1)

Supply

Row diff.

1

2

3

1

6

7

8

200

1

2

9

6

7

200

1

3

12

9

6

200

3

Demand

150

250

200

x11 = 150

Col. Diff.

3

1

1

Eliminate col. 1

Source

Destination

(2)

Supply

Row diff.

2

3

1

7

8

50

1

2

6

7

200

1

3

9

6

200

3

Demand

250

200

x33 = 200

Col. Diff.

1

1

Eliminate row 3

Source

Operations Research

121

Dr. Emad Elbeltagi

Destination

(3)

Supply

Row diff.

2

3

1

7

8

50

1

2

6

7

200

1

Demand

250

0

Col. Diff.

1

1

Source

x12 = 50, x22 = 200

Hence, the basic variables are: x11 = 150, x12 = 50, x22 = 200, x23 = 0, and x33 = 200. z = 6 x 150 + 7 x 50 + 6 x 200 + 6 x 200 = LE 7650

4.3.2

Example 2

A car renting company needs to redeploy its automobiles to correct imbalances in the system. Currently the company has too many cars in New York (with 10 cars excess) and Chicago (12 cars excess). Pittsburgh would like up to 6 cars, Los Angeles up to 14 cars, and Miami up to 7 cars (note that more cars are demanded than are available). The cost of transporting a car from one city to another is given by: Pittsburgh

Los Angeles Miami

New York

50

250

100

Chicago

25

200

125

Formulate this problem as a transportation problem. Clearly give the nodes and arcs. For each node, give the supply or demand at the node. For each arc, give the cost.

Solution

Operations Research

122

Dr. Emad Elbeltagi

Destination

(1)

Supply

Row diff.

PITT

LA

MIA

NY

50

250

100

10

50

CH

25

200

125

12

100

Dummy

0

0

0

5

0

Demand

6

14

7

Col. Diff.

25

200

100

Source

Destination

(2)

x32 = 5

Supply

Row diff.

PITT

LA

MIA

NY

50

250

100

10

50

CH

25

200

125

12

100

Dummy

0

0

0

0

0

Demand

6

9

7

x22 = 9

Col. Diff.

25

200

100

Eliminate col. 2

Source

Destination

(3)

Supply

Row diff.

PITT

MIA

NY

50

100

10

50

CH

25

125

3

100

Dummy

0

0

0

0

Demand

6

7

x13 = 7

Col. Diff.

25

100

Eliminate col. 3

Source

Destination

(4)

Source

PITT

Supply

Row diff.

NY

50

3

50

CH

25

3

100

Dummy

0

0

0

Demand

6

Col. Diff.

25

Operations Research

x11 = 3, x21 = 3

123

Dr. Emad Elbeltagi

Hence, the basic variables are: x11 = 3, x13 = 7, x21 = 3, x22 = 9, and x32 = 5. z = 50 x 3 + 100 x 7 + 25 x 3 + 200 x 9 + 0 x 5 = LE 2725

4.3.3

Example 3

The following table represents the cost of performing projects 1, 2 and 3 in thousands Egyptian pounds submitted by four contracting companies A B, C, and D. It is required to determine the best assignment of companies to projects to minimize the construction cost of all projects.

Projects

1

A 90

B 40

Companies C 60

D 80

2

70

60

80

50

3

80

70

50

50

Solution As the number of projects is less than the number of companies, a dummy project will be added with zero cost.

Company

(1)

Demand

Row diff.

A

B

C

D

1

90

40

60

80

1

20

2

70

60

80

50

1

10

3

80

70

50

50

1

0

4

0

0

0

0

1

0

Supply

1

1

1

1

Col. Diff.

70

40

50

50

Project

Operations Research

124

x41 = 1 Eliminate col. 1 and row 4

Dr. Emad Elbeltagi

Company

(2)

Demand

Row diff.

B

C

D

1

40

60

80

1

20

2

60

80

50

1

10

3

70

50

50

1

0

Supply

1

1

1

x12 = 1

Col. Diff.

20

10

0

Eliminate col. 2

Project

Company

(3)

Demand

Row diff.

C

D

1

60

80

0

20

2

80

50

1

30

3

50

50

1

0

Supply

1

1

x24 = 1

Col. Diff.

10

0

Eliminate row 2

Project

Then x33 = 1. The optimum solution is: Company A performs the dummy project 4 with cost of LE 0 Company B performs project 1 with cost of LE 40000 Company C performs project 3 with cost of LE 50000 Company D performs project 2 with cost of LE 50000

4.4 Exercises 1. A manufacturing firm produces widgets and distributes them to five wholesalers. Sales forecasts indicate that monthly deliveries will be 2700, 2700, 9000, 4500 and 3600 widgets to wholesalers 1-5 respectively. The monthly production capacities are 4500, 9000 and 11,250 at plants 1, 2 and 3, respectively. The direct costs of producing each widget are EL2 at plant 1, LE1 at plant 2 and LE1.80 at plant 3. The transport cost of shipping a widget from a plant to a wholesaler is given below. Operations Research

125

Dr. Emad Elbeltagi

Wholesaler

1

2

3

4

5

Plant 1 Plant 2 Plant 3

0.05 0.08 0.10

0.07 0.06 0.09

0.11 0.10 0.09

0.15 0.12 0.10

0.16 0.15 0.16

Formulate a linear Programming model for this production and distribution problem. 2. The amount of reinforcement steel available at three warehouses of a construction company is 20, 12, and 12 tons respectively. While, the amounts of reinforcement steel needed at four construction sites are 16, 7, 11, and 10 ton respectively. The following table shows the transportation cost in Egyptian Pounds (LE) between the different warehouses and the construction sites. It is required to draw the network flow diagram and determine how many tons of reinforcement steel should be shipped from each warehouse to each of the construction sites in order to minimize the total shipping cost. Construction site Warehouse Warehouse 1 Warehouse 2 Warehouse 3

Transportation cost (LE) Construction site 1

Construction Construction site 2 site 3

4 7 2

2 1 6

1 2 5

Construction site 4 3 3 4

3. Resolve problem no. 1 assuming the transportation table as follow with no reinforcement steel to be shipped from warehouse 1 to site 3 and from warehouse 3 to site 1. Construction site Warehouse Warehouse 1 Warehouse 2 Warehouse 3

Operations Research

Transportation cost (LE) Construction site 1

Construction Construction site 2 site 3

4 7 -

2 1 6

126

2 5

Construction site 4 3 3 4

Dr. Emad Elbeltagi

4. Resolve problem no. 1 assuming that the reinforcing steel available at the three warehouses is 20, 12, and 18 tons respectively. While, the amounts of reinforcement steel needed at four construction sites are 16, 7, 11, and 10 ton respectively.

5. A contractor owns three excavators of different capacity. He/she wants to dispatch these excavators into three different jobs. The performance of the excavators is measured as the time consumed to perform each job. The data of the time tests are shown as given in the table below. Job time (hour) Excavator 1 2 3

Job 1

Job 2

Job 3

5 4 10

4 10 6

9 8 3

a. Draw a network flow diagram. b. Formulate a mathematical model to obtain the minimum time. c. Solve this model using the Vogel’s approximation model. 6. A contractor has two concrete pumps of different capacity. It is required to assign these pumps at three tasks to obtain the optimum performance. The optimum performance was measured in the time in hours it took to perform each task. The results of the time tests are given in the table below. Solve this problem to obtain the optimal time. Task time (hour) Pump 1 2

Operations Research

Task 1

Task 2

Task 3

5 3

4 6

6 6

127

Dr. Emad Elbeltagi