You are on page 1of 11


Thassyo G. Pereiraa,b and Yvelyne I. Santosb


Laboratory of Logistics, Centre of Thechnology and Natural Sciences, Par State University, Tv. Dr. Enas Pinheiro, 2626, Marco, 66095-015, Belm, PA, Brazil,

Department of Industrial Engineering, Centre of Thechnology and Natural Sciences, Par State University, Tv. Dr. Enas Pinheiro, 2626, Marco, 66095-015, Belm, PA, Brazil,

Keywords: Vehicle Routing Problem, Simulated Annealing, Store's Window Cleaning. Abstract. The cleaning operations of store's windows is an important support activity to the commercial sector. In the city of Belm of Par, many stores chose to outsource this activity, mainly to the company studied in this paper. In the malls, the scenario in which the window cleaning operations are performed can be seen as the Vehicle Routing Problem: the cleaning staff are the vehicles, the time window given by the mall administration to the operations is the capacity, and the window's perimeter are the demands to be covered. In this paper, we collect the actual routes of the cleaning staff in one of the three malls in which the company is present, and apply the Simulated Annealing metaheuristic to reduce the distance traveled by the cleaning staff and improve the workload balance among them. The results of the algorithm reduced in 35% the average traveled distance and improved in 93,84% the workload balance.


Service business is a central economic activity for any post-industrial society, the development of this sector is a natural process to reach such a phase (Fitzsimmons and Fitzsimmons, 2004). In the last few decades, service-related activities suffered an remarkable increase, if compared to other economic sectors (Normann, 2002), gaining the attention of operations management researchers since the 1970's (Corra, 2003). In Brazil, 60% of all income generation is related to the service and commerce sector (Corra, 2003). Specifically in the State of Par, where our study takes place, an increase occurred in the number of cities with service-based economics, summing 125 in 2007, against 9 cities agribusiness-based and 9 with industrial economic base (Par, 2007). As the capital, Belm holds most of the service activities of the State (Par, 2007), with approximately 71% of its 2007's Gross Domestic Product (GNP) derived from the service and commerce sector (Brazil, 2007). The strong presence of the commercial activity is shown by the great amount of clothing and accessories stores, many of which are concentrated in the three Malls of the city and in streets devoted almost exclusively to commercial activities. An important support activity to the city's commercial sector is the cleaning of the stores' windows, because the windows are an important mean of marketing, publicity (propaganda and discount adhesives are placed on they), display (they allow the costumers to quickly browse the products that are inside the store), and as a measurement of the general level of the apparency and cleanness of the store, causing impact on the service level expected by the costumer, giving that they are responsible, in most cases, for the first impression that the costumer gets of the store. Thanks to the dynamic routine of the stores, the window cleaning operations have to meet a given time window, what makes it similar to the Vehicle Routing Problem (VRP), in which the cleaning workers staff are the vehicles, the time window is their capacity, the stores are the costumers, and the windows' perimeters are the demands to be covered. It must be pointed, though, one distinguish characteristic of the window cleaning routing: the human factor, in a way that the simple minimization of the total traveled distance is not enough, being also necessary to level the workload distribution among the cleaning workers, since they hold the same job level and are paid equally. Our study applies the Simulated Annealing metaheuristic (SA) with problem-oriented modifications to perform the routing of the window cleaning operations of one company present in Belm city. The paper is organized as follows. The VRP formulation is described in Section 2. The mechanism of SA is described in Section 3. Section 4 presents the actual state of the cleaning operations along with the input data used in Section 5, which presents the conditions and computational results of the developed algorithm. Finally, Section 6 concludes the paper with reflections on the obtained results and suggestions for future works. 2 THE VEHICLE ROUTING PROBLEM

The VRP was first introduced by Dantzig and Ramster (1959) and consists in determining the optimal set of routes for one fleet of vehicles to serve a given number of costumers with known locations and demands. Thanks to the large number of possible applications, an equally large number of objectives and constraints may arise (Christofides, Mingozzi, and Toth, 1979). Common constraints are: the vehicle's capacity, time windows, limits on the driver's working time, limits on the distance traveled by the vehicles, multiple depots, heterogeneous fleet, possibility of both pick-up and delivery in the same route, etc. According to Garey and Johnson (1979), the VRP (a generalization of the Traveling Salesman Problem, TSP) is NP-Complete, being hardly solved to optimality, causing many

