the transportation and assignment...

43
The Transportation and Assignment Problems Chapter 9: Hillier and Lieberman Chapter 7: Decision Tools for Agribusiness Dr. Hurley’s AGB 328 Course

Upload: dangkiet

Post on 15-Feb-2018

245 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: The Transportation and Assignment Problemsagribusiness.calpoly.edu/shurley/agb328/AGB328Lecture6.pdf · The Transportation and Assignment Problems Chapter 9: Hillier and Lieberman

The Transportation and

Assignment ProblemsChapter 9: Hillier and Lieberman

Chapter 7: Decision Tools for Agribusiness

Dr. Hurley’s AGB 328 Course

Page 2: The Transportation and Assignment Problemsagribusiness.calpoly.edu/shurley/agb328/AGB328Lecture6.pdf · The Transportation and Assignment Problems Chapter 9: Hillier and Lieberman

Terms to Know

Sources, Destinations, Supply, Demand, The Requirements Assumption, The Feasible Solutions Property, The Cost Assumption, Dummy Destination, Dummy Source, Transportation Simplex Method, Northwest Corner Rule, Vogel’s Approximation Method, Russell’s Approximation Method, Recipient Cells, Donor Cells, Assignment Problems, Assignees, Tasks, Hungarian Algorithm

Page 3: The Transportation and Assignment Problemsagribusiness.calpoly.edu/shurley/agb328/AGB328Lecture6.pdf · The Transportation and Assignment Problems Chapter 9: Hillier and Lieberman

Case Study: P&T Company

P&T is a small family-owned business that

processes and cans vegetables and then

distributes them for eventual sale

One of its main products that it processes and

ships is peas

◦ These peas are processed in: Bellingham, WA; Eugene,

OR; and Albert Lea, MN

◦ The peas are shipped to: Sacramento, CA; Salt Lake

City, UT; Rapid City, SD; and Albuquerque, NM

Page 4: The Transportation and Assignment Problemsagribusiness.calpoly.edu/shurley/agb328/AGB328Lecture6.pdf · The Transportation and Assignment Problems Chapter 9: Hillier and Lieberman

Case Study: P&T Company Shipping

Data

Cannery Output Warehouse Allocation

Bellingham 75 Truckloads Sacramento 80 Truckloads

Eugene 125 Truckloads Salt Lake 65 Truckloads

Albert Lea 100 Truckloads Rapid City 70 Truckloads

Total 300 Truckloads Albuquerque 85 Truckloads

Total 300 Truckloads

Page 5: The Transportation and Assignment Problemsagribusiness.calpoly.edu/shurley/agb328/AGB328Lecture6.pdf · The Transportation and Assignment Problems Chapter 9: Hillier and Lieberman

Case Study: P&T Company Shipping

Cost/Truckload

Warehouse

Cannery Sacramento Salt Lake Rapid

City

Albuquerque Supply

Bellingham $464 $513 $654 $867 75

Eugene $352 $416 $690 $791 125

Albert Lea $995 $682 $388 $685 100

Demand 80 65 70 85

Page 6: The Transportation and Assignment Problemsagribusiness.calpoly.edu/shurley/agb328/AGB328Lecture6.pdf · The Transportation and Assignment Problems Chapter 9: Hillier and Lieberman

Network Presentation of P&T Co.

Problem

C175

C1125

C1100

W1 -80

W3 -70

W4 -85

W2 -65

464

513

654867

352

416

690

791

995

388

685

682

Page 7: The Transportation and Assignment Problemsagribusiness.calpoly.edu/shurley/agb328/AGB328Lecture6.pdf · The Transportation and Assignment Problems Chapter 9: Hillier and Lieberman

Mathematical Model for P&T

Transportation Problem

34333231

24232221

14131211

,,,

,,,

,,,

685388682995

791690416352

867654513464

34333231

24232221

14131211

xxxx

xxxx

xxxx

Minimize

xxxx

xxxx

xxxx

