29
97 CHAPTER 4 MODIFIED K-MEANS WITH HYBRID PARTICLE SWARM OPTIMIZATION FOR VECHILE ROUTING PROBLEM The HPSO proposed in the first two chapters consider the deterministic and stochastic VRP with an objective of minimizing the routing cost. The heuristic techniques used in the first two works are route-first and cluster-second heuristic technique. In this chapter, cluster-first and route- second (Beasley 1983) is used as a heuristic method. Clustering is the first phase of this work, the customers are assigned to each vehicle based on its constraint like minimum distance, maximum demand etc. The modified k-means algorithm is proposed in order to take care of clustering with capacity constraint. It uses first-fit decreasing algorithm for packing the customers into clusters based on their demand and distance measure. Then, HPSO algorithm can be applied within the clusters to form the sequences for each vehicle as a second phase. By using this cluster-first and route-second heuristic, the complexity of the problem is also reduced substantially. In this work, modified k-means with HPSO (MK-HPSO) algorithm is proposed. The proposed MK-HPSO is tested with CVRP data set. This work concentrates on further minimizing the total travel cost of vehicles as compared to HPSO. It is also applied to solve MDVRP and tested with MDVRP data sets.

CHAPTER 4 MODIFIED K-MEANS WITH HYBRID PARTICLE …shodhganga.inflibnet.ac.in/bitstream/10603/15491/9/09... · 2015-12-04 · in subsequent generations. The ROV conversion and GA

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: CHAPTER 4 MODIFIED K-MEANS WITH HYBRID PARTICLE …shodhganga.inflibnet.ac.in/bitstream/10603/15491/9/09... · 2015-12-04 · in subsequent generations. The ROV conversion and GA

97

CHAPTER 4

MODIFIED K-MEANS WITH HYBRID PARTICLE

SWARM OPTIMIZATION FOR VECHILE

ROUTING PROBLEM

The HPSO proposed in the first two chapters consider the

deterministic and stochastic VRP with an objective of minimizing the routing

cost. The heuristic techniques used in the first two works are route-first and

cluster-second heuristic technique. In this chapter, cluster-first and route-

second (Beasley 1983) is used as a heuristic method. Clustering is the first

phase of this work, the customers are assigned to each vehicle based on its

constraint like minimum distance, maximum demand etc. The modified

k-means algorithm is proposed in order to take care of clustering with

capacity constraint. It uses first-fit decreasing algorithm for packing the

customers into clusters based on their demand and distance measure. Then,

HPSO algorithm can be applied within the clusters to form the sequences for

each vehicle as a second phase. By using this cluster-first and route-second

heuristic, the complexity of the problem is also reduced substantially. In this

work, modified k-means with HPSO (MK-HPSO) algorithm is proposed. The

proposed MK-HPSO is tested with CVRP data set. This work concentrates on

further minimizing the total travel cost of vehicles as compared to HPSO. It is

also applied to solve MDVRP and tested with MDVRP data sets.

Page 2: CHAPTER 4 MODIFIED K-MEANS WITH HYBRID PARTICLE …shodhganga.inflibnet.ac.in/bitstream/10603/15491/9/09... · 2015-12-04 · in subsequent generations. The ROV conversion and GA

98

4.1 RELATED WORK

Sweep algorithm is a very old method of clustering approach for

CVRP introduced by Gillet and Miller (1974). After which many clustering

techniques such as Fisher and Jaikumar (1981), Petal algorithm etc. are

introduced. A cluster-and-search heuristic to solve the VRP with delivery and

pick-up had been proposed by Ganesh and Narendran (2007). They proposed

a multi-phase constructive heuristic that clusters nodes based on proximity.

Using shrink-wrap algorithm, they orient nodes along a route. Finally,

Generalized Assignment Procedure (GAP) is used to allot the vehicles for

each route. GA is used as an intensive search engine.

Sariklis and Powell (2007) solved the Open VRP (OVRP)

associated with capacity constraints on vehicles with cluster-first

route-second. Their heuristic has two phases. In the first phase, they

constructed clusters of customers taking vehicle capacity into account, then

balanced and improved the clusters by reassigning customers. In the second

phase, open routes are generated by solving a minimum spanning tree

problem. They used penalties to modify the solution and iteratively converted

infeasible solutions to feasible one.

4.2 MODIFIED K-MEANS CLUSTERING WITH HPSO

(MK-HPSO)

In route-first and cluster-second heuristic, the formation of giant

sequence and traversing the whole sequence of dimension n, generally takes

more time as the number of customer increases. To reduce this time

complexity as well as the space complexity, the VRP is now approached with

‘cluster-first and route-second’ method. The customers are partitioned into

number of sub groups; such that the sequences can be easily found within

these subgroups instead of forming the giant route. Modified k-means

Page 3: CHAPTER 4 MODIFIED K-MEANS WITH HYBRID PARTICLE …shodhganga.inflibnet.ac.in/bitstream/10603/15491/9/09... · 2015-12-04 · in subsequent generations. The ROV conversion and GA

