You are on page 1of 10

An Ant Colony System Algorithm to Solve

Routing Problems Applied to the Delivery of


Bottled Products

Laura Cruz Reyes, José F. Delgado Orta, Juan J. González Barbosa,


José Torres Jimenez, Héctor J. Fraire Huacuja, and Bárbara A. Arrañaga Cruz

Instituto Tecnológico de Ciudad Madero, México


lauracruzreyes@yahoo.com,
{francisco.delgado.orta,jjgonzalezbarbosa}@gmail.com, jtj@cinvestav.mx,
hfraire@prodigy.net.mx, aralia38@hotmail.com

Abstract. This work presents a methodology of solution for the well-


known vehicle routing problem (VRP) based on an ant colony system
heuristic algorithm (ACS), which is applied to optimize the delivery
process of RoSLoP (Routing-Scheduling-Loading Problem) identified in
the company case of study. A first version of this algorithm models six
variants of VRP and its solution satisfies the 100% of demands of the
customers. The new version of the algorithm can solve 11 variants of
VRP as a rich VRP. Experiments were carried out with real instances.
The new algorithm shows a saving of two vehicles with regard to the first
version, reducing the operation costs of the company. These results prove
the viability of using heuristic methods and optimization techniques to
develop new software applications.

Keywords: Optimization, Routing-Scheduling-Loading Problem


(RoSLoP), Vehicle Routing Problem (VRP), Ant Colony System (ACS).

1 Introduction
The distribution and delivery processes are inherent to many companies produ-
cers of goods, in other cases; it is the main function of several services lenders
companies. This could be intrascendent, however, the merchandises delivery on
appropriate time with the minimum quantity of resources, reduces the operation
costs, bringing savings between 5 to 20 % in total costs of products [1].
The Routing-Scheduling and Loading Problem immersed on the distribution
and the activity of delivery of products is a combinatorial problem of high com-
plexity, as result of the different variables that are included in it and the in-
terdependence between them. Due to, the most of planning and logistic groups
are focused on finding only a feasible solution, leaving out the process of opti-
mization and the possibility of evaluating certain alternatives, with the multiple
benefits of this way of solving problems.

This research was supported by CONACYT and DGEST.

A. An et al. (Eds.): ISMIS 2008, LNAI 4994, pp. 329–338, 2008.



c Springer-Verlag Berlin Heidelberg 2008
330 L. Cruz Reyes et al.

This work focuses mainly in solving routing problems applied to the distribu-
tion of bottled products in a company located in north eastern Mexico. These
problems were initially solved in [2] with a basic ant colony system algorithm,
which includes a method of solution of up to six variants of VRP: CVRP, VRPM,
HVRP, VRPTW, VRPSD, sdVRP, which are described in section 2. Due to the
complexity of the processes of the company, it was necessary to develop an-
other implementation of this algorithm to solve simultaneously 11 variants of
the pro-blem like a rich VRP variant in its method of solution.
The next sections describe the vehicle routing problem and its variants.
Section 3 defines RoSLoP, section 4 presents the methodology of the solution,
section 5 shows the experimentation with real instances, and sections 6 and 7
present the analysis of the results and the conclusions respectively.

2 Vehicle Routing Problem (VRP)

VRP is a classic problem of combinatorial optimization, which, consists in one


or various depots, a fleet of m available vehicles and a set of n customers to be
visited, which are joined through a graph G(V ,E), where:
V ={v0 ,v1 ,v2 ,...,vn } is the set of vertex vi , such that V -{v0 } represents the
customers and v0 the depot. Each customer has a demand qi to be satisfied by
the depot.
E={(vi ,vj ) | vi ,vj  V } is the set of edges. Each edge has an associated value
cij that represents the transportation cost from vi to vj .
The task to solve is to get a set R of routes with a total minimum cost that
starts and finalizes in the depot, where each vertex V -{v0 } is visited only once
and the length of each route must be less or equal to L. The main objective is to
obtain a configuration with the minimum quantity of vehicles satisfying all the
demands of the customers and visiting each facility in their established schedule.