Page 8: The Transportation and Assignment Problemsagribusiness.calpoly.edu/shurley/agb328/AGB328Lecture6.pdf · The Transportation and Assignment Problems Chapter 9: Hillier and Lieberman

Mathematical Model for P&T

Transportation Problem Cont. Subject to:𝑥11 + 𝑥12 + 𝑥13 + 𝑥14 = 75

𝑥21+𝑥22 + 𝑥23 + 𝑥24 = 125

𝑥31+𝑥32 + 𝑥33 + 𝑥34 = 100

𝑥11 + 𝑥21 + 𝑥31 = 80

𝑥12 +𝑥22 + 𝑥32 = 65

𝑥13 +𝑥23 + 𝑥33 = 70

𝑥14 +𝑥24 + 𝑥34 = 85𝑥𝑖𝑗 ≥ 0 (𝑖 = 1,2,3; 𝑗 = 1,2,3,4)

Page 9: The Transportation and Assignment Problemsagribusiness.calpoly.edu/shurley/agb328/AGB328Lecture6.pdf · The Transportation and Assignment Problems Chapter 9: Hillier and Lieberman

Transportation Problems

Transportation problems are characterized by

problems that are trying to distribute

commodities from any supply center, known as

sources, to any group of receiving centers,

known as destinations

Two major assumptions are needed in these

types of problems:

◦ The Requirements Assumption

◦ The Cost Assumption

Page 10: The Transportation and Assignment Problemsagribusiness.calpoly.edu/shurley/agb328/AGB328Lecture6.pdf · The Transportation and Assignment Problems Chapter 9: Hillier and Lieberman

Transportation Assumptions

The Requirement Assumption

◦ Each source has a fixed supply which must be distributed to destinations, while each destination has a fixed demand that must be received from the sources

The Cost Assumption

◦ The cost of distributing commodities from the source to the destination is directly proportional to the number of units distributed

Page 11: The Transportation and Assignment Problemsagribusiness.calpoly.edu/shurley/agb328/AGB328Lecture6.pdf · The Transportation and Assignment Problems Chapter 9: Hillier and Lieberman

Feasible Solution Property

A transportation problem will have a

feasible solution if and only if the sum of

the supplies is equal to the sum of the

demands.

◦ Hence the constraints in the transportation

problem must be fixed requirement

constraints met with equality.

Page 12: The Transportation and Assignment Problemsagribusiness.calpoly.edu/shurley/agb328/AGB328Lecture6.pdf · The Transportation and Assignment Problems Chapter 9: Hillier and Lieberman

The General Model of a

Transportation Problem Any problem that attempts to minimize

the total cost of distributing units of

commodities while meeting the

requirement assumption and the cost

assumption and has information

pertaining to sources, destinations,

supplies, demands, and unit costs can be

formulated into a transportation model

Page 13: The Transportation and Assignment Problemsagribusiness.calpoly.edu/shurley/agb328/AGB328Lecture6.pdf · The Transportation and Assignment Problems Chapter 9: Hillier and Lieberman

Visualizing the Transportation Model

When trying to model a transportation

model, it is usually useful to draw a

network diagram of the problem you are

examining

◦ A network diagram shows all the sources,

destinations, and unit cost for each source to

each destination in a simple visual format like

the example on the next slide

Page 14: The Transportation and Assignment Problemsagribusiness.calpoly.edu/shurley/agb328/AGB328Lecture6.pdf · The Transportation and Assignment Problems Chapter 9: Hillier and Lieberman

Network Diagram

Source 1

Source 2

Source 3

Source m

.

.

.

Destination 1

Destination 2

Destination 3

Destination n

.

.

.

Supply

S1

S2

S3

Sm

Demand

-D1

-D2

-D3

-Dn

c11

c12c13c1n

c21

c22c23

c2nc31

c32

c33

c3n

cm1

cm2

cm3

cmn

Page 15: The Transportation and Assignment Problemsagribusiness.calpoly.edu/shurley/agb328/AGB328Lecture6.pdf · The Transportation and Assignment Problems Chapter 9: Hillier and Lieberman

General Mathematical Model of

Transportation Problems