99

algorithm is used to partition the large number of customers into clusters.

Here, the PSO is used for finding the sequence within the formed cluster. The

PSO used here is a hybrid PSO as in the proposed HPSO except that there is

no decoding procedure. The output of modified k-means algorithm is

pipelined as input for HPSO. The general cluster-first and route-second

approach used for solving VRP is as shown in Figure 4.1.

Figure 4.1 Proposed Cluster-First and Route-Second Approach

4.2.1 Modified k-means Clustering Algorithm

The general k-means algorithm assigns each point into the cluster

whose center (called as centroid) is nearest to it (MacQueen, 1967). Random

points are selected as centroid initially and the points around it are grouped.

The center is calculated as the average of all the points in the cluster, i.e. the

Page 4: CHAPTER 4 MODIFIED K-MEANS WITH HYBRID PARTICLE …shodhganga.inflibnet.ac.in/bitstream/10603/15491/9/09... · 2015-12-04 · in subsequent generations. The ROV conversion and GA

100

co-ordinates are the arithmetic mean of each dimension separately over all

points in the cluster. This process of computing the centroid and assigning the

points to new centroid proceeds until there is no more change in the formed

clusters or centroids.

The proposed modified k-means algorithm selects the customer

farther from the depot as its initial centroid, rather than selecting randomly.

The number of clusters m to be formed is generally the number of vehicles

available for servicing. This is expressed using Equation (4.1).

= (4.1)

where m is the number of clusters, n is the number of customers, di denotes

the demand / requirement of each customer i and Q is the maximum load or

capacity that a vehicle can service. This will optimize the number of vehicles

required for servicing.

The distances between the customers are calculated using

Euclidean distance formula using Equation (4.2). The customers are assigned

to the centroid similar to first-fit decreasing algorithm (Xia and Tan 2010).

Either distance or demand is not the only criteria for assigning the customer;

it calculates the priority using both the factors using Equation (4.3).

= ( ) + ( ) (4.2)

( ) = (4.3)

where (xi, yi) denotes the location of ith

customer. Based on this priority, the

grouping of customers is done. If customers are assigned based on distance

alone, the number of clusters formed may not be optimal, because the

Page 5: CHAPTER 4 MODIFIED K-MEANS WITH HYBRID PARTICLE …shodhganga.inflibnet.ac.in/bitstream/10603/15491/9/09... · 2015-12-04 · in subsequent generations. The ROV conversion and GA

101

customers with smaller demand may be assigned to the cluster before the

customer with larger demand which may lead to the formation of additional

cluster.

Procedure for modified k-means clustering

The procedure for modified k-means algorithm is explained as

follows.

Input

Customer list C having co-ordinates (xi, yi) and demands di

Output

m clusters and the partitioned customers set C1, C2, … Cm

Procedure

Calculate m using (4.1)

Sort the C into non-increasing order based on their demands

giving the sequence c1>c2>c3…>cn

Calculate the distance of each customer from the depot and

arrange them in non-increasing order based on the distance from

depot, Let it be C1

Select first m customers as the initial centroids from the

arranged list C1

while not converged

Calculate the Euclidean distance measure using (4.2)

between all customer and each of the m centroid

for each customer ci ,,

while ci is not assigned

Identify the nearest centroid for ci

Page 6: CHAPTER 4 MODIFIED K-MEANS WITH HYBRID PARTICLE …shodhganga.inflibnet.ac.in/bitstream/10603/15491/9/09... · 2015-12-04 · in subsequent generations. The ROV conversion and GA

102

Group all unassigned customers ci’s as G having same

centroid as it’s minimum

Calculate the priority value for ci G using (4.3)

If capacity / load constraint is not violated

Assign ci G to Cj based on priority where j is the nearest

centroid

Else

Choose the next nearest centroid as its nearest centroid

end if

end while

end for

Calculate the new centroid from the formed clusters using

Equation (4.4) for each cluster j each assigned with nj number of

customer

= = (4.4)

end while

4.2.2 Hybrid Particle Swarm Optimization for Route Formation

The clusters formed by modified k-means algorithm are given as

input to HPSO where the sequencing is formed for each groups. This HPSO is

to solve TSP, a subset of VRP rather than solving VRP as a whole. The HPSO

represents the solution as permutation encoding. The solution represents a

sequence of customer within each cluster. The solution representation and

fitness evaluation are explained in the following sub sections.

Page 7: CHAPTER 4 MODIFIED K-MEANS WITH HYBRID PARTICLE …shodhganga.inflibnet.ac.in/bitstream/10603/15491/9/09... · 2015-12-04 · in subsequent generations. The ROV conversion and GA

103

4.2.2.1 Solution representation and conversion method

The integer values are used to represent the solutions as proposed in

chapter 2. For example, the customers (5 6 10 15) are clustered as first group