2.1 Variants of VRP and Related Works

The most known variants of VRP add several constraints to the basic VRP
such as capacity of the vehicles (CVRP) [3], independent service schedules in
the facilities of the customers (VRPTW-VRPMTW) [4], multiple depots to sat-
isfy the demands (MDVRP) [5], customers to be satisfied by different vehicles
(SDVRP) [6], a set of available vehicles to satisfy the orders (sdVRP) [7], cus-
tomers that can ask and return goods to the depot (VRPPD) [8], dynamic
facilities (DVRP) [9], linehaul and backhaul orders (VRPB) [10], demands and
stochastic schedules (SVRP) [8], multiple use of the vehicles (VRPM) [11], a
heterogeneous fleet to delivery the orders (HVRP) [12], orders to be satisfied in
several days (PVRP) [5], constrained capacities of the customers to dock and
charge the vehicles (CCVRP) [2], thresholds of transit over the roads (rdVRP)
[13] and depots that can ask for goods to another depots (DDVRP) [2].
Recent works have approached real situations of transportation with a com-
plexity of until five simultaneous variants of VRP in real applications [14][15].
An Ant Colony System Algorithm to Solve Routing Problems 331

They are called rich VRP variants; and commercial applications have been deve-
loped that involve eight variants of VRP [16]. However, until now, it has not been
created an efficient method of solution that approaches a considerable number of
variants. Due to VRP is known by its NP-hard complexity, and its constraints
are related with real-life situations, we have designed a methodology to build
solutions for the assignment of routes, schedules and loads, which is detailed in
section 4.

3 Scheduling-Routing-Loading Problem (RoSLoP)


RoSLoP, immersed in the logistic activity of the company case of study, involves
a sub-set of three tasks. The mathematical model of RoSLoP was formulated
with two classical problems: routing and scheduling through VRP and the loa-
ding through the Bin Packing Problem (BPP). Figure 1 shows RoSLoP and its
relation with VRP-BPP. The case of study contains the next elements:
– A set of ORDERS to be satisfied for the facilities of the customers, which
are formed by boxes of products with different attributes.
– A set of n customers with independent service schedules and a finite capacity
of attention of the vehicles.
– A set of depots with independent schedules of service and possibilities to
request goods to other depots.
– A fleet of vehicles with heterogeneous capacity to transport goods, with a
service time and a time for attention in the facilities of the customers. The
attention time depends of the capacity of the vehicle and the available people
to dock and charge the vehicles.
– A set of roads or edges that connect the depots with the facilities of the
customers. Each road has an assigned cost Cij , each one with a threshold of
supported weight for the vehicles that travel through the roads.

Fig. 1. RoSLoP subproblems


332 L. Cruz Reyes et al.

The objective is to get a configuration that allows to satisfy the set of ORDERS
in the set of facilities of the customers, minimizing the number of vehicles used
and the distance of travel. This scheme of solution includes a modeling of 11 va-
riants of VRP: CVRP, VRPTW, VRPMTW, MDVRP, SDVRP, sdVRP, VRPM,
HVRP, CCVRP, DDVRP, rdVRP. They are described in section 2.1.

4 Methodology of Solution
To build feasible solutions to RoSLoP, there was created a methodology of solu-
tion based on an ant colony system algorithm (ACS), which is shown in figure 2.
The assignment of routes and scheduling is solved by a basic ACS and three more
components that extend the skills of this algorithm: an autoadaptative constrai-
ned list and initial and local search strategies. The DiPro algorithm, which as-
signs the loads, contains three main modules (construction module, assignment
module and balancing module) and an optative module (filling module).

Fig. 2. RoSLoP subproblems

The construction module creates the units of load used by the algorithm; the
assignment module is invoked during the process of construction of a route, each
time that a customer is visited, this module determines the distribution of the
load into the vehicle assigned to the customer. When the search ends and the
best solution is found, this solution is improved through the balancing module
and the filling module. They are executed out of line, using efficiently the time
of compute, and solving up to five variants of BPP; a detailed review of DiPro is
approached in [13]. Next section details the ACS that solves the transportation
problem related with the solution of the associated variant rich VRP.