Minimize Z= 𝑖=1𝑚 𝑗=1

𝑛 𝑐𝑖𝑗𝑥𝑖𝑗Subject to: 𝑗=1𝑛 𝑥𝑖𝑗 = 𝑠𝑖 for I =1,2,…,m

𝑖=1

𝑚

𝑥𝑖𝑗 = 𝑑𝑗 𝑓𝑜𝑟 𝑗 = 1,2,… , 𝑛

𝑥𝑖𝑗 ≥ 0, 𝑓𝑜𝑟 𝑎𝑙𝑙 𝑖 𝑎𝑛𝑑 𝑗

Page 16: The Transportation and Assignment Problemsagribusiness.calpoly.edu/shurley/agb328/AGB328Lecture6.pdf · The Transportation and Assignment Problems Chapter 9: Hillier and Lieberman

Integer Solutions Property

If all the supplies and demands have

integer values, then the transportation

problem with feasible solutions is

guaranteed to have an optimal solution

with integer values for all its decision

variables

◦ This implies that there is no need to add

restrictions on the model to force integer

solutions

Page 17: The Transportation and Assignment Problemsagribusiness.calpoly.edu/shurley/agb328/AGB328Lecture6.pdf · The Transportation and Assignment Problems Chapter 9: Hillier and Lieberman

Solving a Transportation Problem

When Excel solves a transportation problem, it uses the regular simplex method

Due to the characteristics of the transportation problem, a faster solution can be found using the transportation simplex method

◦ Unfortunately, the transportation simplex model is not programmed in Solver

Page 18: The Transportation and Assignment Problemsagribusiness.calpoly.edu/shurley/agb328/AGB328Lecture6.pdf · The Transportation and Assignment Problems Chapter 9: Hillier and Lieberman

Modeling Variants of Transportation

Problems In many transportation models, you are

not going to always see supply equals demand

With small problems, this is not an issue because the simplex method can solve the problem relatively efficiently

With large transportation problems it may be helpful to transform the model to fit the transportation simplex model

Page 19: The Transportation and Assignment Problemsagribusiness.calpoly.edu/shurley/agb328/AGB328Lecture6.pdf · The Transportation and Assignment Problems Chapter 9: Hillier and Lieberman

Issues That Arise with

Transportation Models Some of the issues that may arise are:

◦ The sum of supply exceeds the sums of demand

◦ The sum of the supplies is less than the sum of demands

◦ A destination has both a minimum demand and maximum demand

◦ Certain sources may not be able to distribute commodities to certain destinations

◦ The objective is to maximize profits rather than minimize costs

Page 20: The Transportation and Assignment Problemsagribusiness.calpoly.edu/shurley/agb328/AGB328Lecture6.pdf · The Transportation and Assignment Problems Chapter 9: Hillier and Lieberman

Method for Handling Supply Not

Equal to Demand When supply does not equal demand, you can

use the idea of a slack variable to handle the

excess

A slack variable is a variable that can be

incorporated into the model to allow inequality

constraints to become equality constraints

◦ If supply is greater than demand, then you need a

slack variable known as a dummy destination

◦ If demand is greater than supply, then you need a

slack variable known as a dummy source

Page 21: The Transportation and Assignment Problemsagribusiness.calpoly.edu/shurley/agb328/AGB328Lecture6.pdf · The Transportation and Assignment Problems Chapter 9: Hillier and Lieberman

Handling Destinations that Cannot

Be Delivered To There are two ways to handle the issue

when a source cannot supply a particular

destination

◦ The first way is to put a constraint that does

not allow the value to be anything but zero

◦ The second way of handling this issue is to

put an extremely large number into the cost

of shipping that will force the value to equal

zero

Page 22: The Transportation and Assignment Problemsagribusiness.calpoly.edu/shurley/agb328/AGB328Lecture6.pdf · The Transportation and Assignment Problems Chapter 9: Hillier and Lieberman

Textbook Transportation Models

Examined P&T

◦ A typical transportation problem

◦ Could there be another formulation?

Northern Airplane