(nj = 4) and it is mapped to (1 2 3 4) to represent the solution. The

permutation of this numbers 1-4 is generated as solution and proposed PSO

finds the optimal sequence of this permutation. The solution represents the

numbers between 1 and nj. The jth

position of ith

particle yij of kth

vehicle is

represented in Equation (4.5)

= 1 1 (4.5)

where represents | | of kth

vehicle. NNH is used as explained in the

section 2.2.2 for generating the initial solutions that simulate fast

convergence. These solutions are converted to continuous values using

Equation (2.3) as particle position value before applying Equations (1.5) and

(1.6) to particles. Elitism of 5% is used in order to preserve the elite particles

in subsequent generations. The ROV conversion and GA operators are same

as in section 2.2.3 and 2.2.4. Further, the route sequence is improved using

hill-climbing with 2-opt local exchange as in section 2.2.6.

4.2.2.2 Fitness function

The particles represent the sequence (Rj) within each cluster, Cj.

Then, the Rj is evaluated to find the total cost (Dj) from the service point

(depot in case of VRP) using Equation (4.6), and the overall fitness function

is given in Equation (4.7).

=1

(4.6)

(4.7)

where a1 and an are the first and last customer in each cluster,

represents the location where vehicles are stationed and costab represent the

distance or time to move from a to b.

Page 8: CHAPTER 4 MODIFIED K-MEANS WITH HYBRID PARTICLE …shodhganga.inflibnet.ac.in/bitstream/10603/15491/9/09... · 2015-12-04 · in subsequent generations. The ROV conversion and GA

104

Procedure for HPSO to form a routing sequence of customers

The algorithm for HPSO is explained as follows.

Input

m clusters and the partitioned customers set C1, C2, … Cm

Customer list C with n number of co-ordinates (xi, yi) and

demands di

Output

m sequence of customers

Procedure

Initialize the parameters of HPSO

For each cluster

Initialize I solutions (Yi) as a population, using NNH.

While not the termination condition met

Calculate the fitness value for each individual

using (4.6)

Arrange the particles in the ascending order based

on fitness value

Perform HC with 2-opt local exchange as in

section 2.2.6.

Convert Yi into Xi, the particles position value

using Equation (2.3)

Set or update the pbest, Pi=Xi, if fitness of Xi <

fitness of Pi

Set or update the gbest, Pg=Pi, if fitness of Pi <

fitness of Pg

Repeat the following steps for 95% of particles

Decrease the inertia using equation (2.9)

Page 9: CHAPTER 4 MODIFIED K-MEANS WITH HYBRID PARTICLE …shodhganga.inflibnet.ac.in/bitstream/10603/15491/9/09... · 2015-12-04 · in subsequent generations. The ROV conversion and GA

105

Update the velocity and the position of

each ith

particle using (1.5) and (1.6)

Apply GA operators as in section 2.2.4

Convert the particle position value Xi into

solution Yi using smallest position value as

in section 2.2.3

End

End while

End for

Calculate the overall fitness using Equation (4.7)

The overall flow of proposed MK-HPSO is shown in Figure 4.2.

Figure 4.2 Proposed MK-HPSO for VRP

Page 10: CHAPTER 4 MODIFIED K-MEANS WITH HYBRID PARTICLE …shodhganga.inflibnet.ac.in/bitstream/10603/15491/9/09... · 2015-12-04 · in subsequent generations. The ROV conversion and GA

106

4.3 CAPACITATED VEHICLE ROUTING PROBLEM

CVRP is considered for testing the proposed MK-HPSO of

clustering and then routing. In this, CVRP is formulated based on cluster-first

and route-second methodology.

4.3.1 Problem Definition

The CVRP is defined as follows.

Objectives

Minimize the distance travelled by each vehicle

Constraints

Load of each vehicle should not exceed the given vehicle

capacity

Each customer is serviced exactly once

Each vehicle route starts and ends at depot

The problem is given with a set of

Customers: c1, c2, c3 … cn

Demands : d1, d2, d3 … dn

Vehicles : v1, v2, v3 … vm

Capacity : Q

where ci C are the set of customers distributed in the Euclidean plane (xi,

yi) whose distances are symmetric, the demand (di) and capacity (Q) of

vehicle are positive integers. The Costij is the travelling cost/distance between

customer i to customer j.

Page 11: CHAPTER 4 MODIFIED K-MEANS WITH HYBRID PARTICLE …shodhganga.inflibnet.ac.in/bitstream/10603/15491/9/09... · 2015-12-04 · in subsequent generations. The ROV conversion and GA

107

The n customers are grouped to form m clusters, based on their

demand and location (x, y). The set C is partitioned into m number of subsets

Ci. Then

, for i = 1, . . m, (4.8)

= , for i, j = 1, . . .m and i j (4.9)

C = C (4.10)

The Equation (4.9) further indicates that no customer is serviced by

more than one vehicle. A customer ci is included to a subset only if the