4.1 The Basic Ant Colony System (ACS)


Ant Colony System (ACS) is a method inspired by the behavior of the ants to find
the shortest path toward their anthill. This algorithm uses two main features:
An Ant Colony System Algorithm to Solve Routing Problems 333

the heuristic information ηrs , which measures the predilection to travel through
the road between two nodes vr and vs ; and the trail information of artificial
pheromone τrs (or visibility function) that computes the learned reference to
travel around the road between vr and vs . Ants build the solution sailing through
the adjacent states of the problem.
The election of the nodes in each iteration is done through a pseudo-random
rule, and on-line updates executed over the information of the artificial pheromone
generated by the ants. The pseudo-random selection rule is defined as follows:
given an ant k located in the node vr , q0  [0, 1] a balancing parameter between
constructive focuses and q a random value in [0, 1], the next node s is chosen ran-
domly with the probability distribution of the expressions 1 and 2
If q  q0 then
β
s = argmax{τrs ηrs } sNk (r) (1)

Else


⎪ τrs η β
⎨  rs β sNk (r)
pxrs = τrs ηrs (2)


⎩ sNk (r)
0 Otherwise

Where β is the relative importance of the heuristic information and Nk (r) the
set of available nodes. The rule has a double intention: q  q0 then exploits
the available knowledge, choosing the best choice with regard to the heuristic
information and the trails of artificial pheromone. Otherwise, a controlled explo-
ration is applied. Local update of the pheromone is done over the ant that has
obtained the best solution; the trails of artificial pheromone are evaporated in
all the edges used for the best ant, adding a certain evaporation rate ρ  [0, 1]
and finally adding a determined value by the effectiveness of the found solution.
Local update of artificial pheromone is shown in expression 3.

τ ← (1 − ρ)τrs + ρΔτrs (3)

Another process of on-line update is done to build different solutions for the ones
already obtained. Every time that one ant travels from vr to vs , expression 4 is
applied
τ ← (1 − ρ)τrs + ρΔτ0 (4)

The global update Δτr s is computed like the inverse of the length of the shortest
global solution generated by the ants; the trail of pheromone τ0 used in the local
update, is the inverse of the product of the length of the shortest global solution
generated and the number of visited nodes, establishing a dependence with the
size of the instance. The global update, combined with the pseudo-random rule,
guides toward a more direct search. In each iteration of the algorithm, ants
examine in the neighborhood of the best found solution. While the local update
changes dynamically the desirable use of the roads.
334 L. Cruz Reyes et al.

4.2 Compute of the Heuristic Information


The heuristic information is used by the ACS to choose the next node to visit.
The expression 5 defines the compute of the heuristic information used in the
election of the customers.
ηrs = (Δtrs ∗ (wss + sts ) ∗ tcrs )−1 (5)
The factor is the difference between the current time and the arrival time to node
s, wss represents the remaining size of the time window in s, sts is the time of
service in s and tcrs is the travel cost from node r to node s, solving the variants
VRPTW, VRPMTW and CCVRP. This calculation gives preference to those
customers where: a) the needed time to arrive to the facilities starting from the
actual position is the smallest, b) the time of attention since the current time
plus the time of service is the smallest, and c) the traveling time is minimum.
Due to the existence of the variant HVRP it is necessary to choose the next
more appropriate vehicle to be used. Expression 6 defines the computation of
the heuristic information implied into the selection of the vehicles; this expression
satisfies the variants CVRP, VRPM, sdVRP and rdVRP.
 −1
trv
ηv = nvv ∗ (T Mv + T Rv ) ∗ ∗ idprefv (6)
ttv
Where ηv is the value of the heuristic information for the mobile unit v, nvv
is a bound of the quantity of travels required for the vehicle v to satisfy all
the demands of Nk (r), T Mv is the average of the service time in Nk (r), T Rv
is the time trip average of the vehicle to Nk (r), trv is the available time for
the vehicle v, ttv is the time of attention for the vehicle v; trv /ttv is a factor
time of use/availability; and idprefv is the grade of predilection of use of the
vehicle v. Expression 6 implies an inclination for those vehicles whose times of
trip, times of service, remaining period of service and preference level are the
smallest, making it possible to develop the variant SDVRP.