◦ An example when you need to use the Big M Method and utilizing dummy destinations for excess supply to fit into the transportation model

Metro Water District

◦ An example when you need to use the Big M Method and utilizing dummy sources for excess demand to fit into the transportation model

Page 23: The Transportation and Assignment Problemsagribusiness.calpoly.edu/shurley/agb328/AGB328Lecture6.pdf · The Transportation and Assignment Problems Chapter 9: Hillier and Lieberman

The Transportation Simplex Method

While the normal simplex method can

solve transportation type problems, it

does not necessarily do it in the most

efficient fashion, especially for large

problems.

The transportation simplex is meant to

solve the problems much more quickly.

Page 24: The Transportation and Assignment Problemsagribusiness.calpoly.edu/shurley/agb328/AGB328Lecture6.pdf · The Transportation and Assignment Problems Chapter 9: Hillier and Lieberman

Finding an Initial Solution for the

Transportation Simplex Northwest Corner Rule

◦ Let xs,d stand for the amount allocated to supply

row s and demand row d

◦ For x1,1 select the minimum of the supply and

demand for supply 1 and demand 1

◦ If any supply is remaining then increment over to

xs,d+1, otherwise increment down to xs+1,d

For this next variable select the minimum of the leftover

supply or leftover demand for the new row and column

you are in

Continue until all supply and demand has been allocated

Page 25: The Transportation and Assignment Problemsagribusiness.calpoly.edu/shurley/agb328/AGB328Lecture6.pdf · The Transportation and Assignment Problems Chapter 9: Hillier and Lieberman

Finding an Initial Solution for the

Transportation Simplex Vogel’s Approximation Method

◦ For each row and column that has not been deleted, calculate the difference between the smallest and second smallest in absolute value terms (ties mean that the difference is zero)

◦ In the row or column that has the highest difference, find the lowest cost variable in it

◦ Set this variable to the minimum of the leftover supply or demand

◦ Delete the supply or demand row/column that was the minimum and go back to the top step

Page 26: The Transportation and Assignment Problemsagribusiness.calpoly.edu/shurley/agb328/AGB328Lecture6.pdf · The Transportation and Assignment Problems Chapter 9: Hillier and Lieberman

Finding an Initial Solution for the

Transportation Simplex Russell’s Approximation Method

◦ For each remaining source row i, determine the

largest unit cost cij and call it 𝑢𝑖◦ For each remaining destination column j,

determine the largest unit cost cij and call it 𝑣𝑖◦ Calculate ∆𝑖𝑗= 𝑐𝑖𝑗 − 𝑢𝑖 − 𝑣𝑗 for all xij that have

not previously been selected

◦ Select the largest corresponding xij that has the

largest negative ∆ij

Allocate to this variable as much as feasible based on the

current supply and demand that are leftover

Page 27: The Transportation and Assignment Problemsagribusiness.calpoly.edu/shurley/agb328/AGB328Lecture6.pdf · The Transportation and Assignment Problems Chapter 9: Hillier and Lieberman

Algorithm for Transportation

Simplex Method Construct initial basic feasible solution

Optimality Test

◦ Derive a set of ui and vj by setting the ui

corresponding to the row that has the most

amount of allocations to zero and solving the

leftover set of equations for cij = ui + vj

If all cij – ui – vj ≥ 0 for every (i,j) such that xij is

nonbasic, then stop. Otherwise do an iteration.

Page 28: The Transportation and Assignment Problemsagribusiness.calpoly.edu/shurley/agb328/AGB328Lecture6.pdf · The Transportation and Assignment Problems Chapter 9: Hillier and Lieberman

Algorithm for Transportation

Simplex Method Cont. An Iteration◦ Determine the entering basic variable by

selecting the nonbasic variable having the largest negative value for cij – ui – vj

◦ Determine the leaving basic variable by identifying the chain of swaps required to maintain feasibility

◦ Select the basic variable having the smallest variable from the donor cells

◦ Determine the new basic feasible solution by adding the value of the leaving basic variable to the allocation for each recipient cell. Subtract this value from the allocation of each donor

