A heuristic algorithm for a multi-product four-layer capacitated location-routing problem

Article history: Received July 2 2013 Received in revised format September 7 2013 Accepted September 27 2013 Available online September 27 2013 The purpose of this study is to solve a complex multi-product four-layer capacitated locationrouting problem (LRP) in which two specific constraints are taken into account: 1) plants have limited production capacity, and 2) central depots have limited capacity for storing and transshipping products. The LRP represents a multi-product four-layer distribution network that consists of plants, central depots, regional depots, and customers. A heuristic algorithm is developed to solve the four-layer LRP. The heuristic uses GRASP (Greedy Randomized Adaptive Search Procedure) and two probabilistic tabu search strategies of intensification and diversification to tackle the problem. Results show that the heuristic solves the problem effectively. © 2014 Growing Science Ltd. All rights reserved


Introduction
Distribution network design is a very important part of supply chain management.The Location-Routing Problem (LRP) integrates location, allocation, and vehicle routing problems to design efficient distribution networks (Hamidi et al., 2011(Hamidi et al., , 2012a(Hamidi et al., , 2012b)).The location problem locates facilities in a series of locations.The allocation problem allocates customers to facilities.The vehicle routing problem determines a set of routes for a fleet of vehicles, based at one or several depots, to serve a number of customers (The VRP Web, 2013).The LRP aims to minimize the total depot and transportation costs (Nagy & Salhi, 2007).The difference between the LRP and the classical locationallocation problem is that in the LRP customers are served through tours, but in the classical locationallocation problem they are served through straight-line or radial trips from the facility to the customer (Min et al., 1998).Some LRP applications are food and drink distribution, newspaper distribution, parcel delivery, and waste collection (Nagy & Salhi, 2007).The LRP is one of the combinatorial optimization problems (Nagy & Salhi, 2007).LRP models include too many variables and constraints to be solved in a short amount of time by exact methods (Laporte, 1988).The LRP is an NP-hard, Nondeterministic Polynomial-time hard, problem, and exact methods can only solve small problems in a reasonable amount of time (Nagy & Salhi, 2007).The useful methods to solve larger LRPs have been heuristics (Ambrosino & Scutella, 2005).

Literature Review
The majority of studied LRP models are two-layer LRPs in which the distribution network consists of two layers of depots and customers (Ambrosino & Scutella, 2005).Two-layer LRPs solve three problems (Hamidi et al., 2011(Hamidi et al., , 2012a(Hamidi et al., , 2012b)): 1) location problem: given a series of candidate locations, how many depots should exist and where should they be placed?, 2) allocation problem: which customers should be assigned to which depot?, and 3) routing problem: how many tours are needed for each depot, which customers should be served on each tour, and what is the order of customers on each tour?.In this section some of the two-layer LRPs are reviewed.Wu et al. (2002) used simulated annealing and tabu search to solve the location-allocation problem and the vehicle routing problem sequentially and iteratively.Prins et al. (2006) applied GRASP followed by a path relinking procedure to tackle the LRP.Barreto et al. (2007) presented a cluster analysis based sequential heuristic.Marinakis and Marinaki (2008) developed a bi-level formulation that decomposes the problem to a capacitated facility location problem and a vehicle routing problem.They used genetic algorithm, GRASP, and neighborhood search techniques in their heuristic.Duhamel et al. (2010) introduced a heuristic that is a GRASP hybridized with an evolutionary local search.Yu et al. (2010) used simulated annealing to solve the LRP.
Multi-layer (three-layer and four-layer) LRPs have been researched in a few studies.Bruns et al. (2000) worked on a parcel delivery system.Post offices (PO) send the parcels to parcel processing centers (PPC), and PPCs send the parcels to delivery bases (DB).PPCs or DBs deliver the parcels to customers.Although the problem is a four-layer LRP, the authors converted it to a two-layer LRP by fixing the locations of PPCs and allocating DBs to PPCs.Also, by categorizing customers into customer zones, the authors changed the problem to a location problem in which the decisions are locating DBs and assigning customer zones to PPCs and DBs.Then the problem was solved by a branch-and-bound algorithm.Ambrosino and Scutella (2005) presented and formulated a four-layer LRP.The distribution network has one plant, central depots (CD), transit points (TP), and customers.Only one product is produced and distributed in the network.The decisions are: 1) location, locating CDs and TPs, 2) allocation, allocating TPs and customers to CDs and allocating customers to TPs, 3) routing, routing between CDs, TPs, and customers starting from CDs and routing between TPs and customers starting from TPs, and 4) the amount of products sent from the plant to CDs and from CDs to TPs.The authors obtained optimal solutions only for small problems.The computational time is very large even for small problems.Aksen and Altinkemer (2008) introduced an LRP with three layers of warehouses, stores, and customers (online and walk-in).Warehouses ship products to stores.Products are sold to walk-in customers who go to stores.Also, stores deliver products to online customers.The decisions are store location, customer allocation, vehicle routing, and transshipment.The authors presented a lagrangian relaxation based solution method to solve the problem.The results show that the method is not useful for large problems, with 100 or more online customers, as the solution times are very long.May and Tu (2008) studied a pickup operation.The three-layer LRP consists of one warehouse, transshipping points (TP), and customers.In the network customer orders are delivered to TPs.Then, TPs send the freights to the warehouse.The decisions are: 1) locating TPs, 2) allocating customers to TPs, 3) routing between customers and TPs, and 4) routing between TPs and the warehouse.The authors formulated the LRP and found the optimal solution for small problems, with 4 TPs and 20 customers.No algorithm that can solve large problems was presented in this work.Lin and Lei (2009) discussed a three-layer LRP.The decisions are: 1) the locations of distribution centers (DC's), 2) identifying the big clients to be included in the first level routing (the routing between plants, DC's, and big clients), 3) the first-level routing, and 4) the second-level routing between DC's and other clients not included in the first-level routing.The authors used a genetic algorithm heuristic to solve the problem.Ambrosino et al. (2009) studied a three-layer LRP consisting of one central depot, regional depots, and customers.In the network, customers are partitioned into regions.One regional depot should be selected in each region.The central depot provides general products, and the regional depots provide regional products.In each region each tour must include both the central depot and the selected regional depot.The authors modeled the LRP as a mixed-integer linear programming model and introduced a heuristic that uses clustering and neighborhood search techniques.The heuristic is useful only for small and medium-size problems.The computational time is very large for large problems.Lee et al. (2010) discussed a four-layer LRP in which only one product is distributed.The network consists of suppliers, manufacturers, distribution centers (DC), and customers.The decisions are: 1) location, locating manufacturers and DCs; 2) allocation, allocating suppliers to manufacturers and allocating customers to DCs; 3) routing, routing between manufacturers and suppliers starting from manufacturers and routing between DCs and customers starting from DCs; and 4) transportation, transporting products from manufacturers to DCs.The comprehensive surveys on the LRP can be found in Balakrishnan et al. (1987), Laporte (1988), Min et al. (1998), andNagy andSalhi (2007).

