{'fraction_non_alphanumeric': 0.030238738638140118, 'fraction_numerical': 0.017821649507559684, 'mean_word_length': 4.507071700897798, 'pattern_counts': {'":': 0, '<': 2, '<?xml version=': 0, '>': 2, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Iterated local search for workforce scheduling and routing problems

The integration of scheduling workers to perform tasks with the traditional vehicle routing problem gives rise to the workforce scheduling and routing problems (WSRP). In the WSRP, a number of service technicians with different skills, and tasks at different locations with pre-defined time windows and skill requirements are given. It is required to find an assignment and ordering of technicians to tasks, where each task is performed within its time window by a technician with the required skill, for which the total cost of the routing is minimized. This paper describes an iterated local search (ILS) algorithm for the WSRP. The performance of the proposed algorithm is evaluated on benchmark instances against an off-the-shelf optimizer and an existing adaptive large neighbourhood search algorithm. The proposed ILS algorithm is also applied to solve the skill vehicle routing problem, which can be viewed as a special case of the WSRP. The computational results indicate that the proposed algorithm can produce high-quality solutions in short computation times.


Introduction
The workforce scheduling and routing problem (WSRP) and its variants are commonly faced by many service providers, and have applications of home health care, field technician scheduling, security personnel routing and manpower allocation.
The term WSRP is coined by Castillo-Salazar et al. (2012), and refers to a class of optimization problems where service personnel are required to carry out tasks at different locations. For example, nurses visiting patients at their homes, and technicians performing maintenance jobs in different companies can each be modeled as a WSRP. As service personnel need to travel between different locations, minimizing their distances and times for travel is usually considered as one of the objectives when making operational decisions. This results in a routing problem of finding a set of least cost routes for a given workforce, where each route consists of a sequence of locations. Sometimes, tasks have associated time windows, within which service must start. This type of problem can be modeled as an extension of the vehicle routing problem with time windows (VRPTW), which is a well-known variant of the classical vehicle routing problem (VRP).
Service personnel often specialize in different skill domains, and possess skills at different levels. The tasks themselves have different skill requirements. For example, in the telecommunications industry, tasks may include maintenance, installation, construction and repair jobs, and technicians are trained in skills that allow them to only be able to service a subset of these tasks. Thus, skill compatibility must be taken into account to ensure that tasks are performed only by qualified personnel. The associated scheduling problem involves the assignment of tasks to service personnel. In some applications, tasks can be outsourced to a third party, albeit at the expense of additional cost, if appropriate resources are not available to provide the required service, or better operational performance can be achieved. The version of the WSRP that we consider allows for outsourcing.
Due to its complexity, most of the existing research on the WSRP has aimed at developing efficient heuristic solution algorithms. However, most of them are sophisticated and highly problem specific. In this paper, a simple heuristic algorithm based on iterated local search (ILS) is proposed to solve the WSRP. ILS is one of the most conceptually simple and robust algorithms (Burke et al. 2010). The essential idea of ILS is that when the local search is trapped at a local optimum, the ILS perturbs the previously visited local optimum instead of generating a new initial solution, and then restarts the local search from this modified solution (Lourenço et al. 2003). Although the ILS has a very simple framework, it has been successfully applied to a wide variety of optimization problems including the graph coloring problem (Chiarandini and Stützle 2002), the job shop scheduling problem (Lourenço 1995) and the vehicle routing problem (Hashimoto et al. 2008;Chen et al. 2010;Walker et al. 2012;Penna et al. 2013;Michallet et al. 2014). However, no study has been reported on the application of the ILS to the WSRP, which is the aim of this paper. The contribution of the paper is a fast and simple algorithm for the WSRP with the objective of minimizing the total travel cost and outsourcing cost. The proposed algorithm is also applied to solve the skill vehicle routing problem (Skill VRP). To the best of our knowledge, this is also the first ILS approach for the Skill VRP.
The remainder of the paper is organized as follows. Section 2 reviews the related literature on the WSRP. A formal definition of the problem is presented in Sect. 3. Section 4 gives a description of the proposed ILS. Computational results for benchmark instances are presented in Sect. 5. The paper ends with some concluding remarks in Sect. 6.

Literature review
Recent studies on the WSRP include the work of Kovacs et al. (2012). They present an adaptive large neighbourhood search (ALNS) algorithm to solve the service technician routing and scheduling problem (STRSP). In this problem, tasks are associated with time windows and skill requirements, outsourcing tasks is allowed, and team building may be required in order to fulfill skill requirements of difficult tasks. The objective is to minimize the total operational cost comprising the routing and outsourcing cost. The scheduling aspect of this problem is adapted from the study of Cordeau et al. (2010), which considers a technician and task scheduling problem arising in a large telecommunications company. Cordeau et al. (2010) focus on the construction of teams and the assignment of tasks to teams without considering routing costs between tasks. Their problem is solved by using a construction heuristic and an ALNS algorithm. Pillac et al. (2013) extend the study of Kovacs et al. (2012) by taking tools and spare parts into account, where each task must be carried out by a technician with the required skills, tools, and spare parts, and within the prescribed time window. The problem is solved by a matheuristic consisting of a parallel version of ALNS algorithm and a mathematical programming based post-optimization procedure. Xu and Chiu (2001) also consider a field technician scheduling problem arising in the telecommunications industry. The objective is to maximize the number of jobs scheduled to technicians, while accounting for each job's priority and skill constraints. Three different heuristic approaches, namely, a greedy heuristic, a local search algorithm, and a greedy randomized adaptive search procedure (GRASP) are proposed to solve the problem. Castillo-Salazar et al. (2015) describe a greedy heuristic to address the WSRP with five types of time-dependent constraints, which model the relationship between tasks, e.g. one task needs to start after the completion of another task.
A variant of the WSRP is the skill vehicle routing problem (Skill VRP), which is introduced by Cappanera et al. (2011). The Skill VRP differs from other problems reviewed above in two aspects: (1) tasks do not have associated time windows, and (2) the routing costs depend both on the traveling distance and the technician in such a way that increasing the skill level of the technician causes an increase in costs. The use of technician-dependent routing costs is motivated by practical applications, since highskilled employees usually have higher salaries than those with only basic skills. The Skill VRP is also studied by Schwarze and Voß (2012), but their study incorporates load balancing and resource utilization when constructing tours for service vehicles. Their motivation for proposing this model is their finding that many Skill VRP solutions usually use only a subset of vehicles, and a considerable number of tasks are assigned to vehicles with technicians that have higher skills than necessary. Some studies have considered stochastic elements in the WSRP. For example, Weintraub et al. (1999) study a scheduling and routing problem for service vehicles belonging to an electric utility company in Chile, where service requests are stochastic. Pillac et al. (2012) also consider a technician routing and scheduling problem with stochastic service requests, which is solved by a parallel adaptive large neighbourhood search (pALNS) and a multiple plan approach. Binart et al. (2016) solve a field service routing problem with stochastic travel and service times using a two-stage stochastic programming model. Finally, Chen et al. (2015) describe a technician routing problem with experience-based service times, where technicians learn over time, which results in service times being reduced as experience increases.
Other problems closely related to the WSRP are the site-dependent vehicle routing problem with time windows Cordeau et al. 2004), the home health care scheduling problem (Blais et al. 2003;Bertels and Fahle 2006;Akjiratikarl et al. 2007) and the manpower allocation problem (Dohn et al. 2009).

Problem definition
In this section, we first provide a formal description of the WSRP that we address. We then formulate a mixed integer programming (MIP) model for our problem.
The WSRP is defined on a complete graph G = (V, A), where V = {0, 1, . . . , n + 1} is a set of vertices and A = {(i, j) : i, j ∈ V, i = j} is a set of arcs. The vertex 0 denotes the depot and vertex n + 1 is a copy of the depot, and C = V \{0, n + 1} represents the set of vertices that each have a unique task. Depending on the context, we refer to a task i or a vertex i for any i ∈ C. A set K of technicians are available to perform the tasks. Each technician is specialized in a number of skill domains at different proficiency levels. Each task i ∈ C has an associated service duration d i , a time window [e i , l i ] within which service should commence, and a skill requirement. The depot and its copy also have time windows, which define the earliest departure time e 0 and the latest return time l n+1 of any technician. Also, the route duration of each technician must not exceed a given time D. Each arc (i, j) ∈ A has an associated cost c i j and travel time t i j .
In the studies of Cordeau et al. (2010) and Kovacs et al. (2012), each technician's skills and each task's skill requirements are described by skill matrices, which are used to determine if a single technician or a team of technicians would be able to perform a given task. In this paper, we do not consider the possibility of building a team of technicians, and thus simply define a binary parameter q k i , where q k i = 1 if technician k ∈ K is qualified to perform task i ∈ C, and q k i = 0 otherwise. The values of q k i can be easily computed based on technicians' skills and tasks' skill requirements. Finally, any task i ∈ C can be outsourced by incurring a cost o i , in the event that resources are insufficient or too expensive to undertake all of the tasks.
The WSRP can be formulated as a mixed integer programming model that contains the following binary variables: and the continuous variable b k i , ∀i ∈ V, k ∈ K , that lies within the interval [e i , l i ] if technician k does not perform task i; otherwise, it is the time at which service of task i commences, or the leaving time and returning time of technician k from and to the depot when i = 0 and n + 1 respectively.
The mathematical model is presented as follows: subject to: k∈K j∈V The objective function (1) minimizes the total operational cost comprising routing and outsourcing cost. Constraints (2) ensure that each task is either visited exactly once or outsourced, while constraints (3) guarantee that the tasks can only be performed by technicians satisfying the skill requirements. Constraints (4) and (5) ensure that each technician departs from the depot and returns to the copy of the depot after completing their service. Constraints (6) are the typical flow conservation equations. Constraints (7) set the time variables b k i , while constraints (8) enforce the time window restrictions. Constraints (9) guarantee that the route duration for each technician is no more than the maximum time allowed. Constraints (10) and (11) represent the binary restrictions on variables x k i j and y i , and (12) are the non-negativity constraints on the variables b k i .

Iterated local search
This section describes our proposed iterated local search (ILS) algorithm for solving the WSRP. The ILS consists of three main components: initial solution construction, local search procedure and perturbation mechanism. They are combined into a multistart framework as given in Algorithm 1. At each iteration of the main loop between lines 3 to 18, an initial feasible solution s is constructed for the ILS loop (lines 6 to 14). At each ILS iteration, the local search procedure takes as input the solution s, and returns an improved solution s , which is accepted as the new best current solution if it is feasible and has a value f (s ) that is strictly smaller than that of the incumbent solutions, denoted by f (s). Then a new starting solution s for the local search procedure is generated by perturbing on the incumbent solutions (line 12

Search space
A number of studies have shown that an efficient exploration of infeasible solutions can contribute significantly to the performance of a heuristic (Cordeau et al. 1997;Glover and Hao 2011;Vidal et al. 2012Vidal et al. , 2013. We follow the same line of thought here and allow the ILS to search infeasible, as well as feasible solutions, where the constraint violations in the former relate to the route duration and time window constraints. However, the skill requirement constraint is always respected, since it is concerned with the scheduling aspect of the WSRP and its relaxation would enlarge the search space dramatically. A solution s is therefore evaluated by an augmented cost function, which is defined by where c(s) is the total operational cost as defined in (1), and d(s) and w(s) are the total violations of duration and time window constraints, which are weighted by parameters α and β, respectively. The time window violation is measured based on a method proposed by Nagata et al. (2010). If there is a late arrival to a customer i ∈ C at time a i > l i , then it is assumed that there is a penalty for the delay a i − l i , and that service starts at time l i . In case of an early arrival at time a i < e i , then the technician has to wait until time e i , but the waiting time is not penalized. The same method is used by Vidal et al. (2013), who refer to the penalty as 'time warp'. Figure 1 illustrates the waiting time and time warp of a route with visits involving five vertices v 1 , . . . , v 5 . The horizontal axis corresponds to time, while the vertical axis presents the sequence of visits. The dots on each line show the start time of each visit, and the brackets on each line indicate the time window of the corresponding task. As seen in Fig. 1, there are no penalties associated with tasks v 1 , v 3 , and v 5 as the visits are made within the respective time windows. The bold line displays a possible schedule having a waiting time period at vertex v 2 and a time warp at vertex v 4 .

Move evaluation
Most local search heuristics spend the largest part of the overall computational effort on move evaluation (Vidal et al. 2015). Efficient move evaluation techniques are there-fore crucial for improving algorithm performance, particularly when the search space involves infeasible solutions.
The operational cost c(s) consists of the outsourcing cost and the total traveling distance which can be computed in amortized O(1) time (Kindervater and Savelsbergh 1997). However, it takes O(n) to compute the penalties d(s) and w(s) in (13). Nagata et al. (2010) propose an evaluation technique to compute the violation of time window constraints in amortized O(1) time for most traditional neighbourhood operators including 2-opt, inter-route swaps, and inter-route inserts. Vidal et al. (2013) extend this technique to allow the evaluation of both duration and time windows violations not only for inter-route but also for intra-route operators. A preprocessing phase is required to develop relevant data for their evaluation techniques, and the data must be updated once the route under consideration has been modified. Our ILS incorporates the technique proposed by Vidal et al. (2013) to compute the violation penalties for infeasible solutions.

Initial solution construction
Our procedure for constructing a feasible solution includes the following steps. The existence of a feasible solution is guaranteed due to the possibility of outsourcing. First, a task list L 1 is created as follows. The first task in the list is selected at random. The remaining entries in the list are constructed by sorting the remaining tasks of C in non-decreasing order of the angle they make with a line drawn from the depot to the randomly selected first task on L 1 . Then, a technician list L 2 is constructed by sorting the technicians of K in non-increasing order of the number of tasks they are qualified to perform. We then randomly select a task i ∈ C from the list L 1 and insert it into the cheapest feasible position of the route of the first technician on list L 2 . If the insertion violates feasibility, we insert i into the following technician's route. In the case where no feasible route can be constructed that incorporates task i, we set i to be outsourced. The procedure repeats by inserting tasks sequentially into technicians' routes following the above steps, yielding a feasible solution that consists of technicians' routes and a list of outsourced tasks.

Local search procedure
Our local search procedure consists of an inter-route search operator, an intra-route search operator, and an update mechanism of the weight parameters α and β using in (13).
The inter-route search uses a single neighbourhood structure called Swap and Relocate that removes two paths, each containing at most two tasks from two different routes, and then exchanges them. One of these paths may contain zero tasks, which results in the path from the other route being relocated. Figure 2 gives an example of this operator which removes two successive vertices v 2 and v 3 from route r 1 and one vertex v 6 from route r 2 , and then exchanges them. This neighbourhood structure is extended to allow an outsourced task to be swapped or relocated into the route of one of the technicians. When considering new routes created by this operator, the skill The intra-route search consists of three neighbourhood structures, namely, opt1, opt2 and 2-opt (Croes 1958), that operate on a single route. Operator opt1 removes one task and inserts it into another position on the same route, while operator opt2 is similar but removes and inserts two adjacent customers on a route. Operator 2-opt reverses the order of a sequence of successive visits on a route. Figure 3 provides an example of the 2-opt operator which removes a path consisting of four vertices {v 2 , v 3 , v 4 , v 5 } from route r , reverses the order of visits on this path, and then inserts the path back into the same position to form a new route r . The cost of r is evaluated by the method described in Sect. 4.2.
The inter-route search and the intra-route search can be combined in different ways within the local search procedure. To test the effect of the search strategy on the performance of the algorithm, we investigate the three following strategies: 1. Execute only the inter-route search operator; 2. Execute both the inter-route and intra-route search operators at each iteration of the local search procedure; 3. Apply the intra-route search as a post-optimization procedure on the locally optimal solution returned by the inter-route search.
After each iteration of the local search, the weight parameters α and β are adjusted according to the duration violation d(s) and the time window violation w(s) of the incumbent solution s as follows. If d(s) = 0, then the parameter α is divided by a factor 1 + δ; otherwise, it is multiplied by 1 + δ, where δ > 0 is a parameter that controls the strength of adjustment. The same rule applies to the parameter β with respect to w(s). The initial values of α and β are both set to 1, as suggested by a number of studies that have similar cost functions and weight parameters (Cordeau et al. , 1997Ibaraki et al. 2008;Nagata et al. 2010).
The structure of the local search procedure is illustrated in Algorithm 2. The current best solution s is set to the incumbent solution s. Then s is taken as input by the SearchStrategy function, which applies inter-route or intra-route search depending on the search strategy selected and returns an improved solutionŝ if such a solution exists. If f (ŝ) < f (s ), thenŝ replaces s as the current best solution. Then, the duration violation d(ŝ) and time window violation w(ŝ) are computed, and parameters α and β are adjusted accordingly by the control mechanism described above. The pre-processed data for the routes that have been modified at the current iteration are updated. This procedure repeats until the local search becomes trapped at a locally optimal solution.

Perturbation mechanism
The perturbation mechanism uses a random cross exchange operator, which removes two paths from two randomly selected routes and exchanges them. Figure 4 gives an example of the perturbation operator which removes a path of four successive visits from route r 1 and a path of two successive visits from route r 2 = r 1 , and then exchanges them. Violations of duration and time window constraints are allowed, but the skill requirement constraint must be respected. The perturbation procedure is always carried out on the best solution found thus far, and applies the random cross exchange operator p times, where p is a positive integer denoting the perturbation strength. The perturbation strength p is a crucial parameter of the ILS. If p is too small, the local search may not be able to escape from a locally optimal solution. If p is too large, the ILS may behave similar to a random restart algorithm, making it difficult to discover better quality solutions (Lourenço et al. 2003). In order to determine the most appropriate value of p, we developed an adaptive mechanism, which adjusts p according to the number of consecutive iterations without improvement, denoting by It NI . Let γ be a trigger for the adjustment of p. More precisely, whenever It NI has increased by γ , the value of p will be increased by 1 until it reaches the upper boundp, wherep is used to prevent excessively large values of p to be chosen. For example, if γ = 10 andp = 5, then p starts from 1 and increases by 1 when It NI ∈ {10, 20, 30, 40}.

Reducing outsourcing cost
As the cost of outsourcing a task is usually higher than that of serving it by internal resources, reducing the outsourcing cost is considered as an objective within the algorithm. This is achieved by a simple mechanism embedded in the perturbation procedure of the proposed ILS. At the beginning of the perturbation procedure, we check the list of outsourced tasks. If it is not empty, we randomly select a task and insert it to the cheapest position of the current solution, and then proceed with the perturbation procedure; otherwise, we only apply the random cross exchange operator. The insertion of outsourced tasks and the perturbation procedure is likely to produce an infeasible solution, which will be improved by the local search procedure. Infeasible solutions are evaluated by a cost function defined in (13), and weight parameters α and β are dynamically adjusted based on the rule described in Sect. 4.4. If the local search procedure cannot repair the infeasibility during the first few iterations, the weight parameters will be adjusted to large values, such that the cost of scheduling a task to a technician becomes greater than the cost of outsourcing it. As a consequence, the local search tends to repair the infeasibility by simply outsourcing the relevant tasks. In order to avoid the overuse of the outsourcing option, we force the local search procedure to always select improved solutions with lower outsourcing costs, even if solutions with higher outsourcing costs but lower overall costs exist.

Computational results
This section presents results of our computational tests conducted to assess the performance of the proposed ILS. The ILS algorithm is coded in C++, and run on a personal computer with Intel Core i5-3570 3.40 GHz processor and 4 GB Memory (RAM). The MIP model is implemented on the same machine, and solved by the commercial solver CPLEX 12.6. Our ILS results are compared with existing solutions of an ALNS algorithm (Kovacs et al. 2012), where the reported ALNS results are based on the average of five runs of the algorithm. To maintain consistency and provide a fair comparison, we also perform five random runs of the ILS for each instance tested and report the obtained results.

Test instances
The experiments are conducted using the technician routing and scheduling problem (TSRP) instances introduced by Kovacs et al. (2012). These instances are adapted from the Solomon's benchmark instances (Solomon 1987) for the VRPTW and the test instances provided for the ROADEF 2007 challenge. They are available online at: http://prolog.univie.ac.at/research/STRSP/.
The set of instances of Kovacs et al. (2012) are generated using 12 instances of Solomon (1987), namely, R101, R103, R201, R203, C101, C103, C201, C203, RC101, RC103, RC201, RC203, where R, C and RC represent the random, clustered and a mix of random and clustered geographical setting, respectively. Instance sets with prefixes R1, C1 and RC1 have a short scheduling horizon, while those with prefixes R2, C2 and RC2 have a long scheduling horizon. The final two digits in the name of the instance indicate the time window density. In the 01 instances, all customers are associated with time windows, while in the 03 sets, only 50% of customers have time windows. In terms of the skill requirements, Kovacs et al. (2012) generate three types of skill requirement matrices shown by 5 × 4, 6 × 6, and 7 × 4 based on the ROADEF data, where the rows of the matrices correspond to skill domains, and the columns correspond to skill levels under each skill domain. The customer data of Solomon's instances are randomly paired with the skill data, which results in a total of 36 test instances. All instances have 100 customers and a single depot. For each instance, Kovacs et al. (2012) define a 'team' and a 'no team' version. As our study does not consider the possibility of team building, we only use the 'no team' version of instances in our experiments. For each instance, there are two sets of technician data: one has a sufficient number of technicians that feasibility can be achieved without outsourcing, while the other has limited technicians such that it is impossible to service all tasks without the use of the outsourcing option. The outsourcing cost of a task i is defined as o i = 200 + μ 1.5 i , where μ i measures the difficulty of task i, and is calculated as the sum of the skill requirement for i in the skill matrix. The outsourcing cost is always higher than the cost of assigning a task to a technician.

Parameter setting
The ILS requires five input parameters as follows: MaxIt; MaxIt NI ; δ, which is the factor used to adjust weight parameters of duration and time window violations;p, which is the upper bound that is used in the perturbation mechanism; and γ is the adjustment factor of the perturbation strength. The value of MaxIt NI is defined by Penna et al. (2013) as where |C| is the number of customers, |K | is the number of technicians, and λ is a weight parameter determining the influence of |K | on the value of MaxIt NI . Thus, instead of finding the most appropriate value for MaxIt NI , the value of λ is examined. Extensive parameter tuning suggests that a parameter setting shown in Table 1 performs well.

Performance measurement
The proposed ILS is evaluated against the MIP model and the ALNS (Kovacs et al. 2012) using benchmark instances. To compare the ILS and ALNS solutions, we compute the relative percentage difference defined as where v S (ALNS) and v S (ILS) represent values of the ALNS and ILS solutions respectively, and S = {−, * , +} denotes the minimum, mean, and maximum values over five random runs of the algorithm. For example, Imp − A/I represents the relative percentage difference between the values of the best solutions found by the ALNS and ILS over five random runs. A positive value of Imp S A/I indicates an improvement of the ILS over ALNS; otherwise, the cost of the ILS solution is greater or equal to that of the ALNS solution.
By replacing v S (ALNS) of the expression (15) with v S (CPLEX), we obtain the relative percentage difference between the values of the ILS solution and the optimal solution produced by CPLEX, denoted by Imp S C/I . There is no difference between v − (CPLEX), v * (CPLEX) and v + (CPLEX), as they all refer to the value of the optimal solution found by CPLEX.
In addition to the comparison of solution values, we compare the computational times required by our ILS and the ALNS. Kovacs et al. (2012) run their ALNS on a Pentium D computer with two 3.2 GHz CPUs and 4 GB memory (the algorithm only uses one CPU), which is different from our machine that is used to implement the ILS and MIP model. In order to provide a fair comparison of computational speed, we scale the reported CPU times according to the speed factors provided in the report of Dongarra (2014). The report does not cover the two computers considered in our experiments. Thus, we use a slower but similar computer (Pentium IV with 3.0 GHz) available in Dongarra (2014) instead of the computer used by Kovacs et al. (2012), and use a speed factor of 1573 Mflop/s (millions of floating-point operations per second). As there is no suitable substitute available in Dongarra (2014), we apply the same software used by Dongarra (2014) to record the speed factor of our computer, which yields 2462 Mflop/s. Based on the speed factors, the reported CPU times of the ALNS are adjusted by multiplying a factor of (1573/2462), when comparing with the ILS times.

Evaluation of search strategies
Results on comparing the three search strategies described in Sect. 4.4 are shown in Table 2. Columns headed Avg. show the average solution values produced by the ALNS and the ILS using three different strategies over five random runs. The corresponding relative percentage differences between the values of the ALNS solutions and ILS solutions are reported in columns titled Imp * A/I . Comparing Strategy 1 with Strategy 2 and Strategy 3, it can be seen that by applying the intra-route search, the solution quality improves significantly from −0.21% to 0.54% and 0.51%, with the average computational time increasing accordingly. The intra-route search is seen to be especially useful on the R2, C2 and RC2 types of instances, which are characterized by a long scheduling horizon and a low number of technicians, where each route contains a relatively high number of tasks. Comparing Strategy 2 with Strategy 3, the difference between the average Imp * A/I values is only 0.03%. However, the average computational time of Strategy 2 is about 13% higher than that of Strategy 3. Therefore, Strategy 3, which applies the intra-route search as a post-optimization procedure on the local optimum returned by the inter-route search, is recommended based on efficiency and effectiveness, and is used in the remainder of our tests.

Comparison of performance
This section presents the results of evaluating our ILS against the MIP model and the ALNS using benchmark instances containing 25, 50, and 100 tasks. In the tables presented hereafter, the first group of columns shows the instance identifier, the number of tasks |C|, and the maximum number of technicians |K |. Columns Opt. and Avg. show, for each instance, the optimal solution value found by CPLEX, and the average solution values found by the ALNS and ILS over five random runs. Columns Imp * C/I and Imp * A/I give the relative percentage differences between the values of the ILS solutions and the CPLEX solutions and the ALNS solutions, respectively. The average number of outsourced tasks, the average number of technicians used, and the average CPU time in seconds are reported in the columns headed |C o |, |K * |, and CPU, respectively. Emboldening in the ILS columns is used to highlight values that correspond to an improvement over the corresponding values of the ALNS. Table 3 gives experimental results on small instances containing 25 tasks. Compared to CPLEX, our ILS algorithm consistently finds optimal solutions in all five random runs for 19 out of 23 instances and produces an overall average gap of −0.18% over all instances. Moreover, the average number of outsourced tasks given by the ILS is exactly the same as that for CPLEX. Compared to ALNS, our ILS algorithm gives better solutions for four instances, in particular RC101_5 × 4 and RC101_6 × 6, for which the solutions found by the ILS improve the ALNS solutions by 9.32% and 12.56% respectively. The significant improvement on these two instances is achieved by the reduction in the number of outsourced tasks. To test the statistical significance between the performances of ALNS and ILS, we conduct the two-tailed Wilcoxon test on the paired samples between the average solution values obtained by ALNS and ILS. The test is performed at a 95% significance level, where a p value of less than 0.05 indicates the rejection of the null hypothesis, which says that there is no significant difference between the results of ALNS and ILS. The p value of the Wilcoxon test for instances containing 25 tasks is 0.24, which suggests that the performances of ALNS and ILS on this set of instances are similar. This can be explained by the fact that both ALNS and ILS can solve a large majority of small instances to optimality. Perhaps the most significant feature of ILS is the speed with which it produces good-quality solutions, and it is significantly faster than the ALNS. With an average CPU time of 0.11 s, it only requires 7% of the time used by the ALNS. Although our computer is faster, the effect of the computer speed is negligible compared to the improvement on CPU times. Table 4 presents results of the experiments on instances with 50 tasks. Of the 12 instances, our ILS algorithm discovers optimal solutions for seven and yields an overall average deviation of −0.14% in comparison to CPLEX. The average deviation of the ILS from the ALNS in terms of the solution values is 0.67%, and it finds better solutions for five instances. The p value of the Wilcoxon test for this set of instances is 0.06, which is very close to the margin of significance. This suggests that when the problem size increases to 50, our ILS tends to perform better than the ALNS. Using the computer speed factors, the average computation time of the ALNS is adjusted to 4.77 s, which is still considerably greater than the 1.89 s for ILS.
For instances with 100 tasks, a time limit of 7200 s is imposed on CPLEX. Tables 5 and 6 report computational results on instances with limited and unlimited technicians, respectively. The third to fifth columns of each table are associated to the results of the MIP model solved by CPLEX, where the columns Best and Gap present, for each instance, the value of the optimal or best solution found by CPLEX within the time limit, and the percentage gap of the LP bound with respect to the best solution value. In addition, we report the minimum and maximum solution values found by the ALNS and ILS over five random runs in columns titled Min. and Max., and the corresponding percentage differences between the values of ALNS and ILS solutions are presented in columns Imp − A/I and Imp + A/I respectively. Proven optimal solutions are underlined. Of the 36 instances with unlimited technicians, CPLEX is only able to find optimal solutions for 9, and for the 36 instances with limited technicians, the model finds optimal solutions for 5 instances within the required time limit. This indicates that instances with limited technicians tend to be more difficult to solve than those with unlimited technicians, as the former problem considers the additional set of decisions concerning the selection of tasks to be outsourced.
A comparison of ILS and ALNS on instances with 100 tasks and limited technicians is given in Table 5. Of the 36 instances, our ILS algorithm outperforms ALNS in 17. In particular, for instances R101_5 × 4, RC101_6 × 6 and RC101_7 × 4, the solutions found by the ILS are between 5% and 8% better in cost than those for ALNS. The significant improvement on these instances can be explained by the reduced use of the outsourcing option by the ILS. The average number of outsourced tasks of the ILS solutions is 9.76, which is about 3% less than the value of the ALNS solutions.
To determine the statistical significance between the numbers of outsourced tasks produced by the ILS and ALNS on this set of instances, we conduct a two-tailed Wilcoxon test and a p value of 0.004 is obtained. This confirms that our ILS uses significantly less outsourcing option than the ALNS, and also implies that the proposed mechanism of reducing outsourcing cost (described in Sect. 4.6) is effective. The average percentage difference between the ILS and ALNS solution values is 0.82%. Comparing the worst solutions found during five random runs, the ILS improves the ALNS solutions by 1.24%, which indicates that our ILS is more stable than the ALNS when performing multiple runs. The average computational time required by ALNS is 52.87 s, which is equivalent to 33.78 s after applying the conversion factor, and is 16.59% higher than that of ILS. Table 6 provides a comparison of ILS and ALNS on large instances with unlimited technicians. The average number of outsourced tasks is not reported in this table, as these instances have enough technicians to avoid outsourcing. The ILS algorithm outperforms ALNS in 30 out of 36 instances, and improves the best solutions for 24 instances. Of the 9 instances that are solved to optimality by CPLEX, our ILS algorithm finds optimal solutions for 5 of them. The average percentage difference between the ILS and ALNS solution values is 0.64%. Moreover, the ILS solutions tend to have smaller deviations within five random runs since the overall average values of Imp − A/I and Imp + A/I are both greater than 0. In terms of speed, ALNS requires an average solution time of 79.17 s, which is equivalent to 50.58 s under the adjustment of computer speeds, but is still 20% higher than the average CPU time required by ILS. Lastly, we conduct a two-tailed Wilcoxon test on the solution values of all large instances containing 100 tasks and a p value of 0.02 is obtained. This indicates that our ILS has a significantly better performance than the ALNS on the set of large instances since the p value is less than the chosen significance level 0.05.

Skill VRP instances
The proposed ILS algorithm is also applied to solve a set of Skill VRP instances, which are generated based on the benchmark instances of Solomon (1987) and the skill pattern introduced by Cappanera et al. (2011). As the Skill VRP does not involve time window and capacity constraints, we use only the geographical information of Solomon's instances to generate three types of geographical data for Skill VRP instances, namely, R, C and RC, which represent the random, clustered and a mixed of random and clustered geographical setting, respectively. Similar to Cappanera et al. (2011) and Schwarze and Voß (2012), we consider a skill set with three levels 1, 2 and 3, where skill 1 denotes the lowest level, and skill 3 the highest. Each task i ∈ C is associated with a skill requirement s i ∈ {1, 2, 3}, which must be fulfilled by a technician k ∈ K having a skill levelŝ k ≥ s i , whereŝ k ∈ {1, 2, 3}. The skill data is randomly generated according to the four patterns introduced by Cappanera et al. (2011), as given in the Table 7, where each row of values represent a pattern that indicates the distribution of skill requirements over tasks. For example, the first pattern {50, 10, 40} indicates that a task i has a skill requirement s i = 1 with probability 0.5, s i = 2 with probability 0.1 and s i = 3 with probability 0.4. For each combination of skill pattern and geographical data, we generated three random instances, which results in a total of 36 instances. All the instances have two sizes, where one has 20 tasks and the other has 30 tasks. Each instance has a set of three technicians K = {1, 2, 3}, where each technician k ∈ K is specialised at a different skill levelŝ k ∈ S; for example,ŝ 1 = 1,ŝ 2 = 2 andŝ 3 = 3.
In the Skill VRP, the routing costs depend on both the traveling distance and the technician, such that the increasing skill level of the technician causes increasing costs. Thus, for each arc (i, j) ∈ A and each technician k ∈ K , we follow the approach of where c i j is the traveling distance of arc (i, j) ∈ A, and θ is a weight parameter of the skill levelŝ k of the technician k ∈ K . Following the suggestion of Schwarze and Voß (2012), we set θ = 1 in our experiments.

Results for skill VRP instances
The above Skill VRP instances are solved by using our ILS, and the results are compared with the solutions obtained from a basic MIP model of Cappanera et al. (2011) that is solved by using CPLEX 12.6. A time limit of 7200 s is imposed on CPLEX, and for instances not solved to optimality, we report the best values of the solutions found within this time limit. Table 8 presents results of the experiments for instances with 20 tasks. Of the 36 instances tested, CPLEX finds optimal solutions for 27 and exceeds the time limit for 9 instances. The solutions produced by our ILS algorithm are exactly the same as the optimal or best solutions found by CPLEX for all instances. The average computational time of our ILS is 0.08 s, which is negligible compared to the time used by CPLEX. Table 9 shows results of the experiments on instances with 30 tasks. For this size of instances, CPLEX is only able to find optimal solutions for 10 out of 36 instances. Among these 10 instances, our ILS can produce optimal solutions for 9, with the exception being instance R_4_1 for which our ILS found slightly worse solutions that have an average gap of −0.66% to that of CPLEX. Of the remaining instances that are not solved to optimality by CPLEX, our ILS produces better solutions for 6 and equal cost solutions for 20 compared to the best solutions found by CPLEX within the time limit. The average percentage difference between the values of our ILS solutions and CPLEX solutions is 0.74%. The average computational time required by our ILS is 0.48 s, which is also negligible compared to the time used by CPLEX.

Conclusion
This paper presents an iterated local search (ILS) algorithm for solving the workforce scheduling and routing problem (WSRP). We have examined different combinations of neighbourhood structures, and results show that the strategy of applying the intra-route search as a post-optimization procedure for the inter-route search provides effective and efficient performance. The proposed ILS is evaluated against a mixed integer programming (MIP) model and an adaptive larger neighbourhood search (ALNS) algorithm (Kovacs et al. 2012) on benchmark instances with up to 100 tasks. Computational experiments indicate that the proposed algorithm can produce solutions that are within an average gap of 1% to the optimal values in at most 40 s on average for all instances tested here. Compared to other heuristic approaches (Kovacs et al. 2012;Castillo-Salazar et al. 2015) for the similar problems, the proposed ILS has a relatively simple structure and a small number of parameters. The proposed ILS algorithm is also applied to solve a set of Skill VRP instances, and results show that our algorithm is able to find optimal or near-optimal solutions in less than 0.5 s on average for all instances tested. Although the proposed algorithm is designed for solving the workforce scheduling and routing problem, it can be easily adapted to tackle other types of scheduling and routing problems.