Using greedy clustering method to solve capacitated location-routing problem

This paper introduces a new heuristic method to solve the location-routing problem (LRP). Facility location problem (FLP) and vehicle routing problem (VRP) are considered simultaneously in the LRP. The problem selects the location of depot(s) to be established among a set of potential sites. On the other hand, the allocation of customers to depot(s), and the distribution routes between the customers and depot(s) are decided, too. In this paper, capacitated LRP (CLRP) is considered, in which the vehicles and the depots have a predefined capacity to serve the customers. A greedy clustering method (GCM-LRP) in four phases is proposed. The method clusters the customers using a greedy search algorithm, selects the most appropriate location of depot(s), allocates the clusters to the depot(s), and finally sets routes between the depot(s) and customers using ant colony system (ACS). The numerical experiments on a set of benchmark instances show the efficiency of the proposed method.

The LRP is defined as a facility location problem (FLP) that solves the vehicle routing problem (VRP), simultaneously.
LRP is applicable for a wide variety of fields such as food and drink distribution, newspapers delivery, waste collection, bill delivery, military applications, parcel delivery and various consumer goods distribution (Zarandi et al., 2011).In capacitated LRP (CLRP), the problem is constrained with the vehicles and the depot(s) capacities to supply the customers.Furthermore, the customers must only be supplied by a single vehicle; in other words, the vehicle meets every customer in a cluster, once.The objective is to minimize the routing and location costs (Bouhafs et al., 2006;Barreto et al., 2007).
In CLRP, a homogenous fleet of vehicles transports the products with specific capacity from depots to the customers and return there as soon as finishing the entire tour.It is assumed that the location and demand of customers are known in advance due to previous patterns and data.Moreover, the capacity and the type of products for each potential site are predefined.The unitary cost of distribution system and the capacity of the vehicles are considered in solving the problem too.The objectives are to determine the location of depots, and a set of customers to be served by each depot as well as the distribution routes.
This paper proposes a greedy clustering method (GCM-LRP) to solve the CLRP.Since a greedy search algorithm was used for clustering the customers, the proposed method is called "greedy clustering method".In first step, the customers are clustered using a greedy search algorithm.Then, among a set of potential depots, the most appropriate one(s) are selected to be established.The third step allocates the clusters to depots, and finally, ant colony system (ACS) is applied to set up the best routes between the depot(s) and the assigned customers.

LITERATURE REVIEW AND PROBLEM DEFINITION
A given set of customers with known demand are considered to be served in the LRP.On the other hand, the LRP considers a set of potential sites for the depots.The objectives are to determine the location of depot(s), and efficient allocation of customers to the depots and appointing routs to supply the customers, while minimizing the costs associated with establishing the depot(s) and product distribution to the customers.In the CLRP, demand of each customer should be supplied by a single vehicle, while total load of each route must not exceed the capacity of the vehicle.The routes starts and ends at the same depot, and total load of allocated customers must be less than or equal to the capacity of the depot (Prins et al., 2006).Each potential site for depots needs a fixed cost to be established, and the distribution costs include the set up cost (F) of the route and unitary cost linearly related to the transportation distance between the depot and customers.
The CLRP in this paper includes both kinds of constraints, which is formulated by Prins et al. (2006).It is assumed that m potential sites are available for the depots and there are n customers to be served.A weighted and directed graph G = (V, A, C) shows the set of nodes for depots and customers (V), the arc set associated with each edge (i,j) (A), and the related cost to each arc (C a ).A capacity (W i ) and opening cost (O i ) are related to each potential site (i є I).The customers (j є J) have a demand (d j ), and K vehicles with capacity of Q are available to serve the customers.Let S denote a subset of nodes, then δ + (S) (δ -(S)) is the set of arcs leaving (entering) S, and L(S) is the set of arcs with both extremities in S. If S contains only one node x, then δ + (x) is a simplified form for δ + ({x}).The number of vehicles or the number of routes is the decision variable of the problem.The following binary decision variables are defined for the model, y i = 1 if depot i is established, f ij = 1 if customer j is assigned to depot i, and x ak = 1 if arc a is used in the route performed by the vehicle k є K, and zero otherwise.Therefore, the problem can be formulated as the following zero-one programming model.