The Multi-Product Four-Layer Distribution Network
The LRP studied in this work is a complex multi-product four-layer capacitated LRP.This LRP is an extension of the LRP that we discussed in Hamidi et al. (2012b).As we described in Hamidi et al. (2011Hamidi et al. ( , 2012aHamidi et al. ( , 2012b)), the four-layer LRP represents a distribution network consisting of plants (P), central depots (CD), regional depots (RD), and customers (C).This distribution network is depicted in Fig. 1.General characteristics of this distribution network are as follows (Hamidi et al., 2012b):  (Hamidi et al., 2011(Hamidi et al., , 2012a) ) In the LRP discussed in this work, we take into account two specific constraints and add them to the LRP that we studied in Hamidi et al. (2012b).The constraints are as follows: 1) Plants have limited production capacity.In the scenario that we discussed in Hamidi et al. (2012b), each plant produces all types of products, and the production capacity for each product is unlimited (very large).But in the LRP presented in this paper each plant does not necessarily produce all types of products and has a certain production capacity for each product.2) Central depots have limited capacity for storing and transshipping products.In Hamidi et al. (2012b) it is assumed that to transship products, CDs have unlimited storage capacity.
In this new scenario, each plant may have to send products to other plants directly or through CDs.Also, each facility may have to receive products from multiple facilities.We developed and presented the formulation of this LRP as a mixed integer programming model in Hamidi et al. (2011Hamidi et al. ( , 2012a)).The decisions of the LRP are (Hamidi et al., 2011(Hamidi et al., , 2012a): 1) location, locating CDs and RDs; 2) allocation, allocating customers to facilities; 3) transshipment between facilities; and 4) routing between facilities and customers.Since large LRPs cannot be solved in a reasonable amount of time by using exact algorithms, we developed a heuristic that is capable of solving large problems.The heuristic is presented in the following section.