summation of customer demands in that subset is less than or equal to the

capacity of the vehicle as in Equation (4.11).

, = 1 (4.11)

The number of customers in each cluster is denoted by n1, n2, ...,

nm, such that

(4.12)

The routing is formed within each cluster Cj with Dj as its route

cost. It is calculated using Equation (4.13).

= (4.13)

where a1 and an are the first and last customer in each group, represents

the location where vehicles are stationed and represent the

time/distance from a to b. Then, the overall objective of CVRP is

(4.14)

Page 12: CHAPTER 4 MODIFIED K-MEANS WITH HYBRID PARTICLE …shodhganga.inflibnet.ac.in/bitstream/10603/15491/9/09... · 2015-12-04 · in subsequent generations. The ROV conversion and GA

108

4.4 ANALYSIS OF PROPOSED MK-HPSO

The cluster-first and route-second is analyzed both theoretically and

empirically. The following subsections explain the analysis made in detail.

4.4.1 Theoretical Analysis

The NP-hard VRPs are decomposed into multiple TSP as detailed

in the above sub sections. Let n be the number of customers and m be the

number of vehicles available to service the customers. Then, the space

complexity is analyzed based on the size of the particles used by MK-PSO,

that takes the size of nj (<n) which is more efficient than the size of HPSO in

chapter 1. The modified k-means algorithm requires storing n customers and

m centroids of clusters. The space required is shown in Table 4.1.

Table 4.1 Space Complexity

Algorithm Space required

HPSO for VRP O(n)

MK-HPSO

Modified k-means

HPSO for TSP

O(n+m)

O(nj)

The size of particle in the proposed work is nj, which automatically

reduces the space needed for storing and to perform other operations. The

time complexity of the proposed MK-HPSO is depicted in Table 4.2.

Page 13: CHAPTER 4 MODIFIED K-MEANS WITH HYBRID PARTICLE …shodhganga.inflibnet.ac.in/bitstream/10603/15491/9/09... · 2015-12-04 · in subsequent generations. The ROV conversion and GA

109

Table 4.2 Time Complexity

Procedures in proposed

MK-HPSO

Time

complexity

Modified k-means O(knm)

Particle Conversion O(nm)

Genetic Operation O(nm)

HC with 2-opt local exchange O(mn2)

The time complexity is calculated for a single iteration. The

modified k-means spend time in computing the distance is O(m). The

reassignment and its overall complexity is O(knm). Each particle in PSO is

converted to positional value and vice versa in O(n). This particle conversion

is performed for all m vehicles as O(nm). The genetic operation crossover and

mutation performed for each particle is again O(n) for one vehicle, but the

occurrence of this operation depends on the probability value. The 2-opt

operator in HC takes O(mn2) computational time for m vehicles.

4.4.2 Empirical Analysis

The proposed MK-HPSO is tested with CVRP problem instances of

Christofides et al and Augerat et al The characteristics of Christofides et al

problem instances are shown in Table 2.11.

The MK-HPSO is implemented in MatLab 7.0.1 and parameters for

PSO are set as in Table 2.7. The number of clusters or vehicles required for

routing is calculated using Equation (4.1) and it is shown in Table 4.3. This

shows that the modified k-means algorithm packs the customers with the

optimal number of vehicles. Table 4.3 shows the time taken for clustering and

also the average load of a vehicle. The average load of a vehicle shows that

the vehicles are utilized to its maximum capacity.

Page 14: CHAPTER 4 MODIFIED K-MEANS WITH HYBRID PARTICLE …shodhganga.inflibnet.ac.in/bitstream/10603/15491/9/09... · 2015-12-04 · in subsequent generations. The ROV conversion and GA

110

Table 4.3 Results Obtained After Clustering

Problem

Instance

No. of

Vehicles

Clustering

Time (sec)

Average

vehicle load

1 5 1 155.40

2 10 2 136.40

3 8 2 182.25

4 12 4 186.25

5 16 5 185.50

11 7 2 196.42

12 10 2 181.00

After clustering, the clusters formed are given as input to the

HPSO. In which, the routing is formed for each clusters. Figure 4.3 shows the

comparison of MK-HPSO cost with BKS for Chrisofieds et al problem

instances.

Figure 4.3 Cost Comparison of MK-HPSO with BKS for Christofieds

et al Problem Instances

Page 15: CHAPTER 4 MODIFIED K-MEANS WITH HYBRID PARTICLE …shodhganga.inflibnet.ac.in/bitstream/10603/15491/9/09... · 2015-12-04 · in subsequent generations. The ROV conversion and GA

111

Figure 4.3 shows that the cost obtained are almost nearer to the best

known solution. The obtained route cost along with mean over 10 runs and

also its deviation from BKS is depicted in Table 4.4.

Table 4.4 Comparison of MK-HPSO Route Cost with BKS Cost

Problem

InstanceBKS

MK-HPSO

costRPD Mean

