or lecture06[1]

Upload: areeba-mushtaq-ahmed

Post on 11-Oct-2015

106 views

Category:

Documents


9 download

DESCRIPTION

-

TRANSCRIPT

  • EM-505: Operations Research 1

    1

    EM-505: Operations Research (OR)

    Lecture #6

    Chapter 5: Transportation Model and Its Variants

    S. Zaffar Qasim

    Assistant Professor (CIS)

    MEM (Electrical)Spring 2013 Semester

    2

    THE ASSIGNMENT MODEL

    The best person for the job

    o an apt description of the assignment model.

    Can be best illustrated by the assignment ofworkers with varying degrees of skills to jobs.

    A job that happens to match a workers skill costsless than one in which the operator is not as skillful.

    The objective of the model

    o to determine the minimum-cost assignment ofworkers to jobs.

  • EM-505: Operations Research 2

    3

    THE ASSIGNMENT MODEL

    The general assignment model with n workers and n jobs is represented in table 1.

    The element cij represented the cost of assigning worker i to job j (i,j = 1,2,,n).

    Assuming that the number of workers always equals thenumber of jobs

    o because we can always add fictitious workers or

    o fictitious jobs to satisfy this assumption.

    Table 1

    4

    THE ASSIGNMENT MODEL The assignment model is actually a special case of the

    transportation model in which

    the workers represent the sources and

    the jobs represent the destinations.

    In effect, the assignment model can be solved directly as a regular transportation model.

    Nevertheless, the fact that all the supply and demand amounts equal 1

    has led to the development of a simple solutionalgorithm called the Hungarian method.

    The algorithm is actually rooted in the simplex method.

  • EM-505: Operations Research 3

    5

    The Hungarian Method

    Example 1

    Joe Klynes three children, John, Karen and Terri, want to earn some money to take care of personal expenses during a school trip to the local zoo.

    Mr. Klyne has chosen three chores for his children:

    mowing the lawn,

    painting the garage door, and

    washing the family cars.

    To avoid anticipated sibling competition, he asks them to submit (secret) bids for what they feel is fair pay for each of the three chores.

    The understanding is that all three children will abide by their fathers decision as to who gets which chore.

    6

    The Hungarian Method

    Example 1 (contd)

    Table 2 summarizes the bids received.

    Based on this information, how should Mr. Klyne assign the chores?

    Table 2

  • EM-505: Operations Research 4

    7

    The Hungarian Method

    Example 1 (contd)

    The assignment problem will be solved by the Hungarian method.

    Step 1. For the original cost matrix, identify each rowsminimum and subtract it from all the entries of the row.

    Let pi and qj be the minimum costs associated with row iand column j as defined in steps 1 and 2, respectively.

    The row minimums of step 1 are computed from theoriginal cost matrix as shown in table 3.

    Table 3

    8

    The Hungarian Method

    Example 1 (contd)

    Next, subtract the row minimum from each respective row to obtain the reduced matrix in table 4.

    Table 4

  • EM-505: Operations Research 5

    9

    The Hungarian Method

    Example 1 (Contd) Step 2. For the matrix resulting from step 1, identifying each columns

    minimum, and subtract it from all the entries of the column.

    The application of step 2 yields the column minimums in table 4.

    Subtracting these values from the respective columns, we get thereduced matrix in table 5.

    Table 5

    10

    The Hungarian Method

    Example 1 (Contd)

    Step 3. Identify the optimal solution as the feasibleassignment associated with the zero elements of the matrixobtained in step 2.

    The cells with underscored zero entries provide the optimum solution.

    This means that John gets to paint the garage door, Karen gets to mowthe lawn and Terri gets to wash the family cars.

    The total cost to Mr. Klyne is 9 + 10 + 8 = $27.

    This amount also will always equal

    (p1 + p2 + p3) + (q1 + q2 + q3) =

    (9 + 9 + 8) + (0 + 1 + 0) = $27.

  • EM-505: Operations Research 6

    11

    The Hungarian Method

    Example 1 (Contd)

    The given steps of the Hungarian method workwell in the preceding example

    o because the zero entires in the final matrixhappen to produce a feasible assignment

    o in the sense that each child is assigned a distinctchore.

    In some cases, the zeros created by steps 1 and 2may not yield a feasible solution directly,

    o further steps are needed to find the optimal(feasible assignment).

    The following example demonstrates this situation.

    12

    The Hungarian Method

    Example 2

    Suppose that the situation discussed in example 1 isextended to four children and four chores.

    Table 6 summarizes the cost elements of the problem.

    Table 6

  • EM-505: Operations Research 7

    13

    The Hungarian Method

    Example 2 (contd)

    The applications of steps 1 and 2 to the matrix in table 6(using p1 = 1, p2 = 7, p3 = 4, p4 = 5,

    q1 = 0, q2 = 0, q3 = 3 and q4 = 0)

    yields the reduced matrix in table 7 (verify!).

    Table 7

    14

    The Hungarian Method

    Example 2 (contd) The locations of the zero entries do not allow assigning unique chores to

    all the children.

    For example, if we assign child 1 to chore 1, then column 1 will be eliminated,

    and child 3 will not have a zero entry in the remaining three columns.

    This obstacle can be accounted for by adding the following step to the procedure outlined in example 1.

  • EM-505: Operations Research 8

    15

    The Hungarian Method

    Example 2 (contd) Step 2a. If no feasible assignment (with all zero entries) can be secured

    from steps 1 and 2,

    Draw the minimum number of horizontal and vertical lines in the last reduced matrix that will cover all the zero entries.

    Table 8

    16

    The Hungarian Method

    Example 2 (contd)

    Select the smallest uncovered entry, subtract it from every uncovered entry,

    then add it to every entry at the intersection of two lines.

    If no feasible assignment can be found among the resulting zero entries, repeat step 2a.

    Otherwise, go to step 3 to determine the optimalassignment.

  • EM-505: Operations Research 9

    17

    The Hungarian Method Example 2 (contd)

    The optimum solution (shown by the underscored zeros) calls forassigning child 1 to chore 1, child2 to chore 3, child 3 to chore 2, andchild 4 to chore 4.

    The associated optimal cost is 1 + 10 + 5 + 5 = $21.

    The same cost is also determined by summing the pis, the qjs and theentry that was subtracted after the shaded cells were determined

    that is, (1 + 7 + 4 + 5) + (0 + 0 + 3 + 0) + (1) = $21.

    18

    DEFINITION OF THE TRANSPORTATION MODEL

    The general problem is represented by the network in fig 1.

    There are m sources and n destinations, each represented by a node.

    The arcs represent the routes linking the sources and the destinations.

    Arc (i, j) joining source i to destination j carries two pieces of information: the transportation cost per unit, cij, and

    the amount shipped, xij.

    Fig 1

  • EM-505: Operations Research 10

    19

    DEFINITION OF THE TRANSPORTATION MODEL

    The amount of supply at source i is ai and the amount ofdemand at destination j is bj.

    The objective of the model is

    to determine the unknowns xij that will

    minimize the total transportation cost

    while satisfying all the supply and demand restrictions.

    20

    Example 1 MG Auto has

    three plants in Los Angeles, Detroit and New Orleans, and

    two major distribution centers in Denver and Miami.

    The capacities of the three plants during the next quarter are 1000, 1500 and 1200 cars.

    The quarterly demands at the two distribution centers are 2300 and 1400 cars.

    The mileage chart between the plants and the distribution is given in table 9.

    Table 9

  • EM-505: Operations Research 11

    21

    Example 1 The trucking company in charge of transporting the cars

    charges 8 cents per mile per car.

    The transportation costs per car on the different routes,rounded to the closest dollar, are given in table 10.

    Table 10

    22

    Example 1 The LP model of the problem is given as

    Minimize z = 80x11 + 215x12 + 100x21 + 108x22 + 102x31 + 68x32 Subject to

    These constraints are all equations because

    the total supply from the three sources (= 1000 + 1500 + 1200 = 3700 cars) equals

    the total demand at the two destinations (= 2300 + 1400 = 3700 cars).

  • EM-505: Operations Research 12

    23

    Example 1 The LP model can be solved by the simplex method.

    However, with the special structure of the constraints wecan solve the problem more conveniently using thetransportation tableau shown in table 11.

    Table 11

    24

    Example 1 The optimal solution in fig 2 (obtained by TORA) calls for

    shipping 1000 cars from Los Angeles to Denver, 1300 fromDetroit to Denvor, 200 Detroit to Miami and 1200 from NewOrleans to Miami.

    The associated minimum transportation cost is computed as

    1000 x $80 + 1300 x $100 + 200 x $108 + 1200 x $68 =$313,200.

    Fig 2

  • EM-505: Operations Research 13

    25

    Balancing the Transportation Model The transportation algorithm assumption

    that the model is balanced,

    meaning that the total demand equals the total supply.

    If the model is unbalanced, we can always add a dummysources or a dummy destination to restore balance.

    Example 2

    In the MG model, suppose that the Detroit plant capacity is1300 cars (instead of 1500).

    The total supply (=3500 cars) is less than the total demand(=3700 cars), meaning that part of the demand at Denverand Miami will not be satisfied.

    Because the demand exceeds the supply, a dummy source(plant) with a capacity of 200 cars (=3700-3500) is added tobalance the transportation model.

    26

    Balancing the Transportation Model The unit transportation costs from the dummy plant to the

    two destinations are zero because the plant does not exist.

    Table 12 gives the balanced model together with itsoptimum solution.

    The solution shows that the dummy plant ships 200 cars toMiami, which means that Miami will be 200 cars short ofsatisfying its demand of 1400 cars.

    Table 12

  • EM-505: Operations Research 14

    27

    Balancing the Transportation Model You can make sure that a specific destination does not

    experience shortage by assigning a very high unittransportation cost from the dummy source to thatdestination.

    For example, a penalty of $1000 in the dummy-Miami cellwill prevent shortage at Miami.

    Of course, we cannot use this trick with all the destinations,because shortage must occur somewhere in the system.

    The case where the supply exceeds the demand can bedemonstrated by assuming that the demand at Denver is1900 cars only.

    In this case, we need to add a dummy distribution center toreceive the surplus supply.

    28

    Balancing the Transportation Model Again, the unit transportation costs to the dummy

    distribution center are zero, unless we require a factory toship out completely.

    In this case, we must assign a high unit transportation costfrom the designated factory to the dummy destination.

    Table 13 gives the new model and its optimal solution(obtained by TORA).

    The solution shows that the Detroit plant will have asurplus of 400 cars.

    Table 13

  • EM-505: Operations Research 15

    29

    THE TRANSPORTATION ALGORITHMExample 3 (SunRay Transport)

    SunRay Transport Company ships truckloads of grain from three silos tofour mills. The supply (in truckloads) and the demand (also in truckloads)together with the unit transportation costs per truckload on the differentroutes are summarized in the transportation model in table 14. The unittransportation costs, cij, (shown in the northeast corner of each box) are inhundreds of dollars. The model seeks the minimum-cost shipping schedulexij between silo i and mill j (i=1,2,3; j=1,2,3,4).

    Table 14

    30

    Summary of the Transportation Algorithm

    The steps of the transportation algorithm are exact parallelsof the simplex algorithm.

    Step 1. Determine a starting basic feasible solution, and goto step 2.

    Step 2. Use the optimality condition of the simplex methodto determine the entering variable from among all thenonbasic variables. If the optimality condition is satisfied,stop. Otherwise, go to step 3.

    Step 3. Use the feasibility condition of the simplex methodto determine the leaving variable from among all thecurrent basic variables and find the new basic solution.Return to step 2.

  • EM-505: Operations Research 16

    31

    Determination of the Starting Solution

    A general transportation model with m sources and ndestinations has m + n constraint equations, one for eachsource and each destination.

    However, because the transportation model is alwaysbalanced (sum of the supply = sum of the demand), one ofthese equations is redundant.

    Thus, the model has m + n - 1 independent constraintequations, which means that the starting basic solutionconsists of m+n-1 basic variables.

    Thus, in example 4, the starting solution has 3 + 4 -1 = 6basic variables.

    32

    Determination of the Starting Solution

    The special structure of the transportation problem allows securing a nonartificial starting basic solution using one of the three methods: Northwest-corner method

    Least-cost method

    Vogel approximation method

    The three methods differ in the quality of the starting basic solution they produce,

    in the sense that a better starting solution yields a smaller objective value.

    In general, though not always, the Vogel method yields the best starting basic solution, and the northwest-corner method yields the worst.

    The tradeoff is that the northwest-corner method involves the least amount of computations.

  • EM-505: Operations Research 17

    33

    Northwest-Corner Method

    The method starts at the northwest-corner cell (route) of thetableau (variable x11).

    Step 1. Allocate as much as possible to the selected cell, andadjust the associated amounts of supply and demand bysubtracting the allocated amount.

    Step 2. Cross out the row or column with zero supply ordemand to indicate that no further assignments can bemade in that row or column.

    If both a row and column net to zero simultaneously,cross out one only, and leave a zero supply (demand) inthe uncrossed-out row (column).

    Step 3. If exactly one row or column is left uncrossed out,stop.

    Otherwise, move to the cell to the right if a column hasjust been crossed out or below if a row has been crossedout. Got to step 1.

    34

    Northwest-Corner Method

    Example The application of the procedure to the model of example 4 gives the

    starting basic solution in table 15.

    The arrows show the order in which the allocated amounts are generated.

    The starting basic solution is

    x11 = 5, x12 = 10 , x22 = 5.

    x23 = 15, x24 = 5, x34 = 10

    The associated cost of the schedule is

    z = 5 x 10 + 10 x 2 + 5 x 7 + 15 x 9 + 5 x 20 + 10 x 18 = $520

    Table 15

  • EM-505: Operations Research 18

    35

    Least-Cost Method

    The least-cost method finds a better starting solution byconcentrating on the cheapest routes.

    The method assigns as much as possible to the cell with thesmallest unit cost (ties are broken arbitrarily).

    Next, the satisfied row or column is crossed out and theamounts of supply and demand are adjusted accordingly.

    If both a row and a column are satisfied simultaneously,only one is crossed out, the same as in the northwest-cornermethod.

    Next, look for the uncrossed-out cell with the smallest unitcost and repeat the process until exactly one row or columnis left uncrossed out.

    36

    Least-Cost Method

    Example

    The least-cost method is applied to example in the following manner:

    1. Cell (1,2) has the least unit cost in the tableau (=$2).

    The most that can be shipped through (1,2) is x12 = 15 truckloads, which happens to satisfy both row 1 and column 2 simultaneously.

    We arbitrarily cross out column 2 and adjust the supply in row 1 to 0.

    Table 16

  • EM-505: Operations Research 19

    37

    Least-Cost Method

    Example (contd)

    2. Cell (3,1) has the smallest uncrossed-out unit cost (=$4).

    Assign x31=5, and cross-out column 1 because it is satisfiedand adjust the demand of row 3 to 10 5 = 5 truckloads.

    3. Continuing in the same manner, we successively assign 15truckloads to cell (2,3), 0 truckloads to cell (1,4), 5truckloads to cell (3,4) and 10 truckloads to cell (2,4)(verify!).

    38

    Least-Cost Method

    The resulting starting solution is summarized in table 16.

    The arrows show the order in which the allocations aremade.

    The starting solution (consisting of 6 basic variables) is x12 =15, x14 = 0, x23 = 15, x24 = 10, x31 = 5, x34 = 5.

    The associated objective value is

    z = 15 x 2 + 0 x 11 + 15 x 9 + 10 x 20 + 5 x 4 + 5 x 18= $475

    The quantity of the least-cost starting solution is better thanthat of the northwest-corner method because it yields asmaller value of z ($475 versus $520 in the northwest-cornermethod).

  • EM-505: Operations Research 20

    39

    Iterative Computations of the Transportation Algorithm

    After determining the starting solution, we use thefollowing algorithm to determine the optimum solution:

    Step 1: Use the simplex optimality condition to determinethe entering variable as the current nonbasic variable thatcan improve the solution.

    If the optimality condition is satisfied, stop. Otherwise,go to step 2.

    Step 2: Determine the leaving variable using the simplexfeasibility condition.

    Change the basis and return to step 1.

    The optimality and feasibility conditions do not involve thefamiliar row operations used in the simplex method.

    Instead, the special structure of the transportation modelallows simpler computations.

    40

    Iterative Computations of the Transportation Algorithm

    Example

    Solve the transportation model of example 3, starting with the northwest-corner solution. Table gives the northwest-corner starting as determined in table 17.

    Table 17

  • EM-505: Operations Research 21

    41

    Iterative Computations of the Transportation Algorithm

    The determination of the entering variable from among the current nonbasic variables (those that are not part of the starting basic solution)

    is done by computing the nonbasic coefficients in the z-row, using the method of multipliers.

    In the method of multipliers, we associate the multipliers uiand vj with row i and column j of the transportation tableau.

    For each current basic variable xij, these multipliers are shown in later section to satisfy the following equations:

    ui + vj = cij, for each basic xij

    42

    Iterative Computations of the Transportation Algorithm

    Example

    To summarize, we have

    u1 = 0, u2 = 5, u3 = 3

    v1 = 10, v2 = 2, v3 = 4, v4 = 15

    Next, we use ui and vj to evaluate the nonbasic variables by computing

    ui + vj cij, for each nonbasic xij

  • EM-505: Operations Research 22

    43

    Iterative Computations of the Transportation Algorithm

    Example

    The preceding information, together with the fact that ui + vj cij = 0 for each basic xij, is actually equivalent to computing the z-row of the simplex tableau, as the following summary shows.

    Because the transportation model seeks to minimize cost,the entering variable is the one having the most positivecoefficient in the z-row.

    Thus, x31 is the entering variable.

    44

    Iterative Computations of the Transportation Algorithm

    Table 18

  • EM-505: Operations Research 23

    45

    Iterative Computations of the Transportation Algorithm

    Having identified x31 as the entering variable, we need to determine the leaving variable.

    Remember that if x31 enters the solution to become basic, one of the current basic variables must leave as nonbasic (at zero level).

    The selection of x31 as the entering variable means that we want to ship through this route because it reduces the total shipping cost.

    What is the most that we can ship through the new route?

    Observe in table 18 that if route (3,1) ships units (i.e. x31 = ), then the maximum value of is determined based on two conditions.

    1. Supply limits and demand requirements remain satisfied.

    2. Shipments through all routes remain nonnegative.

    46

    Iterative Computations of the Transportation Algorithm

    These two conditions determine the maximum value of and the leaving variable in the following manner.

    First, construct a closed loop that starts and ends at theentering variable cell, (3,1).

    The loop consists of connected horizontal and verticalsegments only (no diagonals are allowed).

    Except for the entering variable cell, each corner of theclosed loop must coincide with a basic variable.

    Table 10 shows the loop for x31. Exactly one loop exists for agiven entering variable.

    Next, we assign the amount to the entering variable cell(3,1).

  • EM-505: Operations Research 24

    47

    Iterative Computations of the Transportation Algorithm

    Table 19

    48

    Iterative Computations of the Transportation Algorithm

    For the supply and demand limits to remain satisfied, wemust alternate between subtracting and adding the amount at the successive corners of the loop as shown in table 19.

    For 0, the new values of the variables then remainnonnegative if

    x11 = 5 0

    x22 = 5 0

    x34 = 10 0

    The corresponding maximum value of is 5, which occurswhen both x11 and x22 reach zero level.

    Because only one current basic variable must leave the basicsolution, we can choose either x11 or x22 as the leavingvariable.

    We arbitrarily choose x11 to leave the solution.

  • EM-505: Operations Research 25

    49

    Iterative Computations of the Transportation Algorithm

    Thus, the new cost is $520 - $45 = $475.

    The selection of x31 (=5) as the entering variable and x11 as the leaving variable requires adjusting the values of the basic variables at the corners of the closed loop as Table 20 shows.

    Because each unit shipped through route (3,1) reduces the shipping cost by $9 (=u3 + v1 c31), the total cost associated with the new schedule is $9 x 5 = $45 less than in the previous schedule.

    Thus, the new cost is $520 - $45 = $475.

    50

    Iterative Computations of the Transportation Algorithm

    Given the new basic solution, we repeat the computation of the multipliers u and v as Table 20 shows.

    The entering variable is x14.

    The closed loop shows that x14 = 10 and that the leaving variable is x24.

    Table 20

  • EM-505: Operations Research 26

    51

    Iterative Computations of the Transportation Algorithm

    The new solution, shown in table 12, costs $4 x 10 = $40 less than the preceding one, thus yielding the new cost $475 $40 = $435.

    The new ui + vj cij are now negative for all nonbasicxij.

    Thus, the solution in table 21 is optimal.

    Table 21

    52

    Iterative Computations of the Transportation Algorithm

    The following table summarizes the optimum solution.

    Table 22