Minimize
The objective function (1) is the sum of depot(s) opening costs and the routing costs, including the travel costs and the fixed costs to set up a route.Each customer should be served within one route only and the customers should have only one predecessor, which is stated by constraint (2).Constraints (3) and (4) imply that total load assigned to a route or a depot must be less than its capacity.The continuity of the routes and return to the original depot are guaranteed through constraints ( 5) and (6).Constraint ( 7) is to eliminate subtours.Constraint (8) specifies that a customer can be assigned to a depot only if a route linking them is opened.Finally, constraints (9), (10), and (11) specify the binary variables used in the formulation.
The CLRP is an NP-hard problem, so some approximating heuristic algorithms had been developed to solve it (Marinakis andMarinaki, 2008a, 2008b;Barreto et al., 2007).In this kind of problems, the solution times increase exponentially as with an increase in the size of the problem, while an exact algorithm is applied to solve them.Nagy and Salhi (2007) categorized the heuristics algorithm presented in literature in four main groups which are, sequential, clustering, iterative, and hierarchical methods.In sequential methods, the summation of depot-to-customer distances is minimized in the first step.Then, the VRP is solved based on the location of depots.The clustering-based methods, first set up clusters for the customers, then, either solve the VRP for each potential site, or solve the traveling salesman problem (TSP) to find the best location of depots.In iterative heuristics, VRP and FLP subproblems are solved iteratively, feeding information from one phase to the other.In hierarchical method, location of depots is the main problem and routing is a subordinate problem.
Albareda-Sambola et al. ( 2005) developed a two-phase tabu search algorithm for the LRP with one single route per capacitated open depot.The two phases consist of an improvement that optimizes the routes and a permutation that modifies the set of open depots.Bouhafs et al. (2006) described two-phase procedure to solve the CLRP.First, a simulated annealing algorithm finds a good configuration of distribution centers, and then the ant colony system (ACS) seeks for a good routing related to the configuration.The two-phase is run repeatedly until the total costs justify the algorithm termination.The results showed the efficiency of their method.Prins et al. (2006) for CLRP, proposed a greedy randomized adaptive search algorithm combining with a learning process to set up the depots and a path relinking (PR) adaptive search method to solve the routing problem.Moreover, Prins et al. (2007) presented a cooperative heuristic to solve the CLRP.Their heuristic was based on the principle of alternating between a locating phase and a routing phase, exchanging information on the most promising edges.Barreto et al. (2007) proposed a cluster analysis based on sequential heuristics.Moreover, four grouping techniques and six proximity measures were applied to obtain several versions of the heuristic.As a result, they provided guideline to choose a suitable clustering technique in future application.Marinakis and Marinaki (2008a) proposed a genetic algorithm for the LRP in a large wood distribution company in Greece.The problem was solved in two levels, in which the optimal location of the depots and the optimal routing of the vehicles are decided in strategic and operational levels, respectively.The results of the benchmark test cases showed that for six problems, a new best solution was found.Moreover, Marinakis and Marinaki (2008b) proposed a particle swarm optimization (PSO) algorithm for LRP, in which PSO and multiple Nadizadeh et al. 7501 phase neighborhood search, the expanding neighborhood search, and PR are combined to solve the problem.The comparative results showed that their proposed method obtained the same or better results than the best known solutions (BKS).Lopes et al. (2008) developed a decision tool and user interface to solve the CLRP.The user interface can help managers who do not have any background on modeling and optimization methods, to make more scientific decision, in a way that is easily understandable.They used a sequential "distribution-first location-second" heuristic method to solve the problem in background of the software.Schwardt and Fischer (2009) addressed the singledepot LRP and proposed a neural network approach based on a self-organizing map to solve the considered problem.They compared the efficiency of their proposed algorithm with some well-known heuristics and reported that the self-organizing map approach is almost as efficient as some of them.Zarandi et al. (2011) presented a multi-depot capacitated LRP (MDCLRP) in which travel time between two nodes was a fuzzy variable.A simulation-embedded Simulated Annealing (SA) procedure was proposed in order to solve the problem.They tested the proposed method using a standard test problem of MDCLRP and the results showed that the proposed method is robust and could be used in real world problems.