1 524.61 524.61 0.00 528.13

2 835.26 836.82 0.18 860.26

3 826.14 827.25 0.13 838.89

4 1028.42 1030.55 0.20 1064.03

5 1291.29 1301.42 0.78 1330.64

11 1042.11 1042.11 0.00 1045.99

12 819.56 819.56 0.00 821.29

The first phase of clustering enhances the solution quality of PSO.

Because of which, the problem with clustered customers provides optimal

solution. The deviation from BKS is 0 for the problem instance 1, when the

number of customer is 50. When customers are clustered in nature, the

cluster-first and route-second approach works well and the problem instances

11 and 12 are clustered in nature, so the deviation is 0 in the proposed work.

For other problem instances, the RPD is on an average 0.32. The obtained

MK-HPSO cost is compared with other existing PSO method. Table 4.5

shows the comparison with Ai et al (2009) and Marinakis et al (2010)

Page 16: CHAPTER 4 MODIFIED K-MEANS WITH HYBRID PARTICLE …shodhganga.inflibnet.ac.in/bitstream/10603/15491/9/09... · 2015-12-04 · in subsequent generations. The ROV conversion and GA

112

Table 4.5 MK-HPSO Cost Compared with Other Existing PSO Method

Problem

Instance

BKS

Cost

Ai (SR-2) MK-HPSO

CostTime

in secCost

Time

in sec

1 524.61 524.61 24 524.61 7

2 835.26 844.42 57 836.82 13

3 826.14 829.40 101 827.25 13

4 1028.42 1048.89 223 1030.55 20

5 1291.29 1323.89 413 1301.42 25

11 1042.11 1052.34 93 1042.11 15

12 819.56 819.56 88 819.56 15

The proposed PSO shows better performance than Ai and

Kachivichyanukul (2009) both in terms of route cost and computational time.

The test is further made with Augerat et al data sets. The

characteristics of Problem set are shown in Table 4.6.

Table 4.6 Characteristics of Augerat et al Problem Instances

Problem Instance

Number

Problem

instance

No.

customers

Vehicle

capacity

No.

Vehicles

1 A-n32-k5 31 100 5

2 A-n33-k5 32 100 5

3 A-n37-k5 36 100 5

4 A-n45-k6 45 100 6

5 A-n60-k9 59 100 9

6 B-n31-k5 30 100 5

7 B-n41-k6 40 100 6

8 B-n68-k9 67 100 9

9 E-n22-k4 21 6000 4

10 E-n30-k3 29 4500 3

11 E-n51-k5 50 160 5

12 P-n22-k2 21 160 2

13 P-n60-k15 59 80 15

14 P-n101-k4 100 350 4

Page 17: CHAPTER 4 MODIFIED K-MEANS WITH HYBRID PARTICLE …shodhganga.inflibnet.ac.in/bitstream/10603/15491/9/09... · 2015-12-04 · in subsequent generations. The ROV conversion and GA

113

The clusters formed by modified k-means algorithm are shown in

Table 4.7. The clustering done for each vehicle utilizes the capacity of vehicle

efficiently.

Table 4.7 Results After Clustering

Problem InstanceClustering time

(seconds)

Average vehicle

load

A-n32-k5 1 82

A-n33-k5 1 89.2

A-n37-k5 1 81.4

A-n45-k6 2 98.83

A-n60-k9 2 92.11

B-n31-k5 1 82.4

B-n41-k6 1 94.5

B-n68-k9 2 93

E-n22-k4 1 5625

E-n30-k3 1 4250

E-n51-k5 2 155.4

P-n22-k2 1 154

P-n60-k15 6 75.6

P-n101-k4 2 364.5

The route cost obtained after routing by PSO is shown in Figure 4.4

along with BKS.

Page 18: CHAPTER 4 MODIFIED K-MEANS WITH HYBRID PARTICLE …shodhganga.inflibnet.ac.in/bitstream/10603/15491/9/09... · 2015-12-04 · in subsequent generations. The ROV conversion and GA

114

Figure 4.4 Cost comparison of MK-HPSO with BKS for Augerat et al

problem instances

Table 4.8 shows the BKS and RPD obtained from BKS and also

average cost over 10 runs.

Table 4.8 Comparison of MK-HPSO Route Costs with BKS

Problem Instance BKS cost MK-HPSO Cost RPD Mean

A-n32-k5 784 784 0.00 790

A-n33-k5 661 661 0.00 672

A-n37-k5 669 669 0.00 695

A-n45-k6 944 944 0.00 960

A-n60-k9 1354 1355 0.07 1390

B-n31-k5 672 672 0.00 680

B-n41-k6 829 829 0.00 854

B-n68-k9 1272 1275 0.20 1309

E-n22-k4 375 375 0.00 378

E-n30-k3 534 534 0.00 547

E-n51-k5 521 521 0.00 549

P-n22-k2 216 216 0.00 220

P-n60-k15 968 970 0.20 998

