Chapter 7 - Transportation Model (Part 1)
Chapter 7 - Transportation Model (Part 1)
CHAPTER 7: ILP -
TRANSPORTATION MODEL
(PART 1)
2
The Transportation Model
§ There are m sources and n destinations, each represented by a node. The arcs (i, j)
represent the routes linking the sources and the destinations.
§ To develop a model of a transportation problem, it is necessary to have the following
information:
o Supply quantity (capacity) at source i, si, ,.
o Demand quantity of each destination j, dj.
o 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.
§ The objective of the model is to minimize the total transportation cost while satisfying
all the supply and demand restrictions.
3
The Transportation Model
Schematic of a Transportation Problem
4
The Transportation Model
Balanced Transportation Problem
𝑥𝑖𝑗 for all i and j is said to be balanced transportation problem when total supply from all the sources is
equal to the total demand in all destinations. Otherwise, problem is said to be unbalanced transportation
problem.
5
The Transportation Model
6
The Transportation Model
Unbalanced Transportation Problem
The unit transportation cost for the dummy supply variable and dummy
demand variable are assigned zero values, because no shipment is made.
7
Example 1
How many tons of wheat to transport from each grain elevator to each mill on a
monthly basis in order to minimize the total cost of transportation?
8
Example 1 (cont’d)
200
Minimize Z = 6x1A + 8x1B + 10x1C + 7x2A + 11x2B + 11x2C + 4x3A + 5x3B + 12x3C
subject to:
x1A + x1B + x1C = 150 (Supply from Kansas City)
x2A + x2B + x2C = 175 (Supply from Kansas Omaha)
x3A + x3B + x3C = 275 (Supply from Kansas Des Moines)
x1A + x2A + x3A = 200 (Demand at St. Louis)
x1B + x2B + x3B = 100 (Demand at Cincinnati)
x1C + x2C + x3C = 300
xmn ³ 0
xmn = tons of wheat from each grain elevator, m, m = 1, 2, 3, to each mill n, n = A,B,C
10
Example 1 (cont’d)
11
Example 1 (cont’d)
Transportation Model Solution Using Excel Solver
12
Example 1 (cont’d)
13
Example 1 (cont’d)
14
Example 1 (cont’d)
Transportation Model Solution Using Python
1. Import library (PuLP) and define node and capacities
#Import PuLP modeler functions
from pulp import *
#Creates a dictionary for the number of units of supply for each supply node
supply = {"1": 150,
"2": 175,
"3": 275}
#Creates a list of all demand nodes
Mills = ["A", "B", "C"]
#Creates a dictionary for the number of units of demand for each demand node
demand = {"A":200,
"B":100,
"C":300 }
15
Example 1 (cont’d)
Transportation Model Solution Using Python (cont’d)
2. Define cost shipping
The cost data is then inputted into a list, containing the costs of shipping from the supply to demand
nodes. Note here that the commenting and structure of the code makes the data appear as a table for
easy editing. The Grain Elevator and Mills lists (Supply and Demand nodes) are added to make a large list
(of all nodes) and inputted into PuLPs makeDict function.
16
Example 1 (cont’d)
17
Example 1 (cont’d)
# Creates a list of tuples containing all the possible routes for transport
Routes = [(i,j) for i in GrainE for j in Mills]
18
Example 1 (cont’d)
19
Example 1 (cont’d)
# The supply maximum constraints are added to prob for each supply node (Grain Elavator)
for i in GrainE:
prob += lpSum([vars[i][j] for j in Mills]) ==supply[i], "Sum_of_Products_out_of_GrainE_%s"%i
20
Example 1 (cont’d)
# The demand minimum constraints are added to prob for each demand node (Mills)
for j in Mills:
prob += lpSum([vars[i][j] for i in GrainE]) ==demand[j], "Sum_of_Products_into_Mill%s"%j
21
Example 1 (cont’d)
22
Example 1 (cont’d)
23
Example 1 (cont’d)
24
Example 1 (cont’d)
25
Exercise
A Cola Company has two warehouses from which it distributes cola to five carefully
chosen stores. At the start of every week, each stores sends an order to the Cola
Company head office, the Cola is then dispatched from the appropriate
warehouse to the store. The Cola company would like to have an interactive
computer program which they can run week by week to tell them which
warehouse should supply which store so as to minimize the costs of the whole
operation.
Suppose that at the start of a given week the company has 1000 cases of Cola
cans at warehouse A, and 4000 cases of Cola cans at warehouse B, and that the
stores(1,2,3,4,5) require 500, 900, 1800, 200, and 700 cases, respectively. Which
warehouse should supply which store?
26
Exercise
27