DETAILS OF THE HEURISTIC METHOD
A greedy clustering method, GCM-LRP, is presented to solve the CLRP.In general, GCM-LRP consists of four phases, which is illustrated in Figure 1.In first phase, the customers are clustered using a greedy search algorithm (Figure 1a).The nearest customer to last added customer to the cluster is selected to be included in the cluster.This is the same as to form a tour in TSP, in which the nearest city to the current city (in a "greedy" search algorithm) is selected as next destination.So, the proposed heuristic method is called "greedy clustering method".Each cluster should include as much customers as its total demand, being less than the capacity of vehicle (Cap).In second phase, the gravity centre of each cluster is calculated, which is used to select depot(s) to be established (Figure 1b).The minimum number of required depots is selected to cover total demand of customers and minimizing total cost of establishing depot(s).The clusters are allocated to the opened depot(s) in third phase, considering the distance between the gravity center of clusters and depot(s) and the capacity of depots (Figure 1c).Finally, in fourth phase, ACS forms an admissible tour between each cluster and depot (Figure 1d).The problem is initialized by defining a plane comprising the set of customers, depots, and their coordinate points which are, CUST and DEP, respectively.The heuristic method is repeated for a predefined number of iterations.When the algorithm obtained a better solution, it is replaced to the last best known solution.
In the proposed algorithm, clustering and iterative methods are hybridized efficiently.The customers are clustered into some clusters in advance, and then, the best location of depots is founded by the constituted clusters.It is important to mention, VRP and FLP which are two sub problems of CLRP are solved iteratively so that at each iteration, a better solution for overall problem replace the last one.Moreover, since in the first phase of GCM- LRP, the first customer at each cluster is selected randomly, the constituted clusters at each iteration of proposed algorithm are different together.Thus, the proposed algorithm can search some feasible solutions among all the solution space.This can ensure that GCM-LRP avoid confining suboptimal solutions.Details of heuristic method are described further.

Clustering the customers
The first phase of the GCM-LRP is to cluster the customers.The customers are grouped considering their intra distance and the capacity of the vehicles.A greedy search algorithm is used to select a set of customers.In the first step, a customer is selected randomly from the set of non-clustered customers belonging to CUST, to form a cluster.The algorithm searches for the nearest customer to the last selected customer of the current cluster.The nearest customer is not included in the cluster if either of the following criteria is met: i.The number of assigned customers to a cluster reached the maximum number of allowed customer per cluster (N); ii.Total demand of customers is more than the Cap.
When the number of customer in each cluster reaches a given number, there is no opportunity for any of the customers to enter the cluster, even adding its demand to total demand of cluster, which is less than the Cap.This is to balance the number of customers in various clusters, which influences choosing the depots in next phase, and the final solution.The maximum number of members for a cluster is determined using a trial and error method.
Once a new customer is selected to be included in a cluster, total demand of current members of the cluster adding to its new member is compared with the capacity of the vehicle.If total demand is less than the capacity of the vehicle, the customer is included in current cluster.On the other hand, if total demand of customers exceeds the Cap, last selected customer is withdrawn from the cluster, and its demand is deducted from total demand of the cluster.This customer is removed from the current search space of the algorithm.The greedy search algorithm searches for a new customer close to the last added member of the cluster among the ungrouped customers.This is to use the maximum capacity of a vehicle.The algorithm forms a new cluster if there are either no more customers to be included in current cluster maintaining the Cap constraint, or the maximum number of customer per cluster is reached.When there are no more customers without a cluster, the algorithm stops.Figure 2 illustrates the greedy search algorithm.