P-n101-k4 681 683 0.29 701

Page 19: CHAPTER 4 MODIFIED K-MEANS WITH HYBRID PARTICLE …shodhganga.inflibnet.ac.in/bitstream/10603/15491/9/09... · 2015-12-04 · in subsequent generations. The ROV conversion and GA

115

For almost all data sets, the optimal cost is obtained and for data set

60 and above there is a small deviation from the BKS. The time taken on an

average is 8.14 seconds. The MK-HPSO cost and computational time is

compared with other existing PSO methods. It is shown in Table 4.9.

Table 4.9 Comparison of MK-HPSO with other Existing PSO Methods

Problem

instance

BKS

cost

Chen Ai (SR-2) MK-HPSO

CostTime

in secCost

Time

in secCost

Time

in sec

A-n32-k5 784 - - - - 784 6

A-n33-k5 661 661 32 661 32 661 6

A-n37-k5 669 - - - - 669 7

A-n45-k6 944 - - - - 944 8

A-n60-k9 1354 1354 309 1355 40 1355 12

B-n31-k5 672 - - - - 672 6

B-n41-k6 829 - - - - 829 8

B-n68-k9 1272 1272 344 1274 50 1275 12

E-n22-k4 375 - - - - 375 4

E-n30-k3 534 534 28 534 16 534 4

E-n51-k5 521 528 301 521 22 521 8

P-n22-k2 216 - - - - 216 3

P-n60-k15 968 - - - - 970 16

P-n101-k4 681 694 978 683 86 683 14

The comparison of CPU time taken by MK-HPSO with other PSO

methods is shown in Figure 4.5.

Page 20: CHAPTER 4 MODIFIED K-MEANS WITH HYBRID PARTICLE …shodhganga.inflibnet.ac.in/bitstream/10603/15491/9/09... · 2015-12-04 · in subsequent generations. The ROV conversion and GA

116

Figure 4.5 CPU time of MK-HPSO compared with other PSO methods

for Augerat et al Problem Instances

Figure 4.5 clearly shows that the MK-HPSO works better than

other method in terms of CPU time. The MK-HPSO shows better

performance than HPSO proposed in chapter 2. The efficiency of MK-HPSO

is compared with HPSO by calculating the RPD of HPSO with respect to

MK-HPSO. It is calculated using Equation (2.16) and projected in Table 4.10

and Table 4.11 for Christofides et al. and Augerat et al problem instances

respectively.

Table 4.10 Comparison of MK-HPSO with HPSO for Christofides et al

problem instances

Problem

Instance

BKS

Cost

HPSO MK-HPSO

RPDCost Time in Sec Cost

Time in

Sec

1 524.61 524.61 9 524.61 7 0.00

2 835.26 850.53 22 836.82 13 1.61

3 826.14 828.12 52 827.25 13 0.10

4 1028.42 1050.56 150 1030.55 20 1.90

5 1291.29 1328.75 324 1301.42 25 2.05

11 1042.11 1050.19 84 1042.11 15 0.76

12 819.56 819.56 48 819.56 15 0.00

Page 21: CHAPTER 4 MODIFIED K-MEANS WITH HYBRID PARTICLE …shodhganga.inflibnet.ac.in/bitstream/10603/15491/9/09... · 2015-12-04 · in subsequent generations. The ROV conversion and GA

117

The HPSO has an average of 0.91% deviation when compared to

MK-HPSO. The solution representation and the decoding procedure are

simple in the proposed work that substantially reduces the computational time

when compared to HPSO. On an average the time taken by proposed work is

15.43 seconds.

Table 4.11 Comparison of MK-HPSO costs with proposed HPSO for

Augerat et al problem instances

Problem

Instance

BKS

cost

HPSO MK-HPSO RP

DCost Time in Sec Cost Time in Sec

A-n32-k5 784 784 8 784 6 0.00

A-n33-k5 661 661 8 661 6 0.00

A-n37-k5 669 669 9 669 7 0.00

A-n45-k6 944 944 11 944 8 0.00

A-n60-k9 1354 1368 18 1355 12 0.95

B-n31-k5 672 672 7 672 6 0.00

B-n41-k6 829 829 10 829 8 0.00

B-n68-k9 1272 1281 21 1275 12 0.46

E-n22-k4 375 375 5 375 4 0.00

E-n30-k3 534 534 8 534 4 0.00

E-n51-k5 521 522 13 521 8 0.19

P-n22-k2 216 216 5 216 3 0.00

P-n60-k15 968 970 18 970 16 0.00

P-n101-k4 681 685 34 683 14 0.29

For Augerat et al problem instances, the HPSO has 0.13% of

deviation on an average when compared to MK-HPSO. The time taken is also

less when compared to HPSO.

Page 22: CHAPTER 4 MODIFIED K-MEANS WITH HYBRID PARTICLE …shodhganga.inflibnet.ac.in/bitstream/10603/15491/9/09... · 2015-12-04 · in subsequent generations. The ROV conversion and GA