4.3 Autoadaptative Constrained List (ACL)


In agreement with [17], in constructive processes it is very advantageous that
ants use a Constrained List of Candidates. ACL is elaborated through feasibility
conditions and the distribution of the customers in the graph. The goal of ACL
is to limit the global population into subsets that fulfill certain conditions, and
its use allows to solve the variant DDVRP. The ACL is created following the
next five steps.

Step 1. A Minimum Spanning Tree (MST) is generated including all the cus-
tomers and the depot of the instance.

Step 2. The mean μ and standard deviation σ are obtained, the minimum and
maximum costs associated to the roads included in the MST.

Step 3. The percentage of visibility of the associated costs to each road belong-
ing to the MST is computed through the expression 7.
An Ant Colony System Algorithm to Solve Routing Problems 335

 −1
σ
θ= (r, s)M ST (7)
2(argmax(tcrs ) − argmin(tcrs ))

If θ < 0.1, the percentage of variability around the mean oscillates in 10%,
that is because the location of the customers in the instance follows an uniform
distribution. Therefore, it is possible the existence of regions in the space with
more density as for the population of customers.

Step 4. The definition of the regions is carried out through the next grouping
rule: if θ > 0.1, then it continues with the formation of conglomerates through a
hierarchical grouping, otherwise, all the customers form a single conglomerate.
The threshold of acceptance ω is calculated through the expression 8. This point
characterizes the autoadaptative attribute of the method.

ω = 2 ∗ argmax (tcrs ) (r, s)M ST (8)

Step 5. Once defined the ownership of each customer to a conglomerate, the


value of the heuristic information is modified with the rule of ownership, only
for the customers cr and cs , which belong to different groups hi and hj .
If hi = hj | cr  hi ∧ cs  hj then

|H|
ηrs = ηrs ∗ cr , cs C, hi , hj H (9)
|C|

Expression 9 allows inhibiting in proportional form to the preference of a


customer with regard to others, with base in the ownership to the different
conglomerates and the number of these. Each iteration obtains the ACL for
each depot, satisfying the variant MDVRP, this solution is optimized through
the initial and local search procedures.

4.4 Initial Search

Because the exploitative focus is extremely similar to a greedy search, the pos-
sibility to use it like an initial search results in solutions of good quality over
other methods with simple guideline, as the heuristic of the nearest neighbor.
The expression 10 defines the preference guide in the initial search of the solution
method.
η = (Δtrs ∗ (wss + sts ))−1 (10)

4.5 Local Search

For the incorporation of the Local Search to the ACS, schemes of exchange of
axes were chosen: 3-opt [18] and Cross-Exchange [19], operating respectively on
two routes, both include implicitly other simple operators, the first one contains
by nature at the 2-opt [20], and the second, allows the use of empty segments
using movements type 2-opt * [21], Relocation, and Exchange [22], making it
extremely versatile.
336 L. Cruz Reyes et al.

5 Experimentation
Real instances were provided by the bottling company, which were tested us-
ing the two versions of the algorithm, the first version developed in [2], named
Heuristics-Based Transportation System (HBST) and the new algorithm named
the Heuristics-Based System for Assignment of Routes, Schedules and Loads
(HBS-ARSL), both were developed assisting the needs of the company in two
different instants of time. Both algorithms were coded in C#. A set of 12 ins-
tances of test were selected from the database of the company, which contains
312 instances classified by the date of the orders; the database contains also 1257
orders and 356 products in its catalogues. Both algorithms used a configuration
of 10 ants, 5 colonies, 40 generations with the parameters of the ACS: q0 = 0.9;
β = 1; ρ = 0.1, and they were executed during two minutes. There were disposed
eight available vehicles in a graph with ten edges. Results are shown in table 1.