researchers to develop heuristics approaches to the problem, creating an extensive literature on the topic. A broad review on these approaches can be found at Toth and Vigo (2002). Mathematically, the classical VRP is defined as a complete weighted graph G = (V, A, d), where the set of nodes is represented by V = {v0, v1, v2, v3, , vn} and A = {(vi, vj) : i j} is the set of arcs. The central depot, where all the vehicles start their routes, is represented as v0 and the other nodes in V are the costumers. The distance between the costumers vi and vj is the non-negative weight dij, associated with the arc (vi, vj). The costumer vi is associated with the non-negative values qi e i that represent, respectively, the demand and the service time (q0 = 0, 0 = 0) that must be covered by a vehicle with capacity C, driving a distance not superior to L (including service times). 3 SIMULATED ANNEALING METAHEURISTIC

The SA metaheuristic was originally proposed by Kirkpatrick, Gelatt, and Vecchi (1983) based on techniques from the Statistical Mechanics. SA uses the procedure of Metropolis et al. (1953), which simulates a set of atoms in equilibrium in a certain temperature, using the Monte Carlo method for multidimensional numerical integration. Using the objective function to represent the system's energy and a set of parameters to represent the configurations, Kirkpatrick, Gelatt, and Vecchi (1983) demonstrated that it is possible to apply the procedure of Metropolis et al. (1953) to generate a population of different configurations to a given optimization problem in a effective temperature, which is a simple a control parameter with the same measurement unit as the objective function. The SA proposed by Kirkpatrick, Gelatt, and Vecchi (1983) consists in, first, melt the system to be optimized in a high enough temperature, and then slowly low the temperature, phase by phase, until the moment at which the system freezes (when no more changes occur). In every temperature, the simulation must happen until the system reaches a stable state. The sequence of temperatures and the number of tested rearrangements to reach the equilibrium can be considered as a process of annealing. They recognized the need of three ingredients for the algorithm: a good problem description; a generator or rearrangements in the system; a quantitative objective function, representing the compensations that must be made; a cooling schedule for the temperature and a time span in which the system must evolve. 3.1 Detailing and pseudocode of the algorithm The algorithm reads the control parameters related to initial temperature (T0), cooling rate () and number of iterations (n), and generates some initial solution s0 (process described in Section 3.2). Then, starts its loops: (1) External while loop, controlled by the temperature, evolves until the temperature reaches zero; (2) Internal while loop, controlled by the number of iterations. One internal loop is performed at each iteration of the external loop. At each iteration of the internal loop, the generator or rearrangements defines one neighbor (sv) (procedure demonstrated in Section 3.3) of the current solution (s). If the evaluation function f(sv) of the neighbor is better than f(s), sv is accepted as the current solution. If it is also better than the best solution (s*), sv is accepted as the system's solution. If it is not better than s, it might be accepted as the current solution s with e-E/T probability (for minimization of f and eE/T for maximization of f), where e is the Euler's number, E = f(sv) f(s) represents the variation in the evaluation function's value given by the neighbor, and T is a control parameter in the same unit as f, called temperature and that decays at each iteration of the external loop at a rate of , non-dimensional parameter called cooling rate. The external loop runs until the freezing, phase in which T reachs zero (a very small user defined number). The best result of the evaluation function f found during the algorithm's progress (s*) is taken as the system's heuristic solution. The pseudocode for the algorithm is shown at Fig. 1.

Figure 1: SA's pseudocode

3.2 Initial solution generation For the generation of the initial solution (generate_greedy_solution()), the nearest neighbor based heuristic (NNBH) proposed by Tavakkoli-Moghaddam, Safaei, and Gholipour (2006) will be used. It is a constructive process that initiates the route r of one vehicle at a random point, moving to the nearest neighbors until that there are no more points left in the list of remaining points (Vremaining) or its capacity Cused is reached, when the route of one new vehicle is started in a new random point, repeating the process. The algorithm terminates returning the set of constructed routes (s0), its pseudocode is shown at Fig. 2.

Figure 2: NNBH's pseudocode