118

The MK-HPSO is also tested for MDVRP data set. The

characteristics of problem instances are shown in Table 2.12 and initial

clusters formed are shown in Table 2.13. These clusters formed by general k-

means algorithm are given as input for MK-HPSO to form the routes for each

vehicle of a depot and total cost obtained along with BKS and is shown in

Table 4.12 along with RPD from BKS. It also compares the results obtained

by GA methods.

Table 4.12 Comparison of MK-HPSO Cost with BKS and GA Methods

After Routing for MDVRP

Problem

InstanceBKS

GenClust

(Thangiah, &

Salhi, 2001)

GA (Ombuki

& Hanshar,

2004)

MK-HPSO

Cost RPD

1 576.86 591.73 622.18 579.37 0.43

2 473.53 473.55 480.04 474.98 0.30

3 641.18 694.49 706.88 680.23 5.74

4 1001.49 1062.38 1024.78 1015.54 1.38

5 750.26 754.84 785.15 760.12 1.29

6 876.5 976.02 908.88 894.64 2.02

7 885.69 976.48 918.05 915.29 3.23

8 4437.58 4812.52 4690.18 4598.03 3.48

9 3900.13 4284.62 4240.08 4322.34 9.76

10 3663.00 4291.45 3984.78 3668.26 0.14

11 3554.08 4092.68 3880.65 3601.48 1.31

12 1318.95 1421.94 1318.95 1319.20 0.01

13 1318.95 1318.95 1318.95 1319.60 0.04

14 1360.12 1360.12 1365.69 1360.12 0.00

15 2505.29 3059.15 2579.25 2595.34 3.46

16 2572.23 2719.98 2587.87 2671.91 3.73

17 2708.99 2894.69 2731.37 2764.66 2.01

18 3702.75 5462.90 3903.85 3815.27 2.94

19 3827.06 3956.61 3900.61 3856.70 0.76

20 4058.00 4344.81 4097.06 4109.45 1.25

21 5474.74 6872.11 5926.49 5566.83 1.65

22 5702.06 5985.32 5913.59 5917.34 3.63

23 6095.36 6299.04 6145.58 6146.28 0.82

Page 23: CHAPTER 4 MODIFIED K-MEANS WITH HYBRID PARTICLE …shodhganga.inflibnet.ac.in/bitstream/10603/15491/9/09... · 2015-12-04 · in subsequent generations. The ROV conversion and GA

119

The MK-HPSO has 2.14% of deviation from BKS. For the problem

instance 14, the optimal cost is obtained by MK-HPSO. For other problems,

near optimal solution is obtained.

Table 4.13 Comparison of MK-HPSO with HPSO for MDVRP

Problem Instances

Problem

InstanceBKS

HPSO

costMK-HPSO

Cost

1 576.86 580.94 579.372 473.53 475.29 474.983 641.18 682.52 680.234 1001.49 1027.33 1015.545 750.26 789.96 760.126 876.5 894.09 894.647 885.69 916.86 915.298 4437.58 4602.73 4598.039 3900.13 4321.40 4322.3410 3663.00 3668.32 3668.2611 3554.08 3594.21 3601.4812 1318.95 1319.56 1319.2013 1318.95 1321.25 1319.6014 1360.12 1361.98 1360.1215 2505.29 2594.77 2595.3416 2572.23 2678.54 2671.9117 2708.99 2754.97 2764.6618 3702.75 3817.46 3815.2719 3827.06 3857.22 3856.7020 4058.00 4109.94 4109.4521 5474.74 5635.73 5566.8322 5702.06 5998.35 5917.3423 6095.36 6247.04 6146.28

MK-HPSO has less deviation when compared to HPSO because of

its cluster-first and route-second method. The result obtained by MK-HPSO is

compared with HPSO and shown in Table 4.13. The proposed MK-HPSO is

able to provide optimal solution for problem instance 14. It produced good

solution when compared to HPSO.

Page 24: CHAPTER 4 MODIFIED K-MEANS WITH HYBRID PARTICLE …shodhganga.inflibnet.ac.in/bitstream/10603/15491/9/09... · 2015-12-04 · in subsequent generations. The ROV conversion and GA

120

4.5 ILLUSTRATION OF PROPOSED MK-HPSO ALGORITHM

School-bus routing is a real-time application of CVRP. More than

one bus departs from the school to pick up or drop the students in and around

the school. In this, the bus should be routed in such a way that it has to be

utilized to its maximum capacity. To simulate this, random data set is

generated as shown in Table 4.14. The node 1 represents the school, other

nodes represent the stops where the students are to be picked up or dropped.

The number of students at each node is considered as a demand of a node.

The location is the (x, y) coordinate in the Euclidean plane of each nodes /

stops. The bus capacity is 50 and there are three buses available to service

these students.

Table 4.14 Data Set for School Bus Routing

Node Location (x, y) Demand