Table 1. Solution of real instances of RoSLoP, provided by the bottled company

Instance n ORDERS HSBT HBS-ARSL


Satisfied Used Satisfied Used
demand(%) vehicles demand(%) vehicles
06/12/2005 4 6928 100 6 97.66 4
09/12/2005 5 7600 100 7 100 5
12/12/2005 7 11541 100 8 99.06 5
01/01/2006 6 9634 100 6 97.71 4
03/01/2006 4 5454 100 4 100 3
07/02/2006 6 12842 100 8 99.21 5
13/02/2006 5 9403 100 7 99.52 5
06/03/2006 6 9687 100 5 97.63 3
09/03/2006 6 12319 100 8 98.65 6
18/03/2006 7 11662 100 7 96.59 4
22/04/2006 8 16903 100 8 98.28 5
17/05/2006 6 11410 100 7 97.00 5
Average 6 10873.53 100 6.75 98.45 4.5

6 Analysis of Results
Table 1 shows that the algorithm HBS-ARSL obtains a saving of two vehicles in
average with regard to HBST. This saving is achieved with the addition of the
solution of the Autoadaptative Constrained List defined in section 6.3; however,
it is observed in the column of satisfied demand that it does not solve 100% of
the demands, reaching 98.45 percent due to the use of restrictions of the pro-
blem BPP, which are carried by the solution of five simultaneous variants of the
problem BPP to solve the Loading Problem. As an alternative solution it was
created the filling module included in DiPro, which covers the available space
in the vehicles with product of more rotation, because it is not feasible for the
company to send a vehicle with less than 50% of their capacity.
An Ant Colony System Algorithm to Solve Routing Problems 337

This demonstrates the complexity of the problem in real situations, and how
the addition of restrictions in the formulation of the problem reduces the quality
of the solutions in terms of satisfaction of the demand, in contrast with the saving
obtained by the algorithm with regard to the number of used vehicles, achieved
with the use of the Autoadaptative Constrained List, which allows the company
to minimize the costs of vehicle operation related to gasoline and maintenance.

7 Conclusions and Future Work

This work showed the solution of a real problem using an Ant Colony System
algorithm, which builds feasible solutions of good quality in a reasonable period
of time. This shows the viability of the development of commercial applications
based on heuristic methods, that applied to the planning and logistics, will allow
companies the distribution and delivery of their products by obtaining signifi-
cant savings for concept of transportation of them. Another future contribution
can be the application of different neighborhood techniques and the addition of
explorative focus to the Autoadaptative Constrained List.

References

1. Toth, P., Vigo, D. (eds.): The vehicle routing problem, SIAM Monographs on
Discrete Mathematics and Applications. Philadelphia: Society for Industrial and
Applied Mathematics (2001)
2. Cruz, L., et al.: A Distributed Metaheuristic for Solving a Real-World Scheduling-
Routing-Loading Problem. In: Stojmenovic, I., Thulasiram, R.K., Yang, L.T., Jia,
W., Guo, M., de Mello, R.F. (eds.) ISPA 2007. LNCS, vol. 4742, pp. 68–77.
Springer, Heidelberg (2007)
3. Shaw, P.: Using Constraint Programming and Local Search Methods to Solve Ve-
hicle Routing Problems. In: Maher, M.J., Puget, J.-F. (eds.) CP 1998. LNCS,
vol. 1520, pp. 417–431. Springer, Heidelberg (1998)
4. Jong, C., Kant, G., Vliet, A.V.: On Finding Minimal Route Duration in the Vehicle
Routing Problem with Multiple Time Windows, tech. report, Dept. of Computer
Science, Utrecht Univ. (1996)
5. Mingozzi, A.: An exact Algorithm for Period and Multi-Depot Vehicle Rout-
ing Problems. Department of Mathematics, University of Bologna, Bologna, Italy
(2003)
6. Archetti, C., Mansini, R., Speranza, M.G.: The Vehicle Routing Problem with
capacity 2 and 3, General Distances and Multiple Customer Visits. Operational
Research in Land and Resources Manangement, p. 102 (2001)
7. Thangiah, S.: A Site Dependent Vehicle Routing Problem with Complex Road Con-
straints. Artificial Intelligence and Robotics Laboratory, Slippery Rock University,
U.S.A (2003)
8. Dorronsoro, B.: The VRP Web. AUREN. Language and Computation Sciences of
the University of Mlaga (2005), http://neo.lcc.uma.es/radi-aeb/WebVRP
9. Leonora, B.: Notes on Dynamic Vehicle Routing. Technical Report IDSIA-05-01.
IDSIA - Istituto Dalle Molle di Studi sull’Intelligenza Artificiale, Switzerland (2000)
338 L. Cruz Reyes et al.