The Heuristic Algorithm
The heuristic developed for this LRP uses the same structure of the heuristic that we had developed for the LRP in Hamidi et al. (2012b) but the content of the heuristic is different.The heuristic structure is shown in Fig. 2.

Fig. 2. The heuristic structure
We used GRASP (Greedy Randomized Adaptive Search Procedure) and two tabu search strategies of intensification and diversification in the first procedure of the heuristic.GRASP has two phases of construction and local search (Feo & Resende, 1995).The construction phase creates a greedy randomized solution, and the local search improves the solution by searching the neighborhood of the solution (Resende & Ribeiro, 2003).The intensification strategy in tabu search tries to generate solutions that are similar to high quality solutions, and the diversification strategy tries to generate solutions that are different from the generated solutions and search the areas of the solution space that have not been searched (Glover & Laguna, 1997).The core and the most important part of the heuristic is the construction phase of GRASP.In the construction phase, we developed a 7-step GRASP for the LRP presented in Hamidi et al. (2012b), whereas for the LRP presented in this paper a 13-step GRASP has been developed to consider the two additional constraints mentioned in the previous section.Also, in the local search phase the content of the transshipment path swap and the way it works is different from the transshipment path swap presented in Hamidi et al. (2012b).

Procedure 1: Location-Allocation-Transshipment
This procedure selects depots, assigns customers to facilities, and builds transshipment paths.In each round of the GRASP, n solutions are generated by the construction phase and improved by the local search phase.The steps of these two phases are as follows.In these steps, a facility is a plant, a CD, or an RD.Also, a depot is a CD or an RD.As shown in Fig. 2, after each round of the GRSAP, the list of elite solutions, best solutions found so far, is updated.

Construction Phase
Step 1.
For each plant, allocate the customers whose distances from the plant are less than or equal to the coverage radius.The coverage radius is the maximum desirable distance of a customer from a facility to which the customer can be allocated.From the practical point of view, it is not desirable to assign distant customers to the facility because multiple customers are to be served in each tour and the tour length is limited.So, this radius can be a fraction (less than ½) of the maximum tour length, e.g. one fourth of the maximum tour length, to make sure that multiple customers are served in one tour.
For each plant, calculate the demand of the plant for each product; the demand of the plant is the total demand of the customers assigned to the plant.The minimum of the production capacity of the plant for the product and the demand of the plant is assigned to the plant.If there is unsatisfied demand for the plant, go to Step 3 (the plant is called the facility), otherwise go to Step 8.
If there is a plant whose distance from the facility is less than the maximum direct shipment distance, the minimum of the remaining production capacity of the plant for the product and the unsatisfied demand of the facility is assigned to the plant, and a transshipment path is constructed from the plant to the facility.If there is unsatisfied demand for the facility, do Step 4 and Step 5 until the demand is satisfied.
Select the nearest plant to the facility that has a remaining production capacity for the product more than zero.The minimum of the remaining production capacity of the plant for the product and the unsatisfied demand is called XX.
Among plants and open CDs with the following conditions, find the nearest one to the selected plant (called facility B).  Their distances from the facility are less than the maximum direct shipment distance. Their remaining throughput capacity is more than zero. Their distances from the selected plant are less than the distance between the facility and the selected plant.
If no such a facility is found, among closed CDs whose distances from the facility are less than the maximum direct shipment distance, find the nearest one to the selected plant (called facility B) and open it.The minimum of XX and the remaining throughput capacity of facility B for the product is called XX1.Construct a transshipment path from facility B to the facility.Increase the unsatisfied demand of facility B by XX1.Reduce XX by XX1.Reduce the unsatisfied demand of the facility by XX1.If XX is not zero, restart Step 5.If XX is zero and there is still unsatisfied demand, go to Step 4.
For each opened CD with unsatisfied demand, go to Step 3 to construct the transshipment paths.