3.3 Mechanism for neighbor generation Osman (1993), pioneer in the application of SA to solve VRP, created two generator mechanisms based on the -opt of Lin (1965), to which he called -interchange. Taking = 1, the two possible moves to be performed in two different routes are: 1) A shift process: one point is shifted from one route to another. 2) An interchange process: one point from one route is exchanged with one point of another route. The procedure generate_neighbor(s) chooses randomly between 1) and 2), performs the operation in s and returns sv. 4 CASE STUDY

The studied company has been on the market for more than 10 years, performing cleaning services of commercial windows, floors and fronts, as well as sales representation of cleaning supplies in the city of Belm, Par State. The window cleaning staff is composed of 6 employees, divided among the three malls of the city, commercial streets, and companies with independent establishments. There are about 260 window cleaning contracts, being this activity the company's main source of revenue. The cleaning staff is divided as 3, 2, and 1 workers in the so called Mall A, Mall B, and Mall C, respectively. After the cleaning of the Malls A and B, the workers are drove to the stores of the near commercial streets. 4.1 Clients The Malls can be seen as condos of stores, to obtain space in one of them it is necessary to buy a property, to pay a fee similar to a condo fee, and to obey the rules of the Mall Management. Among those rules, there are the establishment of common promotion periods, common opening period, and the mandatory maintenance of a good general appearance, mainly a clean window, what makes many store owners outsource this service. To fail to obey any rules means the payment of fines. The stores of commercial streets have a similar institutional environment, existing stores owners associations acting in a similar way as the malls administrations. 4.2 Window cleaning environment The malls open from 10:00 to 22:00 hours, the mall management establishes the time between 6:00 and 9:45 hours for activities like stock replenishment, organization and cleaning. This time is also used by the management for the maintenance of the mall's common spaces. The commercial streets are open at the same period, but the stores owners associations does not establishes specific periods for the stores' support activities, which usually occur during the opened period. It can be seen that, in the cleaning operations of the malls, the studied company has a time window of 3:45 hours, and that the violation is subjected to fines, what does not occur with the stores outside the malls. The company establishes that the working journey of the employees must start at 06:30, with a 15-minute tolerance. It is important to point that the window cleaning contracts stipulates not only a daily external cleaning, but also a monthly internal cleaning. The latter takes longer, given the need to move the dummies and other items leaned in the window, what makes the cleaning staff finish all the external cleanings first, and then move to the internal cleanings. It will be considered that the external cleanings must finish at 08:45. The time window between 06:45 and 08:45 is 2 hours, or 7,200 seconds.

4.3 Current state of the cleaning operations and input data There is no prior defined route for the external cleaning, causing the workers to waste a lot of time moving from one store to another instead of actually cleaning. To measure the potential productivity of the cleaners, a time and motion study was performed with them, obtaining a standard time of 39.28 seconds per meter of window perimeter and a 1 m/s walking speed was considered. These numbers allow us to express the worker's capacity in means of time, which, for malls, will be considered as 7,200 seconds, as discussed in Section 4.2. Table 1 presents the localization of the Mall A's stores ( Fl means floor, Ug stands for underground floor, and X and Y are the cartesian coordinates, in meters) and its perimeters (P, in meters), 0 means the entrance/exit, considered as the depot. The distance between two stores will be considered as the euclidean distance multiplied by a circuit factor of k = 1.2, common in the literature. In the case of change of floors, it will be used the stairs that offer the shortest distance (Table 2), considering 6 meters per floor as the traveled distance in the stair. It must be pointed the special case of the stores 8 to 10, that represent only one store that has been divided into 3 because the workers currently do so and are not willing to change that, given the size of the store.
Table 1: Data of the stores of the Mall A

Fl Ug Ug Ug Ug Ug Ug Ug 1st 1st 1st 1st 1st 1st 1st 1st 1st 1st 1st 1st 1st 1st 1st 1st 1st 1st 1st

Store 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

X 52.62 44.78 46.94 49.62 49.42 60.76 75.01 85.68 86.75 86.75 86.75 90.81 88.62 83.02 75.12 64.56 57.65 60.91 64.10 66.80 75.00 103.06 106.20 117.31 122.54 128.27

