The Optimization of Logistics Distribution Route Based On Dijkstra's Algorithm and C-W Savings Algorithm
The Optimization of Logistics Distribution Route Based On Dijkstra's Algorithm and C-W Savings Algorithm
The Optimization of Logistics Distribution Route Based On Dijkstra's Algorithm and C-W Savings Algorithm
Abstract. The optimization problem of vehicle distribution routing could be summarized as vehicle
routing problem (VRP). The paper simply introduced logistics distribution VRP, established the
corresponding optimization model of distribution routing by Dijkstra's Algorithm and Savings
Algorithm based on MATLAB software, and verified the effectiveness of the combinational
algorithm in accordance with example analysis. According to the results, Dijkstra's Algorithm and
Savings Algorithm could optimize logistics distribution routing, effectively reduce distribution
mileage and the number of the distributed vehicles, and thus achieve the goal of improving the
distribution efficiency, reducing distribution costs, and relieving traffic pressure.
Introduction
As the core function of the logistics system, distribution is directly connected with terminal clients.
The performance of the distribution function and its service level directly influence the logistics
cost of companies and the satisfaction level of the client for the whole logistics service. The core
part of distribution is the process of goods consolidation, sorting and delivery of distribution
vehicles. Among this, the reasonable optimization of the distribution routes for the vehicles is
significant for the speed, cost, and efficiency of the whole logistics transportation. Because that the
transportation cost includes most cost of the logistics center and the urban transportation grows
crowded in recent years, the significance of optimizing the route of the distribution vehicles is
underpinned (Bardi et al., 2002). Logistics distribution centers play an important role in the goods
transportation, aiming to reduce the transportation cost effectively. Therefore, the route of the
distribution vehicles and the schedule planning are very important operation decisions and normally
they are a kind of vehicle routing problem (VRP).
958
Fig. 1. Relative position and distances of the warehouse & distribution center and distribution sites
959
end
[value,index] = min(temp);
visit(index) = 0;
% Updating: if the index node is passed through, the length of path from the starting point
to each node will be smaller, then update. Record the front node to facilitate the later back tracking.
for k=1:n
if D(k)>D(index)+W(index,k)
D(k) = D(index)+W(index,k);
parent(k) = index;
end
end
end
distance = D(e); % The shortest distance
% Backtracking method: to find search path from the end to the front.
t = e;
while t~=st && t>0
path =[t,path];
p=parent(t);t=p;
end
path =[st,path]; % The shortest route
end
(2) Build the topological graph
W=[0 35.2 inf 34.4 inf 32.2 30.7 31.7 inf inf inf inf;
35.2 0 inf 7 inf inf inf inf inf inf inf 3.2;
inf inf 0 inf 13.5 inf inf inf 15.8 13.1 inf inf;
34.4 7 inf 0 inf inf inf 8.1 inf 9.8 inf 8.3;
inf inf 13.5 inf 0 16 inf inf 18.7 inf inf inf;
32.2 inf inf inf 16 0 7.1 inf 6 inf inf inf;
30.7 inf inf inf inf 7.1 0 4.8 4.1 inf 6.1 inf;
31.7 inf inf 8.1 inf inf 4.8 0 inf 10.7 3 inf;
inf inf 15.8 inf 18.7 6 4.1 inf 0 11.6 3.7 inf;
inf inf 13.1 9.8 inf inf inf 10.7 11.6 0 9.3 15.2;
inf inf inf inf inf inf 6.1 3 3.7 9.3 0 inf;
inf 3.2 inf 8.3 inf inf inf inf inf 15.2 inf 0];
for i=1:12
for j=1:12
[distance,path]=Dijk(W,i,j);
fprintf('The shortest route from point %d to point %d is:',i-1,j-1);
path-1
format long g
fprintf('The shortest distance of the route from point %d to point %d is ',i-1,j-1);
format long g
distance
end
end
Arrange the output of MATLAB R2016a so that the shortest routes and distances of all the knots
are shown as Table 1.
960
Table 1. Computational results by MATLAB
Starting point The shortest route and distance
0→0=0, 0→1=35.2, 0→6→8→2=50.6, 0→3=34.4, 0→5→4=48.2, 0→5=32.2,
0
0→6=30.7, 0→7=31.7, 0→6→8=34.8, 0→7→9=42.4, 0→7→10=34.7, 0→1→11=38.4
1→0=35.2, 1→1=0, 1→3→9→2=29.9, 1→3=7, 1→3→7→10→8→4=40.5,
1 1→3→7→6→5=27, 1→3→7→6=19.9, 1→3→7=15.1, 1→3→7→10→8=21.8,
1→3→9=16.8, 1→3→7→10=18.1, 1→11=3.2
2→8→6→0=50.6, 2→9→3→1=29.9, 2→2=0, 2→9→3=22.9, 2→4=13.5, 2→8→5=21.8,
2 2→8→6=19.9, 2→8→10→7=22.5, 2→8=15.8, 2→9=13.1, 2→8→10=19.5,
2→9→11=28.3
3→0=34.4, 3→1=7, 3→9→2=22.9, 3→3=0, 3→7→10→8→4=33.5, 3→7→6→5=20,
3
3→7→6=12.9, 3→7=8.1, 3→7→10→8=14.8, 3→9=9.8, 3→7→10=11.1, 3→11=8.3
4→5→0=48.2, 4→8→10→7→3→1=40.5, 4→2=13.5, 4→8→10→7→3=33.5 4→4=0,
4 4→5=16, 4→8→6=22.8, 4→8→10→7=25.4, 4→8=18.7, 4→2→9=26.6, 4→8→10=22.4,
4→2→9→11=41.8
5→0=32.2, 5→6→7→3→1=27, 5→8→2=21.8, 5→6→7→3=20, 5→4=16, 5→5=0,
5
5→6=7.1, 5→6→7=11.9, 5→8=6, 5→8→9=17.6, 5→8→10=9.7, 5→6→7→3→11=28.3
6→0=30.7, 6→7→3→1=19.9, 6→8→2=19.9, 6→7→3=12.9, 6→8→4=22.8, 6→5=7.1,
6
6→6=0, 6→7=4.8, 6→8=4.1, 6→10→9=15.4, 6→10=6.1, 6→7→3→11=21.2
7→0=31.7, 7→3→1=15.1, 7→10→8→2=22.5, 7→3=8.1, 7→10→8→4=25.4,
7
7→6→5=11.9, 7→6=4.8, 7→7=0, 7→10→8=6.7, 7→9=10.7, 7→10=3, 7→3→11=16.4
8→6→0=34.8, 8→10→7→3→1=21.8, 8→2=15.8, 8→10→7→3=14.8, 8→4=18.7,
8 8→5=6, 8→6=4.1, 8→10→7=6.7, 8→8=0, 8→9=11.6, 8→10=3.7,
8→10→7→3→11=23.1
9→7→0=42.4, 9→3→1=16.8, 9→2=13.1, 9→3=9.8, 9→2→4=26.6, 9→8→5=17.6,
9
9→10→6=15.4, 9→7=10.7, 9→8=11.6, 9→9=0, 9→10=9.3, 9→11=15.2
10→7→0=34.7, 10→7→3→1=18.1, 10→8→2=19.5, 10→7→3=11.1, 10→8→4=22.4,
10 10→8→5=9.7, 10→6=6.1, 10→7=3, 10→8=3.7, 10→9=9.3, 10→10=0,
10→7→3→11=19.4
11→1→0=38.4, 11→1=3.2, 11→9→2=28.3, 11→3=8.3, 11→3→7→10→8→4=41.8,
11 11→3→7→6→5=28.3, 11→3→7→6=21.2, 11→3→7=16.4, 11→3→7→10→8=23.1,
11→9=15.2, 11→3→7→10=19.4, 11→11=0
According to Table 1, the shortest distances of all the knots can be organized as Table 2.
Table 2. The shortest distances of each node km
0 1 2 3 4 5 6 7 8 9 10 11
0 0 35.2 50.6 34.4 48.2 32.2 30.7 31.7 34.8 42.4 34.7 38.4
1 0 29.9 7 40.5 27 19.9 15.1 21.8 16.8 18.1 3.2
2 0 22.9 13.5 21.8 19.9 22.5 15.8 13.1 19.5 28.3
3 0 33.5 20 12.9 8.1 14.8 9.8 11.1 8.3
4 0 16 22.8 25.4 18.7 26.6 22.4 41.8
5 0 7.1 11.9 6 17.6 9.7 28.3
6 0 4.8 4.1 15.4 6.1 21.2
7 0 6.7 10.7 3 16.4
8 0 11.6 3.7 23.1
9 0 9.3 15.2
10 0 19.4
11 0
Utilization of C-W Savings Algorithm to optimize the distribution routes
Calculate the saved distance between distribution sites according to the savings value formula
S ij =D 0i +D 0j -D ij and rank the results in descending order so as to merger the one which has larger
saved distance from the cold-chain warehouse & distribution center to two distribution sites. The
ranking results are shown as Table 3.
961
Table 3. Ranked list of saved mileages km
Serial Saved Serial Saved Serial Saved
Route Route Route
Number Mileage Number Mileage Number Mileage
1 2→4 85.3 20 6→8 61.4 38 4→7 54.5
2 2→9 79.9 21 2→5 61 39 3→8 54.4
3 1→11 70.4 22 5→8 61 40 7→11 53.7
4 2→8 69.6 23 1→9 60.8 41 10→11 53.7
5 9→10 67.8 24 2→11 60.7 42 3→6 52.2
6 3→9 67 25 4→10 60.5 43 5→7 52
7 2→10 65.8 26 2→7 59.8 44 1→7 51.8
8 8→10 65.8 27 7→8 59.8 45 1→10 51.8
9 8→9 65.6 28 6→10 59.3 46 8→11 50.1
10 9→11 65.6 29 3→7 58 47 3→4 49.1
11 3→11 64.5 30 3→10 58 48 1→8 48.2
12 4→5 64.4 31 6→9 57.7 49 6→11 47.9
13 4→8 64.3 32 6→7 57.6 50 3→5 46.6
14 4→9 64 33 5→10 57.2 51 1→6 46
15 7→9 63.4 34 5→9 57 52 4→11 44.8
16 7→10 63.4 35 4→6 56.1 53 1→4 42.9
17 1→3 62.6 36 1→2 55.9 54 5→11 42.3
18 2→3 62.1 37 5→6 55.8 55 1→5 40.4
19 2→6 61.4
According to the logistics distribution requirement of the cold-chain warehouse & distribution
center of Y Company and the need to ensure the freshness and safety of the fresh agricultural
products, the warehouse & distribution center needs to distribute products for the distribution sites
(1~11) everyday. The daily requirements of various distribution sites are shown as Table 4.
Because the big difference of the daily demand of various distribution sites, some distribution
sites need to use lots of refrigerating cars to distribute because of the huge demand. While some
distribution sites has smaller distribution demand and the distribution products cannot fill the car so
the following distribution rules are regulated so as to better use the refrigerating cars and increase
the loading rate:
(1) As for the distribution site while has the average daily demand more than the full capacity of
the single car (3t), the goods which meet the requirements for carload will be distributed to and
from the warehouse & distribution center and the distribution sites by the distribution cars and the
goods which do not meet the requirement for carload and the goods of other distribution sites will
be distributed together.
(2) As for the distribution site which has the average daily demand less than the full capacity of
the single car (3t), the goods and the goods of other distribution sites will be distributed together.
Table 4. Average daily demand of each distribution site
Average
Average daily demand for
Serial daily Average daily demand for
Distribution site goods not to meet a
number demand goods to meet a vehicle/t
vehicle/t
/t
1 Haibawang Food Market 22.1 21 1.1
2 Baijia Market 15.3 15 0.3
3 Wal-Mart in Jinniu District 2.1 0 2.1
Wal-Mart
4 2.6 0 2.6
in Shuangliu District
5 Wal-Mart in Wuhou District 3.6 3 0.6
Wal-Mart
6 4.4 3 1.4
in Chenghua District
962
Wal-Mart
7 5 3 2
in Qingyang District
8 Dadong Commerce and Trade 7.2 6 1.2
9 Ruixin Restaurant 4.4 3 1.4
10 Zhongxin Food 8.4 6 2.4
11 Zhongxin Food 7.9 6 1.9
Total 83 66 17
Combine Table 1, Table3 and Table 4 to determine the distribution route:
Take the distribution site 2 and 4 as the example: because the saved mileage from the
distribution 2 to 4 is 85.3 km, the largest in terms of the savings, this route is chosen at first.
Distribute the goods of the distribution site 2 which are insufficient for carload (0.3 t) and the goods
of the distribution site 4(2.6t) together, with the loading weight of 2.9t<3t; at that time, if the
distribution sites are increased, the load capacity will exceed 3t. Therefore the route I will be:
0→6→8→2→4→5→0=50.6+13.5+48.2=112.3 km
That is to say, send one refrigerating car with the rated load of 3t. The distance is 112.3 km and
the loading weight is 2.9t. As is shown in Fig. 2:
0
30.7
32.2
6
4.1 5
8
15.8
(0.3t)
16
2
13.5
(2.6t)
963
→1→0 11 1.9
IV 0→1→0 1 Out and back 21 21 70.4 7
0→1→11
V 11 Out and back 6 6 76.8 2
→1→0
0→7→9
9 0.6
VI →10→7 Joint 3 86.4 1
10 2.4
→0
0→3→9 3 2.1
VII Joint 2.9 86.6 1
→7→0 9 0.8
0→7→9
VIII 9 Out and back 3 3 84.8 1
→7→0
0→7→10
IX 10 Out and back 6 6 69.4 2
→7→0
6 1.4
0→6→8
X 8 Joint 1.2 3 73 1
→5→0
5 0.4
0→5→6 5 0.2
XI Joint 2.2 75.8 1
→7→0 7 2
XII 0→5→0 5 Out and back 3 3 64.4 1
XIII 0→6→0 6 Out and back 3 3 61.4 1
XIV 0→7→0 7 Out and back 3 3 63.4 1
0→6→8 Out and back
XV 8 6 6 69.6 2
→6→0
Calculated as the Dijkstra's Algorithm and C-W Savings Algorithm, 15 distribution routes are got,
6 of which utilize the joint distribution mode; the total distance is 2215.3 km through calculation
and 28 refrigerating cars are needed.
Table 6. Distribution distance and number of vehicles in the original distribution mode
Distribution distance per
Distribution site Average daily demand/t Number of vehicles
vehicle/km
1 22.1 70.4 8
2 15.3 108 6
3 2.1 68.8 1
4 2.6 107 1
5 3.6 64.4 2
6 4.4 61.4 2
7 5 63.4 2
8 7.2 76.4 3
9 4.4 88.4 2
10 8.4 73.6 3
11 7.9 76.8 3
According to Table 6, the total distance under the former distribution mode is
2622.6km>2215.3km and 33>28 refrigerating cars are needed through calculation. From this, it can
be found that distribution using the optimized distribution plan can save the total distribution
distance for 407.3 km each day, reduce 5 distribution cars so that enhancing the distribution
efficiency and reducing the distribution cost. Besides, because the cold-chain warehouse &
distribution center of Y Company is located in the surrounding area of Chengdu City while most
distribution sites are located in the urban area, the breakthrough of the limitation that the traditional
logistics distribution center is located in the center of the geographical location popularize the
Dijkstra's Algorithm and C-W Savings Algorithm in the practical distribution route optimization.
Conclusion
Most companies have great randomness in terms of the distribution routes choice in logistics
distribution so that the distribution cost is high and the distribution efficiency is low. This paper
takes the cold-chain warehouse & distribution center of Y Company as the example, uses Dijkstra's
964
Algorithm and C-W Savings Algorithm to optimize the distribution routes and utilizes the
MATLAB software to deal with the problem of calculation difficulties with many knots. The
software of MATLAB is easy to handle with and the results are easy to understand. Through the
case analysis, it can be found that the distribution plan after optimizing can enhance the car loading
rate, reduce the distribution cost, enhance the distribution efficiency, and meanwhile it has great
social benefit for energy conservation, emission reduction, cutting down the environmental
pollution, lightening the transportation pressure. Therefore, Dijkstra's Algorithm and C-W Savings
Algorithm can solve the unreasonable transportation problems of the logistics companies such as
roundabout distribution and meanwhile provide support for the achievement of city joint
distribution.
References
[1] Coyle, J.J., Bardi, E.J., Langley, C.J. (2002). The Management of Business Logistics: A Supply
Chain Perspective (7th ed.). Mason: South-Western.
[2] Dantzig, G.B., Ramser, J.H. (1959). The truck dispatching problem. Management Science,
6(1), 80-91.
[3] Lenstra, J.K., Kan, A.H.G.R. (1981). Complexity of vehicle routing and scheduling problems.
Networks, 11(2), 221-227.
[4] Barceló, J., Grzybowska, H., Pardo, S. (2007). Vehicle routing and scheduling models,
simulation and city logistics. Operations Research/Computer Science Interfaces Series, 38,
163-195.
[5] Taniguchi, E., Thompson, R.G., Yamada, T., and van Duin, R. (2001). City Logistics: Network
Modelling and Intelligent Transport Systems. Oxford: Pergamon Press.
[6] Ghiani, G., Laporte, G., Musmanno, R. (2004). Introduction to Logistics Systems Planning
and Control. Chichester: John Wiley & Sons.
[7] Fisher, M.L., Jaikumar, R. (1981). A generalized assignment heuristic for vehicle routing.
Networks, 11(2), 109-124.
[8] Clarke, G., Wright, J.W. (1964). Scheduling of vehicles from a central depot to a number of
delivery points. Operations Research, 12(4), 568-581.
[9] Lin, S. (1965). Computer solutions of the traveling salesman problem. Bell System Technical
Journal, 44(10), 2245-2269.
[10] Gaskell, T.J. (1967). Bases for vehicle fleet scheduling. OR, 18(3), 281-295.
[11] Christofides, N., Eilon, S. (1969). An algorithm for the vehicle-dispatching problem. OR,
20(3), 309-318.
[12] Dijkstra, E. W. (1959). A note on two problems in connexion with graphs. Numerische
Mathematik, 1(1), 269-271.
965