You are on page 1of 11

Transportation Problem: Optimizing the traveling

distances between food suppliers and supermarket chains


system. Industry: Food company

Name Student ID Contribution (%)


Trần Tiến Đạt (leader) IELSIU20282 100
Đặng Thị Bảo Ngọc IEIEIU20069 100
Nguyễn Thị Thanh Huyền IEIEIU20059 100
Liêu Khánh Như IEIEIU20075 100
Nguyễn Đức Trí IEIEIU20094 100
Đỗ Thành Duy IEIEIU20048 100
Table of Contents
I. Introduction...........................................................................................3
1. Background Study..........................................................................3
2. Linear programming (LP).............................................................3
3. Proposed Model..............................................................................3
4. Scope and Limitation.....................................................................4

II. Mathematical Model...........................................................................4


1. Notations..........................................................................................4
2. Generated data................................................................................5
3. Objective function...........................................................................5
4. Constraints......................................................................................5

III. Solve the Mathematical Model using PyCharm..............................6


1. Model Developing in PyCharm.....................................................6
2. Results (Optimal solution) calculated in PyCharm.....................7

IV. Sensitivity Analysis............................................................................8


1. Method Explanation.......................................................................8
2. Input Data Adjustment..................................................................8

V. Conclusion..........................................................................................10
1. Summary.......................................................................................10
2. Appendix.......................................................................................10
I. Introduction
1. Background Study
Operation Research (OR) is the study of applying mathematics to assist businesses in
answering their questions and providing them with helpful information in decision
making. Some of the fundamental mathematical concepts and computer techniques of
optimization that are introduced by OR include linear programming, the theory of
optimum decision-making with a linear objective function, and under linear resource
constraints. OR has a wide range of potential applications, including the following: 

Scheduling and time management, urban and agricultural planning, business resource
planning and supply chain management, inventory management, network
optimization and engineering, packet routing optimization, risk management are some
of the responsibilities that fall under the management umbrella. 

2. Linear programming (LP)


LP is a mathematical technique used to optimize a system. In the context of food
suppliers and supermarket chains, linear programming can minimize costs while
meeting the demand for various products. This involves finding the optimal
distribution of products from suppliers to stores, taking into account factors such as
transportation costs, inventory management, and customer demand. Using linear
programming, food suppliers and supermarket chains can improve efficiency and
profitability.
 Components of Linear Programming problem:
 Variables: These parameters may be numerical (actual numbers) as in the
number or quantity of products required for production, or binary for a
Yes/No decision as to whether or not a distribution centre is accessible. Such
variables' optimal values are determined by linear programming.
 Objective Functions: such as the maximal profit function, are linear functions
of the variables of an optimization. The optimal value of the problem will be
determined by establishing bounds between the parameters and variables.
 Constraints: are linear functions of an optimization's variables and are used
to limit the values an optimization may return for a variable. Constraints must
be linear Boolean functions. Examples of constraints include a specified
budget allocation ratio or a factory's maximum production capacity.

3. Proposed Model
We are going to propose a problem in which we will optimize the travel distance
between food suppliers and a supermarket chain system. To solve the transporting
problem, we decide to use linear programming in an optimization software to
minimize the relevant delivery costs, therefore, earning a maximization of the net
profit. The system we propose includes 2 food suppliers and 10 supermarkets in a
chain, for the convenience of solving the problem, the food suppliers will be called
once S1 and S2, and supermarkets will be hit once in alphabetical order from A to J.
The costs of transshipping between the food suppliers and the supermarkets are
connected to ci.
A food company has supplied food to supermarket chains. Suppose companies only
use refrigerated trucks to transport food to supermarket chains. Our use of refrigerated
trucks is to preserve the best food quality and meet regulatory transport requirements.

 System Diagram:

4. Scope and Limitation


 Scope: In this project, we aim to solve an assume transportation problem, we
want to achieve the minimum costs of transshipment while still attain the
customer satisfaction by fully cover the demand of all the supermarkets in the
chain.

 Limitation: This problem will be considered as a case study utilizing the


provided information, and the problem's scope will be regarded as too minor and
unrealistic. Therefore, this problem cannot serve as a model for the LP
application paradigm in actual life. In real case study, a transportation problem
can be affected by others external factor, such as traffic condition, weather,
defective rate of goods, etc, which are not included in our case study. So this
report is just for running and testing an assume LP transportation problem using
mathematical software, and the applicability of the model is not high if running in
actual cases.

II. Mathematical Model