Y 97.87 109.03 101.46 96.26 93.32 84.05 88.03 11.44 17.37 17.37 17.37 45.34 50.95 55.17 53.19 60.74 77.45 74.36 71.38 66.00 63.56 58.13 55.86 58.42 58.61 58.81

P 0 7.00 8.23 3.23 2.91 5.81 5.10 2.76 5.00 5.00 5.00 2.74 9.84 4.17 5.89 9.11 8.41 4.13 4.36 10.51 6.00 3.41 3.83 5.89 4.28 4.50

Fl 1st 1st 1st 1st 1st 2nd 2nd 2nd 2nd 2nd 2nd 2nd 2nd 2nd 2nd 2nd 2nd 2nd 2nd 2nd 2nd 2nd 2nd 2nd 2nd 2nd

Store 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55

X 115.86 111.86 106.77 95.60 94.23 90.01 81.93 79.11 76.23 64.74 57.44 65.27 68.12 88.79 96.85 99.97 108.89 127.43 125.71 121.27 118.26 115.28 105.98 92.75 91.93 108.24

Y 47.90 48.77 49.86 37.28 29.76 39.10 51.72 51.69 51.71 59.99 74.26 67.87 63.82 42.65 62.93 62.72 56.96 57.05 46.28 46.28 46.28 46.28 46.29 27.11 23.31 51.67

P 2.89 6.80 3.01 2.60 5.89 7.16 3.29 2.68 2.89 9.89 3.50 4.19 6.41 4.39 2.88 3.53 2.99 4.40 5.89 2.90 2.87 2.93 3.13 2.88 6.08 7.00

Fl Store X Y P 3rd 60 87.65 49.55 9.13 3rd 61 80.95 51.95 5.97 3rd 62 69.85 52.55 4.15 3rd 63 63.79 59.71 8.13 3rd 64 57.64 66.08 8.31 3rd 65 68.16 63.35 5.99 3rd 66 74.54 63.18 5.93 3rd 67 94.05 63.32 2.96 3rd 68 105.01 58.41 5.08 3rd 69 109.73 57.52 4.24 3rd 70 113.73 57.52 3.38 3rd 71 117.43 57.52 4.03 3rd 72 121.94 57.52 4.32 3rd 73 128.65 57.52 5.89 3rd 74 137.78 57.52 4.10 3rd 75 141.23 57.52 2.63 3rd 76 140.80 46.24 6.13 3rd 77 134.83 46.24 5.89 3rd 78 127.37 46.24 2.89 3rd 79 124.41 46.24 2.89 3rd 80 121.35 46.24 2.89 3rd 81 118.36 46.24 2.89 3rd 82 109.34 46.24 2.83 3rd 83 103.17 46.24 2.70 3rd 84 97.04 44.57 10.6 3rd 85 94.06 33.27 2.89

1st 1st 1st 1st

26 27 28 29 Axis X Y

127.89 124.91 121.89 119.07

48.26 48.17 48.08 48.00 Stair 1 58.71 85.91

2.89 2.88 2.89 2.85

3rd 3rd 3rd 3rd

56 57 58 59

87.82 88.94 89.72 90.23

28.94 34.29 37.79 41.76

7.11 2.92 4.41 2.82

3rd 3rd 3rd 3rd

86 87

92.76 27.33 2.89 111.59 51.68 1.99

Table 2: Data of the stairs of the Mall A

Stair 2 72.13 57.84

Stair 3 98.42 18.04

Stair 4 114.97 53.12

Stair 5 125.76 66.99

The previous methodology was used to obtain the current state of the operations by collecting 3 routes of the workers during 3 randomly chosen days. Table 3 and the Figs 3 and 4 present that data. It must be pointed that the route is not prior defined, so the worker might travel different routes daily, although it is believe that the operation's general state is well represented by this sample.
Table 3: Current routes

Worker 1 2 3 Mean

Route Ocupation (s) 0, 64, 65, 66, 67, 69, 70, 71, 72, 73, 76, 77, 5,062 78, 79, 80, 81, 82, 83, 84, 85, 86, 8, 7, 34, 33, 11, 32, 14, 0 0, 62, 68, 74, 75, 47, 46, 55, 45, 44, 43, 53, 5,640 54, 42, 41, 6, 5, 4, 3, 2, 1, 9, 31, 30, 28, 27, 26, 25, 24, 0 0, 16, 17, 18, 19, 15, 20, 13, 12, 10, 21, 22, 7,166 29, 23, 48, 49, 50, 51, 52, 35, 36, 37, 38, 39, 40, 63, 61, 60, 59, 58, 57, 56, 87, 0 5,956

