Application of
Particle Swarm Optimization to
Dynamic Vehicle Routing Problem
Part of the Ph.D. research project
Ph.D. project
• Application of nature and social inspired algorithms in solving dynamic optimization problem
• Ph.D. student: Michał Okulewicz
– Faculty of Mathematics and Information Sciences WUT – Institute of Computer Science PAS
• Ph.D. advisor: prof. Jacek Mańdziuk
– Faculty of Mathematics and Information Sciences WUT
Ph.D. project motivation
• Dynamic environment problems frequently occur in business applications
• Animals and people deal with dynamic environment
• Nature and social behavior inspired
algorithms should work well for dynamic
optimization problems
Application of PSO to DVRP
• Particle Swarm Optimization Algorithm (PSO)
• Dynamic Vehicle Routing Problem (DVRP)
– Definition – Approach
• DAPSO [Khouadjia et al.]
• MAPSO [Khouadjia et al.]
• 2PSO [Okulewicz, Mańdziuk]
• 2MPSO [Okulewicz, Mańdziuk]
– Task analysis
– Future research
Particle Swarm Optimization
• Proposed by Kennedy and Eberhart in 1995
• Global optimization metaheuristic algorithm
• Utilizes the concept of Swarm Intelligence
– Particles with simple goals
– Communication between particles
PSO - pseudocode
1. P 0 = n random points from the search space 2. Evaluate each of points in P k
3. For i from 1 to n
4. P k+1 [i] += x1 ~U[0,1] * φ 1 * (BestNeighbor(P[i])-P k [i]) + x2 ~U[0,1] * φ 2 * (Best(P[i])-P k [i]) +
ω*(P k [i]-P k-1 [i])
5. If not END go back to 2.
Dynamic Vehicle Routing Problem
• Optimize the total route length of the fleet of vehicles for one working day
• Vehicles are homogenous and have limited capacity
• The cargo is taken from the depot and transported to the clients
• Time for serving all customers is limited to one
working day (the vehicles must return to the depot)
• Some of the requests to be served are unknown at
the begining of working day
Dynamic Vehicle Routing Problem
• Find
– Partition 𝑅
1, 𝑅
2, … , 𝑅
𝑛of the request set 𝑅 (where 𝑅
𝑖is assigned to vehicle 𝑖 and 𝑅
𝑖∩ 𝑅
𝑗= ∅ ∧ 𝑅
𝑖= 𝑅)
– Permutations 𝜎
𝑅𝑖of each of the subsets of the requests
• Such that
– The total length of routes of vehicles defined by 𝜎
𝑅𝑖is minimal
– All requests are served during one working day and vehicles are back into the depot
• Given
– Fleet of vehicles with a given capacity
– Dynamicaly changing set of requests (new requests coming during the day)
– Volume of each request and unloading time at each destination
– Location of the requests and depots
DVRP
- solution example
MAPSO
[Khouadjia et al.]
• Multiswarm optimization
• Memory of previous solutions
• Integer search space and particles velocity
• Every particle represents association of client’s requests with vehicles
– every dimesion corresponds to one request – value in each dimension is the vehicle id
• Fitness function is the total value of routes for all of the vehicles
– Each route is optimized by the 2-Opt algorithm
• Gives better results then GA and ANTs approaches
2MPSO
[Okulewicz, Mańdziuk]
• Multiswarm optimization
• Initialization with previous solutions
• Continous search space and particles velocity
• 2-phase PSO algorithm
– Partition of requests optimized as clustering task – Finding shortest route for each vehicle as separate
optimization task
2MPSO
– clustering phase
• Every particle represents coordinates of cluster centers
– search space dimensionality is equal to number of vehicles times two
– requests are associated with the vehicle corresponding to the closest cluster center
• Fitness function is the sum of
– total value of intercluster Euclidean distances
– Euclidean distances from each non-empty cluster
center to the depot
2MPSO
– route optimization phase
• Every particle represents the order of the requests on the vehicle route
– search space dimensionality is equal to number of requests to be served by the vehicle
– requests are ordered by the value
• Fitness function is the length of the route
2MPSO
– pseudocode
1. Generate initial solution with minimal spanning tree algorithm 2. Initialize multiple separate instances of clustering PSO with the
best solution from the previous time step
3. Perform cluster optimization for the given number of iterations 4. For each vehicle
1. Initialize route PSO with the solution from the previous time step 2. Perform route optimization for the given number of iterations 5. Choose the best solution (on the basis of total route length)
among multiple instances
6. Send vehicles with small time reserve to the nearest requests 7. Add requests from the new time step
8. If not end of the working day go to 2.
2MPSO
– algorithm run example
2MPSO
– algorithm performance example
2MPSO vs MAPSO
Benchmark 2MPSO Avg 2MPSO Min. MAPSO Avg MAPSO Min.
c50D 633,44 597,18 610,67 571,34
c75D 984,77 929,35 965,53 931,59
c100D 1056,45 976,73 973,01 953,79
c100bD 860,93 828,94 882,39 866,42
c120D 1138,39 1084,92 1295,79 1223,49
c150D 1257,20 1164,83 1357,71 1300,43
c199D 1506,74 1444,01 1646,37 1595,97
f71D 341,97 305,54 296,76 287,51
f134D 13179,18 12813,53 16193,00 15150,50
tai75aD 1951,23 1791,95 1849,37 1794,38
tai75bD 1518,25 1442,22 1426,67 1396,42
tai75cD 1676,99 1567,33 1518,65 1483,10
tai75dD 1483,24 1436,99 1413,83 1391,99
tai100aD 2442,46 2297,99 2214,61 2178,86
tai100bD 2291,85 2166,98 2218,58 2140,57
tai100cD 1599,69 1504,08 1550,63 1490,40
tai100dD 1958,91 1820,39 1928,69 1838,75
tai150aD 3824,43 3614,99 3389,97 3273,24
2MPSO vs 2PSO
Benchmark 2MPSO Avg 2MPSO Min. 2PSO Avg 2PSO Min.
c50D 633,44 597,18 668,41 588,08
c75D 984,77 929,35 1016,30 923,3
c100D 1056,45 976,73 1142,05 996,4
c100bD 860,93 828,94 848,82 828,94
c120D 1138,39 1084,92 1209,48 1104,29
c150D 1257,20 1164,83 1335,82 1242,41
c199D 1506,74 1444,01 1581,26 1451,47
f71D 341,97 305,54 356,77 315,79
f134D 13179,18 12813,53 13462,55 12972,08
tai75aD 1951,23 1791,95 2140,53 1871,06
tai75bD 1518,25 1442,22 1567,95 1460,95
tai75cD 1676,99 1567,33 1812,23 1500,23
tai75dD 1483,24 1436,99 1577,94 1462,82
tai100aD 2442,46 2297,99 2713,03 2320,95
tai100bD 2291,85 2166,98 2503,53 2212,9
tai100cD 1599,69 1504,08 1673,05 1577,72
tai100dD 1958,91 1820,39 2189,13 1859,70
tai150aD 3824,43 3614,99 4158,55 3652,98
Comparison of the results
1.101.201.30
Best comparison
mpared to VRP
2PSO2MPSO MAPSO DAPSO
5 10 15 20
1.01.11.21.31.41.5
Avarage comparison
Task
Compared to VRP
2PSO 2MPSO MAPSO DAPSO
Algorithm
performance analysis
• It seems that results of 2MPSO algorithm depend on
– Spatial distribution of the requests
– Skewness of the requests volume distribution
– Number of vehicles needed
Algorithm
performance analysis
50 100 150 200
1.001.101.201.30
Number of requests
Best
4 6 8 10 12 14 16
1.001.101.201.30
Minimum number of vehicles
Best
0.2 0.4 0.6 0.8
1.001.101.201.30
Largest request
Best
1.101.201.30
Best 1.101.201.30
Best 1.101.201.30
Best
c75
2013-06-05
Study was supported by research fellowship within
”Information technologies: Research and their interdisciplinary applications”
agreement number POKL.04.01.01-00-051/10-00 22
2MPSO
●
1,11
●
1,18 MAPSO
●
1,12
●
1,16
c50
2013-06-05
Study was supported by research fellowship within
”Information technologies: Research and their interdisciplinary applications”
agreement number POKL.04.01.01-00-051/10-00 23
2MPSO
●
1,14
●
1,21 MAPSO
●
1,09
●
1,16
c120
Study was supported by research fellowship within
2MPSO
●
1,04
●
1,09 MAPSO
●
1,17
●
1,24
tai150c
2MPSO
●
1,17
●
1,22 MAPSO
●
1,06
●