1. Notations

Table I. Indexes
i Index of food supplier
j Index of supermarket
Table II. Parameters
cij Transportation cost occurred from suppliers i and supermarkets j
Dj Demand of supermarket j
Cai Capacity of suppliers i

Table III. Decision Variable


xi number of products to be delivered (1 ≤ i ≤ 20, i ∈ N)

For 1 ≤ i ≤ 10, xi will represent the number of products to be delivered from Supplier
1 to Supermarket A to J respectively.
For 10 ≤ i ≤ 20, xi will represent the number of products to be delivered from Supplier
2 to Supermarket A to J respectively.

2. Generated data
The table below gives the cost incurred during the transportation of goods from
Suppliers 1 and 2 to the 10 supermarkets in the chain, besides, the capacity of the
suppliers and demand for each supermarket is also identified as follows: 

Table IV. Auto-generated data


Cost (cij) A B C D E F G H I J Capacity (Cai)
Supplier 1 108 23 91 45 57 68 33 74 56 45 850
(x1) (x2) (x3) (x4) (x5) (x6) (x7) (x8) (x9) (x10)
Supplier 2 74 87 122 95 68 135 88 155 77 99 900
(x11) (x12) (x13) (x14) (x15) (x16) (x17) (x18) (x19) (x20)
Demand (Dj) 160 110 200 140 120 210 100 230 140 150

Costs unit: $
Demand and Capacity unit: Kilograms of fresh items

3. Objective function
Min Z = ∑ xi ci
= 108x1 + 23x2+ 91x3 + 45x4 + 57x5 + 68x6 + 33x7 + 74x8 + 56x9 + 45x10 +
74x11 + 87x12 + 122x13 + 95x14 + 68x15 + 135x16 + 88x17 + 155 x18 + 77x19 + 99x20

4. Constraints
 Demand constraints: The total products purchased from the two suppliers must
satisfy the demand of the supermarkets.
x1 + x11 = 160                                                                                          x6 + x16 = 210
x2 + x12 = 110                                                                     x7 + x17 = 100
x3 + x13 = 200                                                                     x8 + x18 = 230
x4 + x14 = 140                                                                     x9 + x19 = 140
x5 + x15 = 120                                                                     x10 + x20 = 150

 Capacity: Suppliers’ capacity need to fully cover the demand of the


supermarkets.
x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9 + x10  ≤ 850
x11 + x12 + x13 + x14 + x15 + x16 + x17 + x18 + x19 + x20  ≤ 900

 Non-negative constraint: The quantities purchased must be integer and at least 0


units.
xi ≥ 0

III. Solve the Mathematical Model using PyCharm


1. Model Developing in PyCharm
In order to find the optimal solution, and the revenue is maximized, the LP model was
processed and encoded in PyCharm ver.2022.1.3, using Python programming
language and optimization library provided by Gurobi. The code is keyed in as
follows:

Figure 1: Importing Gurobi library in Python

Figure 2: Data Input

Figure 3: Creating a Gurobi Model for solving LP Problem

Figure 4: Decision Variables Declaration

Figure 5: Objective Function


Figure 6: Constraints

Figure 7: Update the Model

Figure 8: Solving and Printing the Result

 Explanation: In order to work with the Gurobi library, we used Python


Interpreter to install the Gurobipy add-on. Next, we used the import function to
use the library provided by Gurobi (Figure 1). Afterward, we declared the given
data, decision variables, objective function, and constraints which can be
searched in the Mathematical Model Forming Section. And ‘model.update()’ was
typed for updating the Model with Objective Function and Constraints. Finally,
the Model was solved using optimize function and printed out for results. If there
is a solution, the model will interpret the results, else, it will print out
‘Infeasable’.

2. Results (Optimal solution) calculated in PyCharm


After the LP model was calculated, we came up with a solution of $109,860.0 as
minimum costs for the problem, followed by a list of decision variables. A piece of
more detailed information is shown in Figure 9 below.
Figure 9: Objective and Decision Variables Values

This means that we will achieve the minimum cost of transportation of $109,860.0
when we order as calculated model:

Table V. Order Planning


A B C D E F G H I J Capacity (Cai)
Supplier 1 0 110 0 50 0 210 100 230 0 150 850
Supplier 2 160 0 200 90 120 0 0 0 140 0 900
Demand (Dj) 160 110 200 140 120 210 100 230 140 150

IV. Sensitivity Analysis