Traveling 8.11% 12.86% 8.40% 9.73%

Cleaning 91.89% 87.14% 91.60% 90.27%

Figure 3: Cleaning staff's current occupation

Figure 4: Cleaning staff's current routes

Taking a closer look to the data, we can see that an average of 9.73% of the staff's time is spent in the walking activity, and that there is an unbalance in the workload, with an 29.36% difference between the most loaded worker and the least loaded. It can be seen, then, the need to improve the workload balance among the workers, making it more even, and reduce the time wasted with walking, given that it does not aggregates value and generates wastes for the company. Being so, the developed routing algorithm must be capable of solve these two problems. 5 OPTIMIZATION

First of all, it is necessary to state the following: s = {r1, r2, r3, r4, , rn}: solution for the problem, given by the n ri routes Ts: standard time for the complete cleaning of 1 meter of window perimeter, given in seconds per meter. Vel: worker's walking velocity, in m/s. k: circuit factor. space(ri): total euclidean distance walked in a given route ri, in meters. perimeter(ri): sum of the perimeters of all stores in ri, in meters. ocup(s): total time spent in s for the cleaning of all stores, given by Eq. 1.
ocup (s)=Ts perimeter (r i )+

k space (r i ) Vel i


ocup(s): mean time spent in all routes of s. MD(s): mean deviation of the spent time in all routes of s, given by Eq. 2.
MD (s)= 1 k ocup(s)TP perimeter (r i )+ Vel space (r i ) n i


The fact that the number of stores and its perimeters remain constant during the algorithm's run, allow us to see state that, given two solutions s and s', we have the relation of Eq. 3.