cell

Page 29: The Transportation and Assignment Problemsagribusiness.calpoly.edu/shurley/agb328/AGB328Lecture6.pdf · The Transportation and Assignment Problems Chapter 9: Hillier and Lieberman

Assignment Problems

Assignment problems are problems that

require tasks to be handed out to

assignees in the cheapest method possible

The assignment problem is a special case

of the transportation problem

Page 30: The Transportation and Assignment Problemsagribusiness.calpoly.edu/shurley/agb328/AGB328Lecture6.pdf · The Transportation and Assignment Problems Chapter 9: Hillier and Lieberman

Characteristics of Assignment

Problems The number of assignees and the number of

task are the same

Each assignee is to be assigned exactly one task

Each task is to be assigned by exactly one assignee

There is a cost associated with each combination of an assignee performing a task

The objective is to determine how all of the assignments should be made to minimize the total cost

Page 31: The Transportation and Assignment Problemsagribusiness.calpoly.edu/shurley/agb328/AGB328Lecture6.pdf · The Transportation and Assignment Problems Chapter 9: Hillier and Lieberman

General Mathematical Model of

Assignment Problems

Minimize Z= 𝑖=1𝑛 𝑗=1

𝑛 𝑐𝑖𝑗𝑥𝑖𝑗Subject to: 𝑗=1𝑛 𝑥𝑖𝑗 = 1 for I =1,2,…,m

𝑖=1

𝑛

𝑥𝑖𝑗 = 1 𝑓𝑜𝑟 𝑗 = 1,2,… , 𝑛

𝑥𝑖𝑗 𝑖𝑠 𝑏𝑖𝑛𝑎𝑟𝑦, 𝑓𝑜𝑟 𝑎𝑙𝑙 𝑖 𝑎𝑛𝑑 𝑗

Page 32: The Transportation and Assignment Problemsagribusiness.calpoly.edu/shurley/agb328/AGB328Lecture6.pdf · The Transportation and Assignment Problems Chapter 9: Hillier and Lieberman

Modeling Variants of the Assignment

Problem Issues that arise:

◦ Certain assignees are unable to perform certain tasks.

◦ There are more task than there are assignees, implying some tasks will not be completed.

◦ There are more assignees than there are tasks, implying some assignees will not be given a task.

◦ Each assignee can be given multiple tasks simultaneously.

◦ Each task can be performed jointly by more than one assignee.

Page 33: The Transportation and Assignment Problemsagribusiness.calpoly.edu/shurley/agb328/AGB328Lecture6.pdf · The Transportation and Assignment Problems Chapter 9: Hillier and Lieberman

Assignment Spreadsheet Models

from Textbook Job Shop Company

Better Products Company

◦ We will examine these spreadsheets in class and derive mathematical models from the spreadsheets

Page 34: The Transportation and Assignment Problemsagribusiness.calpoly.edu/shurley/agb328/AGB328Lecture6.pdf · The Transportation and Assignment Problems Chapter 9: Hillier and Lieberman

Hungarian Algorithm for Solving

Assignment Problems Step 1: Find the minimum from each row and subtract

from every number in the corresponding row making a new table

Step 2: Find the minimum from each column and subtract from every number in the corresponding column making a new table

Step 3: Test to see whether an optimal assignment can be made by examining the minimum number of lines needed to cover all the zeros◦ If the number of lines corresponds to the number of rows,

you have the optimal and you should go to step 6

◦ If the number of lines does not correspond to the number of rows, go to step 4

Page 35: The Transportation and Assignment Problemsagribusiness.calpoly.edu/shurley/agb328/AGB328Lecture6.pdf · The Transportation and Assignment Problems Chapter 9: Hillier and Lieberman

Hungarian Algorithm for Solving

Assignment Problems Cont. Step 4: Modify the table by using the

following:

◦ Subtract the smallest uncovered number from

every uncovered number in the table

◦ Add the smallest uncovered number to the

numbers of intersected lines

◦ All other numbers stay unchanged