1. Method Explanation
Sensitivity analysis is the study of the division and allocation of the many sources of
input uncertainty to the output uncertainty of a mathematical model, the risk during
the project is minimized. DMs, therefore, can choose a safe strategy based on
potential changes in reality.

2. Input Data Adjustment


Input data adjustment is the crucial beginning process in sensitivity, as decided, our
group has picked demand as a component for this analysis method. The reason for
choosing demand is that demand is an uncontrollable factor in actual cases, although
the forecasting method is taken, errors are inevitable. We conducted a sensitivity
analysis as we wanted to check for the applicability of the model, if there is an
increase in supermarket demands, will the supplier be able to keep enough stock for
distribution or not?

Table VI. 10% increase in demand


Demand (Dj) 160 110 200 140 120 210 100 230 140 150
→ 176 121 220 154 132 231 110 253 154 165

Figure 10: Objective and Decision Variables Values when demand is 10% increased

When demand is increased by 10%, the minimum cost also increases as a result, with
a new value of $125,216.0, and the order planning is also changed as can be observed
in Figure 10. But we still came up with the result, the model is able to run when the
demand is increase by 10%.

But what about 20% increase in demand?

Table VII. 20% increase in demand


Demand (Dj) 160 110 200 140 120 210 100 230 140 150
→ 192 132 240 168 144 252 120 276 168 180
Figure 11: The model is infeasible when demand is 20% increased

Through the sensitivity analysis, we can observe that when demand changes at a rate
of +20%, the model will become infeasible, which means that the capacities of the
two food suppliers cannot cover all the demand of all supermarkets in the chain. As
demand is an uncontrollable factor in actual operation, our group suggests that the
suppliers should expand their warehouses, and increase carrying capacities to prevent
stockout in their operation. As stockout is a severe problem in their business,
customers can seek other suppliers and the firm may face a loss in their profit as well
as their reputation.

V. Conclusion
1. Summary
In conclusion, linear programming is an effective mathematical technique for
optimizing systems, particularly in the context of food suppliers and supermarket
chains. By utilizing linear programming, it is possible to minimize costs while
meeting the demand for various products, taking into account factors such as
transportation costs, inventory management, and customer demand. In this project, we
proposed a transportation problem where we optimized the travel distance between
food suppliers and a supermarket chain system. By utilizing linear programming in an
optimization software, we were able to minimize the relevant delivery costs and
maximize the net profit. Besides, we can have a closer look into the applicability of
the model through implementation of the sensitivity analysis, by changing the
uncontrollable factor like demand. This is a necessity in checking for applicability of
the model, as sometimes demand may exceed the capacities of the suppliers, stockout
may incur and cause a loss in profit and firm’s reputation as a result. After the
implementation of this project, our group aims to solve more complicated problems in
Logistics and supply chain management in our latter career. This project should be
served as a concrete foundation for more optimization problems that we have to deal
with in the future.

2. Appendix
 Code in Python:
from gurobipy import *

# Define the Given Data


demands = [160, 110, 200, 140, 120, 210, 100, 230, 140, 150]
costs = [108, 23, 91, 45, 57, 68, 33, 74, 56, 45, 74, 87, 122, 95,
68, 135, 88, 155, 77, 99]
capacities = [850, 900]
demands = [176, 121, 220, 154, 132, 231, 110, 253, 154, 165]
demands = [192, 132, 240, 168, 144, 252, 120, 276, 168, 180]
# Create a new Gurobi model
model = Model('Route Optimization Model')
# Decision Variables
x = {}
for i in range(1, 21):
x[i] = model.addVar(vtype=GRB.INTEGER, lb=0,
name='x{}'.format(i))

# Objective Function
model.setObjective(quicksum(costs[i-1]*x[i] for i in range(1, 21)),
GRB.MINIMIZE)

# Subject to
for i in range(1, 11):
model.addConstr(x[i] + x[i+10] == demands[i-1])
model.addConstr(quicksum(x[i] for i in range(1, 11)) <=
capacities[0])
model.addConstr(quicksum(x[i] for i in range(11, 21)) <=
capacities[1])

# Update the model


model.update()

# Solve the model


model.optimize()

# Print out the result


if model.status == GRB.INFEASIBLE:
print('Infeasible')
else:
print('Status:', model.status)
print('Minimum cost = $', model.ObjVal, ',where:')

for i in range(1, 21):


unit = 'kgs' if x[i].X > 1 else 'kg'
print('x{} = {} {}'.format(i, x[i].X, unit))

You might also like