perimeter (r i )= perimeter (r ' i)

i i


In such a way that the difference among s and s' is given only by the total distance walked, so, in the moment to choose one VRP evaluation function to implement in the SA, we can pick Eq. 1 in a full or its second part for the minimization of the total amount of work performed. Although it is better to pick the whole of the equation, because, for each worker, the capacity is expressed in means of total time, and is subjected to the constrain of the Eq. 4.
Ts perimeter (r i )+ k space (r i)C i Vel


Using only Eq. 1, though, does not consider the workload balance among the workers. To solve this problem, we added to the objective function the measure of dispersion MD(s), which will be multiplied by an parameter b < 1, aiming to control its impact in the quality of the solutions. The evaluation function used in our work, then, is shown in Eq. 5.

f ( s)=ocup (s)+b MD (s)


During the SA's generation of neighbors, nothing constraints the algorithm to reach unfeasible regions of the solution space, in which the constrain at Eq. 4 is violated. A very common solution for this problem is the penalization of these violations, making the unfeasible solutions not likely to be choose over the iterations. However, the evaluation function in Eq. 5 makes the penalization unnecessary because, naturally, capacity violations will generate an increase in the mean deviation, followed by a reduction of the solution's quality, acting similarly to the penalization. 5.1 Computer results Table 4 presents the computer results of the algorithm. We used T = 0.1, = 0.95, zero = 10-30 e b = 0.2, and varied the iterations number as shown, performing 10 runs at each level. The algorithm was codified in Python language and executed in the Ipython IDE. The Operational System was the 9.10 version of the Linux distribution Ubuntu. The hardware was an Intel CoreTM2 Duo CPU E7300 processor with a 2.66 GHz clock, and 2 GB RAM.
Table 4: Overview of the computer results

Iteration 1 10 100 1,000

f mean 17,622.28 17,421.77 17,373.66 17,365.45

f best 17,485.42 17,303.48 17,286.79 17,227.14

f worse 17,745.90 17,552.18 17,501.63 17,542.86

Mean spent time (s) 0.57 5.62 56.36 553.79

As it can be seen, the computer time increases linearly with the number of iterations, without an equivalent decrease in the evaluation function value. What makes a large iterations number unwise. The new routes to be implemented by the company are the better solution found, with a 17,227.14 seconds evaluation function, detailed in Table 5 and Figures 5, and 6.
Table 5: Optimized routes

Worker 1 2 3

Route Ocupation (s) 0, 64, 63, 65, 61, 60, 83, 84, 59, 58, 85, 86, 5,724 56, 57, 62, 38, 37, 36, 43, 35, 53, 54, 7, 8, 9, 10, 34, 33, 11, 0 0, 1, 2, 3, 4, 5, 16, 17, 18, 20, 13, 12, 32, 31, 5,800 30, 29, 28, 27, 26, 25, 24, 23, 47, 48, 49, 50, 51, 52, 55, 22, 21, 0 0, 19, 15, 14, 66, 67, 68, 69, 70, 71, 72, 73, 5,695

Traveling 6.42% 5.64% 6.91%

Cleaning 93.58% 94.36% 93.09%


74, 75, 76, 77, 78, 79, 80, 81, 82, 87, 46, 45, 44, 42, 39, 41, 40, 6, 0 -




Figure 5: Cleaning staff's optimized occupation

Figure 6: Cleaning staff's optimized routes

Table 5 shows that the algorithm managed to reduce the mean time wasted in walk from 9.73% to 6.32%, a 35% improvement, approximately, and increased the time devoted to cleaning from 90.27% to 93.68%. It reduced the mean workers' occupation in almost 4%, from 5,956 seconds to 5,740. The workload balanced improved notably, as can be seen in Fig. 5, with a 93.84% improvement in the difference between the most loaded worker and the least loaded, going from 29.36% to 1.81%. 6 CONCLUSIONS

The current state of the operations shows that, in average, 9.73% of the cleaning staff's time is wasted in walking activities, with a big unbalance (29.36%) among the greater and the lesser loaded workers. Our application of Simulated Annealing manage to reduce the walked distance in 35%, reducing the overall worked time in 4%, and the greater/lesser workload unbalance in 93.84%, which reached a 1.81% level. The results lead us to believe that the algorithm was successful.

Suggestions for future works are the utilization of other heuristics methods to solve this VRP variation (in which may not be cleaver to use constructive heuristics, given that they have an unbalancing method), and to improve the evaluation function we developed, using a technique to control the unbalancement other than the parameter b, because it becomes another user-defined parameter and increases the complexity of the design of the computer tests. REFERENCES Brazil. Ministry of Planning, Budget and Management. Brazilian Institute of Geography and Statistics. Produto Interno Bruto dos Municpios 2007. URL: <>; [accessed 05.11.2010]. Christofides, N., Mingozzi, A., Toth, P. The vehicle routing problem. In: Christofides, N. et al. (eds). Combinatorial optimization. Wiley, 1979. Corra, H. Teoria geral da administrao: abordagem histrica da gesto de produo e operaes. Atlas, 2003. Dantzig, G., Ramster, J. The truck dispatching problem. Management Science, 6:80-91, 1959. Fitzsimmons, J., and Fitzsimmons, M. Service Management: operations, strategy, and information technology. McGraw Hill, 2004. Garey, M., Johnson, D. Computers and Intractability: A Guide to the Theory of NPCompleteness. Bell Telephone Laboratories: 1979. Kirkpatrick, S., Gelatt, C., Vecchi, M. Optimization by Simulated Annealing, Science, 220:671-680, 1983. Lin, S. Computer solutions for the traveling salesman problem, The Bell System Technical Journal, 44:2245-2269, 1965. Metropolis, N. et al. Equation of State Calculations by Fast Computing Machines, The Journal of Chemical Physics, 21:1087-1092, 1953. Normann, R. Service Management: strategy and leadership in service business. John Wiley and Sons, 2002. Osman, I. Metastrategy simulated annealing and tabu search algorithms for the vehicle routing problem, Annals of Operations Research, 41:421-451, 1993. Par. Planing State Agency. PIB: Municpios Paraenses 2007. URL: <>; 2007 [accessed 06.11.2010]. Tavakkoli-Moghaddam, R., Safaei, N., Gholipour, Y. A hybrid simulated annealing for capacitated vehicle routing problems with the independent route length, Applied Mathematics and Computation, 176:445-454, 2006. Toth, P.; Vigo, D. (eds). The vehicle routing problem. CIAM, 2002.