10. Blescha, J., Goetshalckx, M.: The Vehicle Routing Problem with Backhauls: Prop-
erties and Solution Algorithms. Techincal report MHRC-TR-88-13, Georgia Insti-
tute of Technology (1993)
11. Fleischmann, B.: The Vehicle routing problem with multiple use of vehicles. Work-
ing paper, Fachbereigh Wirtschaftswissenschaften, Universitt Hamburg (1990)
12. Taillard, E.: A Heuristic Column Generation Method For the Heterogeneous Fleet
VRP. Istituto Dalle Moli di Studi sull Inteligenza Artificiale, Switzerland. CRI-96-
03 (1996)
13. Cruz, R., et al.: DiPro: An Algorithm for the Packing in Product Transporta-
tion Problems with Multiple Loading and Routing Variants. In: Gelbukh, A.,
Kuri Morales, Á.F. (eds.) MICAI 2007. LNCS (LNAI), vol. 4827, pp. 1078–1088.
Springer, Heidelberg (2007)
14. Pisinger, D., Ropke, S.: A General Heuristic for Vehicle Routing Problems, tech.
report, Dept. of Computer Science, Univ. Copenhagen (2005)
15. Reimann, M., Doerner, K., Hartl, R.: Analyzing a Unified Ant System for the VRP
and some of Its Variants. In: Raidl, G.R., Cagnoni, S., Cardalda, J.J.R., Corne,
D.W., Gottlieb, J., Guillot, A., Hart, E., Johnson, C.G., Marchiori, E., Meyer,
J.-A., Middendorf, M. (eds.) EvoIASP 2003, EvoWorkshops 2003, EvoSTIM 2003,
EvoROB/EvoRobot 2003, EvoCOP 2003, EvoBIO 2003, and EvoMUSART 2003.
LNCS, vol. 2611, pp. 300–310. Springer, Heidelberg (2003)
16. OR/MS Today: Vehicle Routing Software Survey. United States. Institute for Op-
erations Research and the Management Sciences (2006)
17. Dorigo, L., Gambardella, M.: Ant Colony System: A Cooperative Learning A-
pproach to the Traveling Salesman Problem. In: Proc. IEEE Transactions on Evo-
lutionary Computation, Belgica, vol. 1(1) (1997)
18. Bock, F.: An algorithm for solving traveling salesman and related network opti-
mization problems. In: Fourteenth National Meeting of the Operational Research
Society of America, St. Louis, MO, USA (1958)
19. Taillard, E., Badeau, P., Gendreu, M., Guertin, F., Potvin, J.Y.: A Tabu Search
Heuristic for the Vehicle Routing Problem with Soft Time Windows. Transporta-
tion Science 31, 170–186 (1997)
20. Croes, G.: A method for solving traveling salesman problems. Proc. Operations
Research 5, 791–812 (1958)
21. Potvin, J., Rousseau, J.M.: An Exchange Heuristic for Routing Problems with
Time Windows. Proc. Journal of the Operational Research Society 46, 1433–1446
(1995)
22. Prosser, P., Shaw, P.: Study of Greedy Search with Multiple Improvement Heuris-
tics for Vehicle Routing Problems, tech. report, University of Strathclyde, Glasgow,
Scotland (1996)

You might also like