Step 5: Repeat steps 3 and four until you

have the optimal set

Page 36: The Transportation and Assignment Problemsagribusiness.calpoly.edu/shurley/agb328/AGB328Lecture6.pdf · The Transportation and Assignment Problems Chapter 9: Hillier and Lieberman

Hungarian Algorithm for Solving

Assignment Problems Cont. Step 6: Make the assignment to the optimal

set one at a time focusing on the zero elements

◦ Start with the rows and columns that have only one zero

Once an optimal assignment has been given to a variable, cross that row and column out

Continue until all the rows and columns with only one zero have been allocated

Next do the columns/rows with two non crossed out zeroes as above

Continue until all assignments have been made

Page 37: The Transportation and Assignment Problemsagribusiness.calpoly.edu/shurley/agb328/AGB328Lecture6.pdf · The Transportation and Assignment Problems Chapter 9: Hillier and Lieberman

In Class Activity (Not Graded)

Attempt to find an initial solution to the P&T problem using the a) Northwest Corner Rule, b) Vogel’s Approximation Method, and c) Russell’s Approximation Method

9.1-3b, set up the problem as a regular linear programming problem and solve using solver, then set the problem up as a transportation problem and solve using solver

Page 38: The Transportation and Assignment Problemsagribusiness.calpoly.edu/shurley/agb328/AGB328Lecture6.pdf · The Transportation and Assignment Problems Chapter 9: Hillier and Lieberman

In Class Activity (Not Graded)

Solve the following problem using the

Hungarian method.

Page 39: The Transportation and Assignment Problemsagribusiness.calpoly.edu/shurley/agb328/AGB328Lecture6.pdf · The Transportation and Assignment Problems Chapter 9: Hillier and Lieberman

Case Study: Sellmore Company

Cont. The assignees for the task are:

◦ Ann

◦ Ian

◦ Joan

◦ Sean

A summary of each assignees productivity

and costs are given on the next slide.

Page 40: The Transportation and Assignment Problemsagribusiness.calpoly.edu/shurley/agb328/AGB328Lecture6.pdf · The Transportation and Assignment Problems Chapter 9: Hillier and Lieberman

Case Study: Sellmore Company Cont.

Required Time Per Task

Employee Word

Processing

Graphics Packets Registration Wage

Ann 35 41 27 40 $14

Ian 47 45 32 51 $12

Joan 39 56 36 43 $13

Sean 32 51 25 46 $15

Page 41: The Transportation and Assignment Problemsagribusiness.calpoly.edu/shurley/agb328/AGB328Lecture6.pdf · The Transportation and Assignment Problems Chapter 9: Hillier and Lieberman

Assignment of Variables

xij

◦ i = 1 for Ann, 2 for Ian, 3 for Joan, 4 for Sean

◦ j = 1 for Processing, 2 for Graphics, 3 for

Packets, 4 for Registration

Page 42: The Transportation and Assignment Problemsagribusiness.calpoly.edu/shurley/agb328/AGB328Lecture6.pdf · The Transportation and Assignment Problems Chapter 9: Hillier and Lieberman

Mathematical Model for Sellmore

Company

34333231

34333231

24232221

14131211

,,,

,,,

,,,

690375765480

559468728507

612384540564

560378574490

34333231

24232221

14131211

xxxx

xxxx

xxxx

xxxx

Minimize

xxxx

xxxx

xxxx

Page 43: The Transportation and Assignment Problemsagribusiness.calpoly.edu/shurley/agb328/AGB328Lecture6.pdf · The Transportation and Assignment Problems Chapter 9: Hillier and Lieberman

Mathematical Model for Sellmore

Company Cont.

1

1

1

1

0,,,1

0,,,1

0,,,1

0,,,1

1

1

1

1

:

44342414

43332313

42322212

41312111

34333231

34333231

24232221

14131211

44434241

34333231

24232221

14131211

xxxx

xxxx

xxxx

xxxx

xxxx

xxxx

xxxx

xxxx

xxxx

xxxx

xxxx

xxxx

toSubject