1 (26, 23) 0

2 (29, 27) 12

3 (30, 25) 8

4 (30, 26) 6

5 (21, 27) 5

6 (21, 27) 3

7 (28, 26) 1

8 (24, 24) 3

9 (23, 26) 1

10 (24, 26) 10

11 (25, 26) 12

12 (26, 25) 3

13 (26, 24) 2

14 (25, 26) 3

15 (31, 23) 5

16 (32, 25) 1

17 (31, 25) 1

18 (32, 22) 2

19 (26, 21) 10

20 (27, 19) 6

21 (30, 20) 5

22 (20, 21) 17

23 (32, 18) 7

Page 25: CHAPTER 4 MODIFIED K-MEANS WITH HYBRID PARTICLE …shodhganga.inflibnet.ac.in/bitstream/10603/15491/9/09... · 2015-12-04 · in subsequent generations. The ROV conversion and GA

121

As already explained, the problem of size 22 is divided into three

sub problems by applying the proposed MK-HPSO. The number of sub

problems is equal to number of buses available for servicing. This partitioning

is done by clustering phase of the MK-HPSO algorithm, i.e., modified k-

means algorithm. The initial scatters of these data are shown in Figure 4.6.

Figure 4.6 Initial Scatter of Stops

Then, the stops are arranged according to their distance from depot in

decreasing order and the initial centroids are selected as shown in Figure 4.7.

Page 26: CHAPTER 4 MODIFIED K-MEANS WITH HYBRID PARTICLE …shodhganga.inflibnet.ac.in/bitstream/10603/15491/9/09... · 2015-12-04 · in subsequent generations. The ROV conversion and GA

122

Figure 4.7 Initial Centroid Selections

After the selection of initial centroid, the stops are arranged

according to their demands in non-increasing order. The stops are then

assigned to the nearest centroid forming the group. The first level of

clustering is shown in Figure 4.8. The cluster shows that the points are not

clustered based on their distance alone to nearest centroid. After convergence,

the final clusters are shown in Figure 4.9.

Page 27: CHAPTER 4 MODIFIED K-MEANS WITH HYBRID PARTICLE …shodhganga.inflibnet.ac.in/bitstream/10603/15491/9/09... · 2015-12-04 · in subsequent generations. The ROV conversion and GA

123

Figure 4.8 Initial Clustering of Stops

Figure 4.9 Final Clustering

Page 28: CHAPTER 4 MODIFIED K-MEANS WITH HYBRID PARTICLE …shodhganga.inflibnet.ac.in/bitstream/10603/15491/9/09... · 2015-12-04 · in subsequent generations. The ROV conversion and GA

124

The three clusters formed around the school by modified k-means

algorithm are shown in Table 4.15. An aggregate demand of each cluster does

not exceed the bus capacity 50.

Table 4.15 Clusters Formed by Modified K-Means Clustering

Cluste

r

Stops assigned Total

demand

1 (9, 21, 4, 5, 7, 8) 39

2 (14, 2, 20, 18, 22, 19, 17, 15, 16) 45

3 (10, 1, 3, 11, 12, 13, 6) 38

The constraints (4.11) and each that should be serviced by one bus

are taken care by the clustering algorithm itself. More over, the problem of

large size is partitioned into sub problems of smaller size. These three clusters

are taken as input by proposed PSO, where optimal routing sequence is

formed for each cluster. Figure 4.10 shows the routes formed for each cluster

with its route cost and overall route cost.

Figure 4.10 Routes within each Clusters Formed by MK-HPSO

Page 29: CHAPTER 4 MODIFIED K-MEANS WITH HYBRID PARTICLE …shodhganga.inflibnet.ac.in/bitstream/10603/15491/9/09... · 2015-12-04 · in subsequent generations. The ROV conversion and GA

125

4.6 CONCLUSION

The MK-HPSO concentrates in applying modified k-means

algorithm for clustering and HPSO algorithm for finding the route to solve

CVRP. The objective of the work is to find the minimum cost of travel for

each vehicle. The methodology described above adapts simple techniques like

k-means algorithm and PSO algorithm. The time complexities of the

algorithms are analyzed that run in polynomial time. The time complexity of

the algorithm is greatly saved in the case of clustering and routing. Instead of

forming a giant route and finding the optimal, the clusters are formed and the

routes are formed which greatly simplifies the problem.

In the performance analysis, the bench mark data instances are

solved to evaluate the total route cost measure. Experimental results have

shown that the priority applied to handle the capacity constraint can guide the

search direction.

The MK-PSO works efficiently when compared to HPSO. The

HPSO has 0.15% of deviation for Augerat et al. data set and 0.91% of

deviation for Christofides et al with respect to MK-HPSO. It provides optimal

result when the customers are clustered in nature. It has less deviation from

the optimal for other problem instances. The MK-HPSO has 2.14% deviation

from BKS for MDVRP problem instances. It also produces optimal solution

for a problem 14.