Step 7.
For each open CD, do the following:  Assign the near unassigned customers to the depot until the remaining capacity of the depot is less than the customer's demand or the distance between the depot and the customer is more than the coverage radius; sort the unassigned customers based on their distances to the depot and start from the nearest customer. For each product, calculate the demand of the facility. Go to Step 3 to construct the transshipment paths.
Create the main list.Add all of the plants and already opened CDs to the main list; the main list includes all plants and open CDs some of which will be added to the list in following steps.Select the first facility in the main list.
Create the restricted candidate list (RCL) for the selected facility.The RCL for the facility is the list of depots with the following characteristics:  The depot is unopened. The nearest customer to the depot has not been assigned to any facility. The depot can directly be connected to the selected facility; its distance to the facility is less than or equal to the maximum direct shipment distance. If the selected facility is a CD, only depots that cannot directly be connected to any plant can be in the RCL.
Step 10.From the RCL of the selected facility, randomly select a depot and do the following:  Open the depot. If the depot is a CD, add it to the end of the main list. Assign the near unassigned customers to the depot until the remaining capacity of the depot is less than the customer's demand or the distance between the depot and the customer is more than the coverage radius; sort the unassigned customers based on their distances to the depot and start from the nearest customer. Do Steps 3 to 7 to construct the transshipment paths.
Step 11.If all customers are assigned, finish the construction phase.
Step 12. Select the next facility in the main list (in case the main list is exhausted, the next facility is the first facility in the main list) and update its RCL.If the RCL is not empty, go to Step 10.Otherwise, restart Step 12.If the RCLs of all facilities in the main list are empty and at least one customer has not been assigned, go to Step 13.
Step 13.For an unassigned customer, find the nearest closed depot and open it.Assign the near unassigned customers to the depot until the remaining capacity of the depot is less than the customer's demand or the distance between the depot and the customer is more than the coverage radius; sort the unassigned customers based on their distances to the depot and start from the nearest customer.To construct transshipment paths for the opened depot, do Steps 3 to 7. Restart this step until all customers are assigned.
The GRASP considers all of the constraints of the LRP and tries to generate greedy (high quality) solutions.To reduce transshipment and location costs, the depots are tried to be connected directly or indirectly to the nearest plants; if indirectly, through already opened CDs near to the plants.To reduce the location cost, the GRASP allocates customers to CDs that are already opened for transshipping products to other depots.It also allocates as many customers as possible to a depot to reduce the number of open depots.To reduce the routing cost, the GRASP allocates the closest customers to each depot.As seen in the GRASP, a depot will not be in the RCL if the nearest customer to the depot is already allocated.This reduces the routing cost and the number of opened depots.
The total cost of each solution is the sum of the location cost, transshipment cost, and estimated routing cost.Because the tours are not built in the first procedure, Eq. ( 1) is used to estimate the routing cost (Sajjadi et al., 2011;Hamidi et al., 2012b): where j is facilities, ft is the fixed cost of one tour, nt j is the approximate number of tours for facility j, tc is the travelling cost per mile for a vehicle, D j is the total of direct distances from facility j to customers allocated to facility j, c j is the average number of stops on one tour, and n j is the number of customers allocated to facility j.The approximate number of tours for facility j (nt j ) is which is rounded to the nearest integer larger than the ratio, where j d ˆ is the total of demands of customers allocated to facility j and vc is the vehicle capacity.The average number of stops on one tour (c j ) is the average number of customers on one tour which is equal to j d vc , where j d is the average demand of customers allocated to facility j.