Choosing the depots
The second phase of the GCM-LRP searches potential sites to START Select a customer from CUST, randomly.
Calculate total demand of the cluster (Dem).
Is the number of customers in this cluster ≤ N?
Is Dem ≤ Cap?
Is there any unclustered customer?
Add the new customer to the cluster, and remove it from the search space and CUST.
Remove the selected customer from the current search space.
Deduct demand of the customer from Dem.
Is there any customer in current search space?

END
Search the current space for the nearest customer to last added member of cluster.establish depot(s).In the first step of the phase, the gravity centre of the clusters is calculated according to Equation ( 12), in which (X(I),Y(I)) is the coordinates of gravity center of I th cluster, (xi,yi) is the coordinates of i th customer of I th cluster, and nI is the number of customers in I th cluster.The gravity centre of the cluster is used as a representative to allocate it to the proper depot:

Yes
Choosing the potential site(s) for depot(s) is the same as single facility location problem (SFLP).In this step, the sum of distances between the gravity centre of the clusters and potential sites is calculated.The potential sites are sorted ascendingly according to their Euclidean distance with gravity centre of clusters, which is calculated by Equation ( 13).
In this equation, (x * ,y * ) is the coordinates of desired potential site among all the candidates.Moreover, wj is the total Euclidean distance between j th potential site and the gravity centre of clusters, (xj,yj) is the coordinates of j th site, (ai,bi) is the coordinates of gravity center of i th cluster, m is the number of clusters, and n is the number of potential sites: ,..., 1 : , sorted list of potential sites, the first site is selected to be If total demand of customers in all clusters is satisfied through the capacity of the first depot, the second phase will be finished.Otherwise, the next potential site (according to the sorted list of sites), is selected to supply the clusters.This procedure is repeated until the demand of all the clusters is covered.Therefore, the GCM-LRP always establishes minimum number of depots.

Allocating clusters to depot(s)
The vehicles start their journey from a depot, move to all the customers of a cluster, and return to the depot once finishing the service to the customers.In the third phase of the GCM-LRP, the clusters are allocated to the opened depot(s).Each depot is able to serve some clusters according to its capacity, and each cluster is supplied from exactly one depot.To allocate the clusters, the Euclidian distance of gravity centre of the clusters to the first depot is calculated.Based on the distance, the clusters are sorted ascendingly.The first cluster is allocated to the depot if its demand is less than or equal to the capacity of the depot.If there is unallocated capacity for the first depot, the next cluster is allocated to the depot if the total allocated demand to the depot is less than its capacity.Otherwise, other sorted clusters are considered to be allocated to the depot.The allocation process is finished once there are no more clusters to be allocated to the depot maintaining the constraint of the depot capacity.This procedure is repeated for the remainder of the established depots and clusters.

Routing
In the fourth and last phase of the GCM-LRP, the routing problem for the vehicles from the depot to the customers in each cluster is solved.Each cluster is served by exactly one vehicle, and some vehicles are supplied from a depot based on its capacity.The routing problem of CLRP is the same as TSP, which is solved by using ant colony system.ACS is referred to ants' treatment to find food.The ants spread a material called pheromone and put it on their way so that other ants can pass the same route.The pheromone of shorter route increases and therefore, more ants move from that way.Artificial ants construct a solution by selecting a customer to visit sequentially, until all the customers in a route have been visited.Ants select the next city to visit using a combination of heuristic and pheromone information.A local updating rule is applied to modify the pheromone on the selected arc, during the construction of a route.Once all ants have constructed their tours, the amount of pheromone of the best selected route and the global best solution, are updated according to the global updating rule.Dorigo et al. (1996) mentioned that the proper parameters' values in their proposed heuristic ACS algorithm are α = 1, β = 5 and = 0.65.Hence, these values are selected in routing phase (phase 4) of the proposed heuristic algorithm.More details on ACS can be found in Dorigo et al. (1996) and Bouhafs et al. (2010).