Local Search
The following local search steps are applied iteratively until the solution cannot be improved in both steps.The "Transshipment Path Swap" decreases the transshipment cost, and the "Depot Drop" decreases the location cost. The amount of the product sent from C to B is greater than or equal to that of sent from B to A. For each pair of B and C, if the distance between A and C is less than the maximum direct shipment distance, instead of indirectly transshipping the product from C to A through B, use the direct path from C to A to transport the product directly from C to A. Otherwise, find an open CD or a plant (D) with the following conditions:

Transshipment
 Its distances from A and C are less than the maximum direct shipment distance. It has enough remaining capacity for transshipping the current flow of the product from B to A. If the total distance from C to D and D to A is less than the total distance from C to B and B to A, replace B with D for transshipping the product from C to A.

Depot Drop:
For each open RD, if no customer has been allocated to the RD, close it.For each open CD, if no customer has been allocated to the CD and the CD is not a transshipment point, through which products are not transported to other depots, close it.

Diversification and Intensification
In this heuristic, we used the same unbiased, intensification, and diversification strategies as we used in Hamidi et al. (2012b).Under the unbiased strategy, in Step 10 of the construction phase of the GRASP, all depots in the RCL have the same chance to be selected.The intensification strategy searches the promising regions of the solution space by favoring the most frequently selected depots existing in the elite solutions (Hamidi et al., 2012b).This strategy is applied in Step 10 of the construction phase of the GRASP.The depots that are more frequency selected in the elite solutions have a higher chance to be selected in this step of the GRASP.Using a short-term memory, the intensification strategy uses Eq.
(2) to calculate the selection probability (Hamidi et al., 2012b): where P j1 is the selection probability of depot j1, and freq j1 is the number of times depot j1 is selected in the current elite solutions.
The diversification strategy searches the regions of the solution space that have not been searched by favoring the least frequently selected depots (Hamidi et al., 2012b).This strategy is also applied in Step 10 of the construction phase of the GRASP.The depots that are less frequency selected so far have a higher chance to be selected in this step of the GRASP.Using a long-term memory, the diversification strategy uses Eq. ( 3) to calculate the selection probability (Hamidi et al., 2012b): where freq1 j1 is the number of times depot j1 is selected in all of the solutions obtained so far.
After m rounds of the GRASP, the best solution is selected.This solution includes location, allocation, and transshipment decisions.

Procedure 2: Routing
Using the best solution generated by the first procedure, this second procedure builds tours.In this procedure the Clarke-Wright Savings algorithm, developed by Clarke and Wright (1964), as illustrated in Larsen and Odoni (2007) is used to build tours from facilities to customers.We added the tour length constraint to the algorithm as it was not taken into account in Larsen and Odoni (2007).After building the tours, the node ejection chains algorithm presented by Rego (2001) is used to improve the tours.This algorithm consists of two multi-node exchange and insert processes (Rego, 2001).
In the distribution network, different types of products, with different sizes, are distributed to customers.As we indicated in Hamidi et al. (2012b), to calculate the remaining capacity of depots and vehicles, the volume of the customer's demand is the total number of standard units, e.g.number of cubic feet, for all of the products demanded by the customer.