RESULTS
To validate the efficiency of the presented GCM-LRP, a series of computational experiments are carried out.The efficiency of the proposed algorithm is evaluated by using 19 standard benchmark instances of CLRP presented by Barreto (2003).The proposed heuristic algorithm is programmed in MATLAB ® 7.0.4 on a computer, holding Intel ® Core™ Duo CPU T2450 2.00 GHz.The comparative results are summarized in Table 1.First column indicate the author of the instance, the number of customers, and the number of potential depot sites.Second column shows the vehicle capacity in the instances, and the third column reports the best known solutions (BKS) that either are given in the literature or obtained in this study.The solutions obtained by SA-ACS (Bouhafs et al., 2006), GRASP (Prins et al., 2006), LRGTS (Prins et al., 2007), the clustering based heuristic (CH) (Barreto et al., 2007) and HybPSO-LRP (Marinakis and Marinaki, 2008b) are shown in columns 4 to 8. Column 9 shows the solutions obtained by the proposed GCM-LRP.
In the tenth column, the minimum number of required depots is given for each instance.The GCM-LRP establishes the minimum number of depots, which can be calculated through Num of Dep = [D/R] + 1, where R is the capacity of depot and D is the total demands of customers.[D/R] is the biggest integer number which is less than D/R.The Minimum number of required vehicles is illustrated in the last column, that can be calculated through Num of Veh = [D/r] + 1 in which r is the capacity of the vehicle.D, R and r can be obtained by data in Barreto et al. (2007).Computational results show that the GCM-LRP has obtained 9 best solutions out of the 19 instances; while 2 of them are new best solutions.Further comparison of the performance of three algorithms that could solve all standard instances is shown in Table 2.It can be seen that the proposed heuristic method is competitive with two other algorithms in terms of solution quality by providing the lowest average gap.For each algorithm, the gap of the heuristic to the BKS is defined as: %100 × (solution obtained by algorithm -BKS) / BKS.In GCM-LRP, the average gap is 1.33% that can indicate the efficiently of the proposed GCM-LRP heuristic.

CONCLUSION AND FUTURE RESEARCH
A new heuristic method for the capacitated locationrouting problem is presented in this paper.In CLRP, the vehicles and depots have a predefined capacity to supply the customers.The aims of the problem are to select locations for establishing the depots among a set of potential sites, to allocate the customers to the depots according to their demand and find the best route for the vehicles between the customers and the depot.The objective function of the proposed method is to minimize the opening costs of depot(s), and the tour cost of the vehicles.The is presented in four phases; in the first phase, the customers are clustered based on a greedy search algorithm.In the second phase, the best location of depots based on the distance of the potential sites and the gravity centre of clusters is determined.The proposed heuristic method uses minimum number of depots to solve the CLRP.The clusters are allocated to opened depots according to the capacity of the depot and the distance between the depot and the clusters in third phase, and the best routes between the depot and allocated clusters are decided in the fourth phase.
Computational results and comparisons of the GCM-LRP algorithm with various promising LRP heuristics shows that, the efficiency of the proposed algorithm is satisfactory so that proposed algorithm obtains 9 best solutions out of 19 instances, while 2 of them indicate new best solutions.Moreover, the qualities of the obtained solutions demonstrate that, the proposed GCM-LRP has the lowest average gap in comparison with three other algorithms that can solve all standard instances.
The LRP has attracted more researches in recent years.However, many parameters still needs more researches, for example, it is highly recommended to include stochastic demand of customers in the formulation of the problem.Delivery time constraints for each customer, and/or adding the variable costs of establishing depots are interested for future researches, too.

Figure 1 .
Figure 1.Illustrative example for the proposed heuristic method.

Figure 2 .
Figure 2. The proposed greedy search algorithm.