Computational Results
The heuristic algorithm is coded in MATLAB.A series of problems are generated to test the heuristic.The location of facilities and customers, demands of customers, and capacity of depots are generated in a random fashion.For a large problem, with 3 plants, 20 CDs, 30 RDs, 380 customers, and 5 products, the results are presented in Fig. 3 to Fig. 11.Fig. 3 shows the location of facilities and customers in a 400x400 rectangular area.The dark rectangles are plants; the dark triangles are CDs; the white triangles are RDs; and the circles are customers.Fig. 4 is related to the best solution obtained in one run of the heuristic with 120 iterations.In this figure the opened facilities, the allocation of customers to facilities, and the tours from facilities to customers can be viewed.As seen in Fig. 10 and Fig. 11, the intensification starategy generates the majority of high quality solutions.The diversification and unbiased starategies generate a few high quality solutions.These solutions enter the elite solutions list and are used to generate better soltuions through the follwing intensification rounds.These strategies help the algorithm to search the solution space more effectively.Basically, by using diversification and unbiased strategies the algorithm is not trapped in a few attractive regions of the solution space that are searched by the intensification strategy.As a result more regions of the solution space will be searched in a shorter amount of time.2010) to solve two-layer LRPs, instances with 200 customers and 10 depots, is 1,485 seconds.We used an Intel(R) Core(TM) i5 CPU (3.19GHz) machine with 3.17 GB of RAM to solve the problem.The computational time of the heuristic that we presented in this paper for the four-layer LRP with 3 plants, 20 CDs, 30 RDs, and 380 customers is 165 seconds, which is a very reasonable amount of time.Note that the presented four-layer LRP is a much larger and more complex problem than a two-layer LRP.
To make sure that the heuristic obtains high quality solutions, we used the heuristic to solve different versions of the sample small problem that we solved by the mixed integer programming model in Hamidi et al. (2011Hamidi et al. ( , 2012a)).The small problem has 2 plants, 2 CDs, 2 RDs, and 4 customers.The problem was solved with different production capacities for plants.The heuristic achieved the optimal solution, verified by enumeration, for every version of the problem.
We used a confidence interval analysis to verify the reliability of the heuristic.The above large problem was solved 30 times by the heuristic.The best solution of each run is shown in Table 1.The sample mean, X , and sample standard deviation, S, of the best solutions are 550,989 and 5,478 respectively.X and S are estimators for the population mean, μ, and the population standard deviation, σ, respectively.Based on the central limit theorem, since the sample size is 30, X has a normal distribution with the mean of μ and the standard deviation of n


. The 99% confidence interval (α=0.01) for the best solution mean will be: This analysis shows that with the probability of 99% the best solution mean is less than or equal to 553,320.It was seen that only 33 solutions out of 3600 solutions generated in 30 runs (only 0.9% of the solutions) are less than or equal to the upper limit of the confidence interval (553,320).Note that the 3600 solutions are greedy solutions.This approves the reliability of the heuristic algorithm.
Finally, if the constraint of direct shipment distance is relaxed, the four-layer LRP will become a threelayer LRP.In the three-layer LRP, products can be directly shipped to any facility.Hence, the heuristic is also capable of solving the three-layer LRP.Fig. 12 shows the transshipment paths for product 2 when the three-layer LRP is solved.

Conclusions
The LRP studied in this work is a complex multi-product four-layer capacitated LRP.This LRP is an extension of the LRP that we discussed in Hamidi et al. (2012b).In this LRP, two specific constraints are taken into account: 1) plants have limited production capacity, and 2) central depots have limited capacity for storing and transshipping products.In this paper, a heuristic algorithm is developed to solve large problems.The main components of this heuristic are a GRASP that has been developed for this particular problem and two intensification and diversification strategies that are developed to efficiently search the solution space.Results indicate that the heuristic solves the LRP effectively in terms of computational time and solution quality.

Fig. 1 .
Fig. 1.Distribution network(Hamidi et al., 2011(Hamidi et al., , 2012a) ) Path Swap: For transshipment paths of each product, for every open facility (facility A) select an open facility (B) and an open facility (C) with the following conditions: C sends the product to B, and B sends the product to A.

Fig. 10 .
Fig. 10.Result of Run 1 Fig. 11.Result of Run 2 The average CPU time of the heuristic developed by Duhamel et al. (2010) to for solve large-size twolayer LRPs, instances with 200 customers, are 965 seconds for Prodhon's instances with 10 depots and 1,255 seconds for Tuzun's instances.In addition, the average CPU time of the heuristic presented by Yu et al. (2010) to solve two-layer LRPs, instances with 200 customers and 10 depots, is 1,485 seconds.We used an Intel(R) Core(TM) i5 CPU (3.19GHz) machine with 3.17 GB of RAM to solve the problem.The computational time of the heuristic that we presented in this paper for the four-layer LRP with 3 plants, 20 CDs, 30 RDs, and 380 customers is 165 seconds, which is a very reasonable amount of time.Note that the presented four-layer LRP is a much larger and more complex problem than a two-layer LRP.