# Knowledge and Behavior-Driven Fruit Fly Optimization Algorithm for Field Service Scheduling Problem with Customer Satisfaction

Authors: Bin Wu; Hui-Jun Jiang; Chao Wang; Min Dong
Journal: Complexity
 (2021)

---

## Abstract

The field service scheduling problem (FSSP) is the key problem in field services. Field service pays particular attention to customer experience, that is, customer satisfaction. Customer satisfaction described by customer behavior characteristics based on the prospect theory is considered as the primary optimization goal in this paper. The knowledge of the insertion feasibility on the solution is analysed based on the skill constraint and time window. According to the knowledge, an initialization method based on the nearest heuristic algorithm is constructed. Based on the prior knowledge of the FSSP and the endowment of the Fruit Fly Optimization Algorithm, two operators are defined according to the matrix encoding method. Based on these two operators, three search strategies are then proposed, and the smell-based search strategy and vision-based search strategy for the FOA are redesigned. To verify the performance of the algorithms, the proposed operators and strategies are tested and analysed in the well-known benchmark. Through comparison with the state-of-the-art algorithms, the results show that the proposed HFOA is an effective and efficient method to solve the FSSP with customer satisfaction.


---

## Body

## 1. Introduction

Field services usually refer to the series of service activities performed to meet customer needs at the customer's designated location. Field services are widely provided in various industries, such as the maintenance and protection of electric energy networks and mobile communication systems, after-sales installation and maintenance of home appliances, furniture repair, home care, and the maintenance, repair, and operation (MRO) services of manufacturing enterprises. For example, the MRO services of the Chinese industrial market are more than 500 billion dollars in 2016. With the development of big data, mobile Internet, and other information technologies, innovative business models continue to emerge, such as the online to offline (O2O) business model. Based on the rapidly growing and customized service needs of customers, the role of field service is becoming increasingly important. The efficiency and quality of field services are closely related to the rational allocation of workers and reasonable planning routes. If worker allocation or route planning is unreasonable, it often results in long travel time for workers, long waiting time for customers, staff skills not matching tasks, and other issues. As a result, worker satisfaction is reduced, which negatively affects worker attitude, service quality, and service efficiency, thereby reducing customer satisfaction and ultimately leading to corporate profit decline. Therefore, the field service scheduling problem (FSSP) is critical to field service.Field service as a form of service extremely emphasizes customer satisfaction. However, little has been done to investigate the customer satisfaction in the current study about FSSP. Almost all models emphasize the cost, such as the shortest travel time for workers, the most tasks to complete. In fact, customer satisfaction is the first. All the companies try their best to improve the customer satisfaction even if the cost increases. Thus, customer satisfaction as the first optimization goal is presented in our study.On the other hand, the algorithm for solving field service scheduling is not rich. Newer and advanced solution methods are highly desirable. Therefore, the Fruit Fly Optimization Algorithm (FOA) is proposed to solve the problem. The FOA is a novel global optimization method based on swarm intelligence, which is proposed by Wenchao Pan [1]. As a new global optimization method, FOA has the advantages of fast convergence, simple operation, and convenient application, and so on. Therefore, FOA has given rise to many researchers’ attention and has successfully been used in some areas in recent years, such as tuning of PID controller [2], neural network [3], machine scheduling [4], multidimensional knapsack problems [5], and joint replenishment problems [6]. However, the FOA has not been applied to FSSP in addition to our work [7].This paper contributes to this research area in three ways: firstly, the customer satisfaction is formulated into the FSSP model as an optimization goal, and it is described according to the behavioral features of the customers based on prospect theory; secondly, the knowledge of the insertion feasibility on the solution is analysed. And the improved nearest neighbour insertion algorithm for initialization based on the knowledge is presented. Thirdly, the FOA is presented for FSSP. The matrix-based representation and three matrix-based search strategies are designed according to the problem characteristics.The rest of the paper is organized as follows.Section 2 reviews the field service scheduling problem. Section 3 illustrates customer satisfaction based on the prospect theory. In Section 4, the mixed-integer programming model of FSSP is presented. After that, the hybrid FOA for FSSP is discussed in detail in Section 5. Thereafter, the simulation experiment and comparisons are provided in Section 6. Finally, the conclusions and future work are discussed in Section 7.


## 2. Literature Review

Lesaint et al. [8] firstly put forward the concept of field service scheduling. They developed a heuristic algorithm to schedule 20,000 engineers for British Telecom maintenance and repair. However, the details of the algorithm and the experimental results have not been published. Considering the types and priorities of tasks, worker skills, customer time windows, and other constraints, the model of FSSP was established and a greedy randomized adaptive search procedure (GRASP) was proposed for solving the problem by Xu and Chiu [9]. A construction heuristic and an adaptive large neighbourhood search algorithm for FSSP were presented by Cordeau et al. [10]. Akjiratikarl et al. [11] presented the shortest travel distance of workers as the optimization target and proposed the particle swarm optimization algorithm to optimize the solution. The time delay and overtime of workers were also considered in the optimization goal by Petrakis et al. [12], and the heuristic algorithm with insertion and neighbourhood was proposed to optimize the model.Goel and Meisel [13] investigated FSSP about the maintenance of electricity networks. To solve the problem, they combined the large neighbourhood search algorithm with the mathematical programming method. Xu et al. [14] investigated the nondominated sorting genetic algorithm-II (NSGA-II) to the cross-trained workers scheduling problem. The FSSP model considering both the constraint of worker’s skills and routing optimization was presented by Jiang and Wang [15]. The genetic algorithm based on the segment of the chromosome encoding method was investigated to solve the model. Kovacs et al. [16] solved the FSSP considering the team building by using adaptive large neighbourhood search.Damm et al. [17] proposed a customized biased random key genetic algorithm to solve the multiobjective FSSP. The main objectives include the sum of priority values associated with the tasks and the idle time of the employees. Cortés et al. [18] developed the branch-and-price algorithm to solve a real FSSP. Hashimoto et al. [19] studied the FSSP model for France Telecom, and the task priority and skill level were considered in the model. The improved GRASP was investigated to solve the model. A parallel adaptive large neighbourhood search with the postoptimization procedure based on the mathematical programming was proposed to solve FSSP by Pillac et al. [20]. Decerle et al. [21] studied the memetic algorithm for the home health care routing and scheduling problem with time window and synchronization constraints.A few papers also considered the multiperiod scheduling. Chen et al. [22] considered the service time affected by the technician's experience and learning rate. The rolling-horizon framework was built, and the variant of the record-to-record travel algorithm (RTR) was presented to solve the daily routes. Furthermore, Chen et al. [23] also considered the dynamic requests in daily decision making and proposed an approximate dynamic programming-based solution approach for the problem. Qin et al. [24] proposed several local search operators and integrated them into a tabu search framework to solve the multiperiod FSSP. Considering the team building, Zamorano and Stolletz [25] proposed a branch-and-price algorithm for the multiperiod FSSP.Additional papers consider the dynamic and stochastic service requests. Souyris et al. [26] focused on uncertainty associated with service times, and the branch-and-price method was investigated for the problem. The dynamic workforce scheduling problem about British Telecom (BT) was researched by Borenstein et al. [27]. The problem was decomposed into subproblems, and a rule-based system was proposed for the problem. In addition, Tang et al. [28] and Cao and Han [29] studied the field service scheduling problem based on the M/G/m queuing model by simulation.The foregoing short review shows that the FSSP has attracted increased attention. However, the study of the FSSP is still in its infancy. Since the important applications of the problem, closer to reality models and more advanced methods for solving the problem are highly desirable. To the best of our knowledge, it seems that no research considers the customer satisfaction in the optimization goal for FSSP. And FOA is also the first reported application of FSSP in our study.The FOA has been successfully applied to various areas in recent years. To name a few, a two-stage adaptive FOA was proposed by Wang et al. [6] to solve the unrelated parallel machine scheduling problem with additional resource constraints. Hu et al. [30] used the FOA to optimize the parameter for the generalized regression neural network. Meng and Pan [31] investigated an improved FOA with the harmony search algorithm for solving the multidimensional knapsack problem. Shen et al. [32] used the FOA to tune support vector machine (SVM) parameter, and it was applied to medical diagnosis. Zheng et al. [33] presented the improved FOA to solve the semiconductor final testing scheduling problem. To keep the diversity of the population and avoid the algorithm falling into local optimum, Niu et al. [34] and Li et al. [35] proposed the multipopulation concept. Niu et al. [34] divided the population into two subpopulations: one was responsible for the exploration and the other was responsible for the exploitation. Li et al. [35] proposed the four subpopulations in the whole algorithm, and each subpopulation evolved separately.A knowledge-guided multiobjective FOA was investigated for the multiskill resource-constrained project scheduling problem by Wang and Zheng [36]. To improve the local and global searching ability and avoid premature convergence, Han et al. [37] proposed the improvement of FOA with trend search and coevolution. Wu et al. [38] added adaptive strategies and multigroup mechanisms to the FOA. The strategies included the adaptive adjustment mechanism for the search direction, the iteration step, and the crossover and mutation mechanism. In addition, some FOAs with other intelligent optimization algorithms are proposed. Yuan et al. [39] used the chaotic sequence to enhance the global searching capability of FOA. Lei et al. [40] applied the FOA combining gene expression profiles for identifying the protein network structure. Peng et al. [41] used the FOA to the flow shop rescheduling problem. The FOA with the local search is used to improve the performance of a multistart variable neighbourhood descent algorithm. However, to the best of our knowledge, the FOA has not yet been applied to the FSSP.


## 3. Customer Satisfaction Description Based on the Prospect Theory

The FSSP can be described as follows: a fewn spatially distributed tasks must be served exactly once by one of m workers. Workers have different skills and different proficiency levels for every skill. They start their service from their home, visit locations to fulfill tasks, and return home. The assignment of a task to a worker is only possible if the worker has a certain skill required by the task. Each task has service time and time windows. Their services are forbidden outside the deadline. The optimization goals of the FSSP are usually to minimize the total travel time of the workers, the total service time, and so on. Unlike the previous studies, customer satisfaction is the primary goal of optimization in this paper. Therefore, how to describe the customer satisfaction is the key to solve the problem.Field service scheduling is like a vehicle routing problem [10]. However, the two problems differ in the following aspects. First, the objective in the vehicle routing problem is usually to minimize the number of vehicles required or the total distance traveled, whereas FTSP tries to maximize the number of jobs completed within a given time frame. Second, the vehicles in VRP have physical capacities while the technicians in FSSP have different skills as required by different jobs. The customer satisfaction is represented based on time windows in the traditional vehicle routing problem [42], as shown in Figure 1 (Ei,Li represents the time window that the customer can tolerate and U represents the customer satisfaction). From the customer satisfaction point of view, if the customer is serviced in the time window, the satisfaction is 100%; otherwise, the satisfaction is 0. The method has a large gap from reality. The other researchers [43, 44] described customer satisfaction as a triangular fuzzy number or trapezoidal fuzzy number based on the time window, as shown in Figures 2 and 3. But the psychological characteristics of customers are not considered in these methods. For example, when customers are waiting for service, they tend to be inner anxiety and dissatisfaction (i.e., loss sensitive) as the waiting time increases nonlinearly. The prospect theory is a kind of behavioral decision theory which has great influence on behavioral science. It is based on the bounded rationality of human beings and can describe the decision-making behavior of people more reliably, such as dependency, loss avoidance, and decrease of sensitivity. Prospect theory has obvious advantages in describing human psychological characteristics such as satisfaction. Therefore, the customer satisfaction is described based on the prospect theory in this paper.Figure 1
Time window description.Figure 2
Triangular fuzzy number description.Figure 3
Trapezoidal fuzzy number.In the prospect theory, the individual needs to select a reference point in the initial stage of the decision, and the value of the reference point is zero. The individual evaluation is carried out relative to the reference point. In the decision-making stage, according to the value function of the income and loss of subjective evaluation (as shown in Figure4), the specific form is as follows:(1)gx=xa,x>0,−γ−xβ,x<0,where α and ß are the risk attitude coefficients, usually between (0,1); the larger the value, the more inclined to risk. γ is the loss of aversion coefficient, greater than 1 that is more sensitive to the loss of income characteristics [45].Figure 4
The value function in the prospect theory.In the field service scheduling, the customer satisfaction is mainly affected by the arrival time of workers. When the workers’ arrival time is later than the customer's psychological expectations, it will cause the customer's dissatisfaction; as the delay time increases, the dissatisfaction will increase. Because the impact of customer satisfaction is the gap between the customer's psychological expectations of arrival time and the actual situation, the greater the gap, the higher the customer dissatisfaction, rather than the arrival time itself. For the customer, the worker’s arrival delay is a loss, this loss will cause changes in customer psychological perception. Therefore, the customer dissatisfaction can be described by the prospect theory. Customer dissatisfaction with worker arrival time is shown in Figure5, where Ri represents the arrival time reference point for customer i, ai represents the actual time to start the service, and Ti is the customer’s maximum tolerance start time. The customer’s dissatisfaction function is expressed as (2).Figure 5
Dissatisfaction function for customeri.(2)Uai=1,ai>Ti,γaiRi−1β,Ri<ai≤Ti,0,0≤ai≤Ri.i=1,2,…,n.Ti=Ri1+γ−1β−1 is the maximum allowable start time corresponding to the loss value.


## 4. Model Formulation

The model assumes that all the information is known in advance in the static environment. Suppose a multigraphG=V,E, where the vertex set is divided into two disjoint subsets V=D,C. Set D=0,1,2,…,m−1 represents the locations of the engineers’ homes. Set C=0,1,2,…,n−1 represents the tasks’ locations. E=i,j,i,j∈V is the arc set and cij=cji is the travel time from i to j. Ri,Ti denotes the expected start time and the endured latest start time for task i. λki∈0,M denotes the proficiency level of worker k for task i. The smaller λki denotes the higher the proficiency, which means a shorter time required to complete task i. λki>M indicates that the worker does not possess a required skill and cannot complete the task. ai denotes the actual start time of task i. si denotes the standard service time of task i. Each worker k has a default working time window bk,ek, and any work performed after ek is considered as overtime. Let zk be the remaining time after technician k returns to the home for the day. Q denotes a large enough integer. The binary decision variables xijk=1,i,j∈V,k∈D if and only if the worker k travels from node i directly to node j. The binary decision variables yik=1,i∈C,k∈D if and only if task i is serviced by worker k.(3)max∑i=0n−11−Uin+∑k=0m−1zk/ek−bkm,(4)∑kεDyik=1,∀i∈C,(5)∑j∈Vxijk=∑j∈Vxjik=yik,∀i∈C,k∈D,(6)∑j∈Cxijk=0,∀i∈D,k∈Di,(7)aj=maxRj,ai+λkisi+cij,∀i,j∈C,∀k∈D,(8)aj≤Tj,∀j∈C,(9)ai+λkisi+cij≤aj+Q1−xijk,∀k∈D,i≠j∈C,(10)ak+ckj≤aj+Q1−xkjk,∀k∈D,j∈C,(11)aj+λkjsj+cjk≤ek−zk+Q1−xjkk,∀j∈C,k∈D,(12)0≤zk≤ek−bk,∀k,(13)xijk,yik∈0,1,∀i,j∈C,k∈D,(14)ai,si,zk∈R+,∀i,j∈C,k∈D.The objective function (3) has two parts; the first part represents maximizing the average satisfaction of all customers. Ui is calculated according to equation (2). The second part represents maximizing the average of remaining time ratio of workers. We include in the objective function the remaining time rather than the travel time because the remaining time can be used to allocate more jobs when new jobs are requested, while idle time is wasted just like travel time. Maximizing remaining time is the same as minimizing travel time plus idle time. The purpose of using the denominator is to remove the dimension. Constraint (4) ensures that each task is visited by exactly one worker. Flow conservation constraint (5) ensures that a worker arriving at a task location also leaves that location, and each task is visited exactly once. Constraint (6) is necessary for the assignment of workers to their homes. Equality (7) sets the arriving time at the task i. Constraint (8) ensures that the arriving time does not exceed the endured latest start time for taski. When two tasks are consecutively executed by the same worker, constraint (9) ensures that the beginning of service j starts up after the completion time of its predecessor i plus the travel time between them. Constraint (9) together with (10) and (11) is aimed to eliminate subtours. Constraint (12) guarantees that the idle time of workers that when they return to their home is less than or equal to the size of their time windows. Constraint (13) defines variables x and y as binaries, and constraint (14) defines ai,si,zk as nonnegative real variables.


## 5. Hybrid Fruit Fly Optimization Algorithm for FSSP

### 5.1. Standard FOA

The FOA is to simulate the foraging behavior of fruit fly swarms. Fruit flies have a keen sense of smell; they can detect a source of food at 40 km. Furthermore, they have outstanding vision and can find where other flies are gathering and flying in that direction. There are two main steps in FOA: smell-based search and vision-based search. In the smell-based procedure, a fruit fly search for food randomly around the swarm location. In the visual procedure, a fruit flies fly to the best location of the swarm according to its excellent vision. The two procedures are repeated until meeting the termination criterion. The standard FOA procedures are summarized as follows:Step 1: initialization. The parameters of the algorithm (i.e., population size and maximum number of iterations) and the initial center location of the swarm are initializedStep 2: smell-based search procedureStep 2.1: every fruit fly randomly determines a candidate location for a food sourceStep 2.2: evaluate the smell concentration values for each fruit flyStep 3: vision-based search procedureStep 3.1: find the fruit fly with the best smell concentration and record the best locationStep 3.2: the fruit fly flies toward the best location and updates the center location of the swarmStep 4: termination condition. If the termination conditions are met, the algorithm ends; otherwise, return to Step 2The standard FOA is mainly applied for continuous optimization. To solve the FSSP, the knowledge of the solution is analysed, and then the encoding method, the smell-based search, and the vision-based search are redesigned. The detailed implementations of the hybrid FOA are introduced, respectively, including the nearest insertion heuristic algorithm for initialization; the matrix-based representation and the decoding procedure; and three matrix-based search strategies and postoptimization process.


### 5.2. Solution Knowledge about Task Insertion Feasibility

Because of the presence of time windows, two factors should be considered when a task is inserted into existing routes: the skill constraint and time window. Here, a feasible insertion property is proposed. For workerf, the existing feasible routes are i1,i2,…,ip. If a task h is inserted after k−th position (between ik and ik+1), then the start service time in h is ah=∑t=1k−1citit+1+∑t=1kλfitsit+∑t=1kwit+cikh, where wit=maxRit−ait−1+λfit−1sit−1+cit−1it,0 represents the wait time in the it. The delay time in the ik+1 is as follows: (15)ΔDik+1=aik+λfiksik+cikh+λfhsh+wh+chik+1−aik+λfiksik+cikik+1=λfhsh+wh+cikh+chik+1−cikik+1.When theh inserts into the route, if ΔDik+1>0, then ik+1 will delay. Due to the “absorption” of the waiting time on the original route, the delay time in it after the insertion of h is as follows:(16)ΔDit=maxΔDik+1−∑t=k+1p−1wit,0,t=k+2,…,p.Suppose the original arriving time init is ait, then the maximum delay that does not violate the time window constraint in it is Tti−ati. Thus, if a task h is inserted after k−th position (between ik and ik+1), it should meet the following properties.Property 1.
For workerf, the existing feasible routes are i1,i2,…,ip. If a task h is inserted afterk−th position (between ik and ik+1), the necessary and sufficient conditions for insertion are as follows: (17)ah≤Th,ΔDit+ait≤Tit,t=k+1,…,p,λfh≤M.
According to Property1, we can check whether the task can be inserted into the position. However, maybe several positions are feasible in the route for the task which is the optimum position. The optimum insertion position is the one that the average degree of dissatisfaction is minimum after insertion in all possible insertion positions. The determination of the optimal insertion position can be made according to the following steps:Step 1: find out the set of all possible insertion positions in the current route for the candidate task, and set the customer's dissatisfaction to be 1.Step 2: calculate the average dissatisfaction of all customers after inserting the task into the leftmost position of the current feasible insertion position set. If the dissatisfaction is smaller than the original value, the average customer dissatisfaction is set to the current value, and the current insertion position is set as the optimal insertion position, and the position is deleted from the feasible set, and go to Step 3.Step 3: check the feasible insertion position collection. If the collection is not empty, go to Step 2; otherwise, end.


### 5.3. Heuristic for Initialization Based on Solution Knowledge

A random initialization method is simple but may produce invalid solutions. To generate an initial solution with good quality, an insertion heuristic initialization method utilizing knowledge of the problem is proposed. The nearest insertion heuristic algorithm (NIH) is a classical local search algorithm. The core idea is described as follows: the nearest task that meets the constraint is selected from the nonserviced task collection and then inserted into a route. Based on the above property, the improved NIH is proposed in this paper. We revise the criteria for selecting candidate tasks, not only considering the distance, but also the service time of the worker. Supposei is the last task in the current routes, j represents the unserviced task, and Nij represents the generalized costs between i and j. Nij can be defined as follows:(18)Nij=η1×cij+η2×λkj×sj,where η1andη2 are weight coefficients, where η1+η2=1. All unserviced task generalized costs are calculated according to formula (18). Then the smallest Nij is selected, and the task j is inserted into the routes following taski. The procedure for NIH is as follows.U represents the task set, RSkrepresents the k−th route set, CLk represents the travel time of the k−th routes, and Vj represents the task set of worker j.Step 1:U=C,k=0,RSk=∅,CLk=0,j=0.Step 2: check the status ofU. If it is null, then go to Step 5. Otherwise, select the minimum costly task i. If Ti>cki, then initialize RSk, insert task i into RSk, remove i fromU, and update CLk=cki+λkisi.Step 3: according to Property1, select an unserviced task from U, then calculate the generalized costs Nij of every task, and search the minimum Nij. Then insert the corresponding task into RSk, and update CLk and U. Repeat this procedure until no task is selected.Step 4:k=k+1, CLk=0, go back to Step 2.Step 5: map the initialization solution to the encoding population. Calculate the concentration of the initial solution, and select the maximum fitness as the current optimal solution.


### 5.4. Representation and Decoding Procedure

To determine a feasible schedule for the FSSP, it needs to assign a suitable worker for each task and arrange the execution orders of task for each worker. In the HFOA, the solution is represented by anm×n matrix, where the m rows denote m workers and n columns represent the n tasks.(19)G=g00g10⋯gm−10g01g02⋯g0n−1g11g12⋯g1n−1⋯⋯⋯⋯gm−11gm−12⋯gm−1n−1.The elements in the matrixgji≠0 represent that task i is assigned to worker j. Otherwise, gji=0. Because all tasks are processed only once, gji=∑j=0m−1gji2, meaning there is only one nonzero element in each column. For every row j, the collection of nonzero elements Gj=gjl,gjm,…,gji represents the tasks that are assigned to worker j. These elements are arranged from small to large, and the corresponding task order is worker’s service route. Using the encoding scheme, the tasks and the routes for workers can be represented simultaneously, and the search operator applied to the representation influences the schedule directly. To map a solution to a feasible schedule, the decoding procedure is outlined as follows:Step 1: generate the initial allocation plan for every worker.Forj=0tom−1 {select all the nonzero elements gjl,gjm,…,gji of row j. Then sequence gjl,gjm,…,gji from small to large, and then the corresponding tasks are m,j,…,l.}Step 2: the amendment of the illegal solution. For the routesl,k,…,i of worker j, each task is checked whether the arrival time of the workers meets constraint (8) in turn. If constraint (8) is violated, the task is deleted and reinserted into the routes according to Property 1, and the procedure with the determination of the optimal insertion position is applied. If it is unable to insert, the task will be assigned to other workers. There are three principles of assignment: (a) assign to the nearest workers; (b) assign to the workers who have the shortest service time; and (c) assign to the workers who have the least task. Repeat the above procedure until all tasks in the route are feasible. For the routes that are reallocated, the process is also performed.Step 3: according to the feasible solution, the corresponding coding value is corrected, and the correction process is to exchange the corresponding value.Example 1.
Consider 3 workers and 8 tasks in FSSP, and the encoding is as follows:(20)G=02.8709.65003.120008.750001.430013.841.9400007.61.
According to the decoding algorithm, for worker 1, the tasks are (7, 2, 4), for worker 2, the tasks are (1, 5), and for worker 3, the tasks are (3, 8, 6). Then check and revise the routes, and the workers’ travel routes are as follows: no. 1 route is 2-7-4; no. 2 route is 5-1; and no. 3 route 8-6-3. Finally, the code will be encoded and the resulting code is as follows:(21)G′=01.9409.65008.750003.1200013.84007.612.8700001.43.


### 5.5. Fruit Fly Search Strategies Based on Prior Knowledge

The classical FOA utilizes real number coding and is mainly applied to function optimization. Therefore, the strategies of classical FOA are not applicable to the FSSP. In this paper, three strategies of fruit fly search are proposed according to the characteristics of the FSSP. First, we define two operators on two matrices.posSwapm,k represents that the m−th row (or column) and k−th row (or column) are exchanged in a matrix A. Arepresents an individual fruit fly. All nonzero elements in G are calculated as follows: (22)gli=gli+rand×glibest−gli,gli≠0,l=mork,i>0,where glibest denotes the corresponding value for the current best individual. From the perspective of social psychology, this operation indicates that fruit flies use population experience information to guide their search. valueSwapm,k represents that the element gmk in A is reassigned to a new value according to the following formula:(23)gmk=gmk+rand×gmknb−gmk,where gmknb denotes the corresponding value in the neighbour that is selected randomly within the field of view. From the perspective of social psychology, this operator represents the comparison of two positions of fruit flies on the horizon and determines which position is closer to the food source. It is worth noting that when gmk is updated, the other elements in column k will be set to zero to guarantee a feasible solution.Based on these two operators, three search strategies are defined:(1)
Worker-swap (W-sp):m∈D,k∈D,posSwapm,k. This strategy indicates that all tasks are exchanged between two workers, and it also causes service order changes.(2)
Task-swap (T-sp):m∈C,k∈C,posSwapm,k. This strategy indicates that two tasks are exchanged between two workers. The service orders may also change simultaneously.(3)
Task-reallocation (T-re):m∈C,k∈D,valueSwapm,k. This strategy indicates that task k is assigned to worker m. It can also change the service order.The aforementioned strategies have to perform the decoding procedure that is described in Section5.4 after execution, and if it encounters an illegal solution, it is corrected according to Property 1 and the procedure of determination of the optimal insertion position. Based on the strategies, the smell-based search and vision-based search are implemented as illustrated in Figures 6 and 7. As we know, the smell-based search is primarily responsible for exploration. Its search range is relatively large in the FOA. The vision-based search is primarily responsible for exploitation. It performs fine-grained searching in a relatively small area. According to the above principles, for smell-based search, W-sp, T-sp, and T-re are carried out in turn. We then select the best solution from the three results. Next, if the best new solution is better than the original solution, we update the original solution using the new solution. Otherwise, we repeat the above procedure until the original solution is improved. While the best acceptance principle is utilized in the smell-based search, the better acceptance principle is utilized in the vision-based search, only T-sp and T-re are carried out, and whenever a better solution is found, the previous solution will be updated.Figure 6
Smell-based search procedure.Figure 7
Vision-based search procedure.


### 5.6. Postoptimization Procedure

To improve the quality of the solution, two local search algorithms (2-Opt and Or-Opt) are carried out as the postoptimization procedure. The 2-Opt and Or-Opt algorithms will compare every possible valid combination of the swapping to find the better solution. Note that the nodes should be checked according to Property1 before swapping. The postoptimization process utilizes a better acceptance strategy to update the solution. Based on the above design, the flowchart of the HFOA is presented in Figure 8.Figure 8
Flowchart of the HFOA for FSSP.


### 5.7. Computational Complexity Analysis

To analyze the efficiency of the algorithm, computational complexity analysis is necessary. Assume that the population size isP, and the maximum iteration number is NC, the task number is n and the worker is m. According to the procedure of HFOA, its computational complexity can be analysed as follows: in the initialization procedure, the computational complexity of NIH is On2 and the computational complexity of the encoding procedure is OP×n×m. For each iteration, in the decoding procedure, there are find and sort process and the computational complexity is OP×n2×m. The computational complexity of fitness evaluation is OP×n. In the smell-based search, W-sp, T-sp, and T-re are carried out in turn. For each search strategy, the computational complexity is OP×n. Then, the decoding and fitness evaluation procedure are carried out after the search strategy. Therefore, the computational complexity of smell-based search is approximate to O3P×n2×m. Similar to smell-based search, the computational complexity of vision-based search procedure is O2P×n2×m. In the postoptimization procedure, the computational complexities of 2-Opt and Or-Opt are, respectively, On2 and On3. Usually, it is reasonable to take the highest power item as the computational complexity of the algorithm. Therefore, the analyses above show that the computational complexity is ONC×P×6×n2×m+n3. The algorithm approximates an On3 level algorithm.


## 5.1. Standard FOA

The FOA is to simulate the foraging behavior of fruit fly swarms. Fruit flies have a keen sense of smell; they can detect a source of food at 40 km. Furthermore, they have outstanding vision and can find where other flies are gathering and flying in that direction. There are two main steps in FOA: smell-based search and vision-based search. In the smell-based procedure, a fruit fly search for food randomly around the swarm location. In the visual procedure, a fruit flies fly to the best location of the swarm according to its excellent vision. The two procedures are repeated until meeting the termination criterion. The standard FOA procedures are summarized as follows:Step 1: initialization. The parameters of the algorithm (i.e., population size and maximum number of iterations) and the initial center location of the swarm are initializedStep 2: smell-based search procedureStep 2.1: every fruit fly randomly determines a candidate location for a food sourceStep 2.2: evaluate the smell concentration values for each fruit flyStep 3: vision-based search procedureStep 3.1: find the fruit fly with the best smell concentration and record the best locationStep 3.2: the fruit fly flies toward the best location and updates the center location of the swarmStep 4: termination condition. If the termination conditions are met, the algorithm ends; otherwise, return to Step 2The standard FOA is mainly applied for continuous optimization. To solve the FSSP, the knowledge of the solution is analysed, and then the encoding method, the smell-based search, and the vision-based search are redesigned. The detailed implementations of the hybrid FOA are introduced, respectively, including the nearest insertion heuristic algorithm for initialization; the matrix-based representation and the decoding procedure; and three matrix-based search strategies and postoptimization process.


## 5.2. Solution Knowledge about Task Insertion Feasibility

Because of the presence of time windows, two factors should be considered when a task is inserted into existing routes: the skill constraint and time window. Here, a feasible insertion property is proposed. For workerf, the existing feasible routes are i1,i2,…,ip. If a task h is inserted after k−th position (between ik and ik+1), then the start service time in h is ah=∑t=1k−1citit+1+∑t=1kλfitsit+∑t=1kwit+cikh, where wit=maxRit−ait−1+λfit−1sit−1+cit−1it,0 represents the wait time in the it. The delay time in the ik+1 is as follows: (15)ΔDik+1=aik+λfiksik+cikh+λfhsh+wh+chik+1−aik+λfiksik+cikik+1=λfhsh+wh+cikh+chik+1−cikik+1.When theh inserts into the route, if ΔDik+1>0, then ik+1 will delay. Due to the “absorption” of the waiting time on the original route, the delay time in it after the insertion of h is as follows:(16)ΔDit=maxΔDik+1−∑t=k+1p−1wit,0,t=k+2,…,p.Suppose the original arriving time init is ait, then the maximum delay that does not violate the time window constraint in it is Tti−ati. Thus, if a task h is inserted after k−th position (between ik and ik+1), it should meet the following properties.Property 1.
For workerf, the existing feasible routes are i1,i2,…,ip. If a task h is inserted afterk−th position (between ik and ik+1), the necessary and sufficient conditions for insertion are as follows: (17)ah≤Th,ΔDit+ait≤Tit,t=k+1,…,p,λfh≤M.
According to Property1, we can check whether the task can be inserted into the position. However, maybe several positions are feasible in the route for the task which is the optimum position. The optimum insertion position is the one that the average degree of dissatisfaction is minimum after insertion in all possible insertion positions. The determination of the optimal insertion position can be made according to the following steps:Step 1: find out the set of all possible insertion positions in the current route for the candidate task, and set the customer's dissatisfaction to be 1.Step 2: calculate the average dissatisfaction of all customers after inserting the task into the leftmost position of the current feasible insertion position set. If the dissatisfaction is smaller than the original value, the average customer dissatisfaction is set to the current value, and the current insertion position is set as the optimal insertion position, and the position is deleted from the feasible set, and go to Step 3.Step 3: check the feasible insertion position collection. If the collection is not empty, go to Step 2; otherwise, end.


## 5.3. Heuristic for Initialization Based on Solution Knowledge

A random initialization method is simple but may produce invalid solutions. To generate an initial solution with good quality, an insertion heuristic initialization method utilizing knowledge of the problem is proposed. The nearest insertion heuristic algorithm (NIH) is a classical local search algorithm. The core idea is described as follows: the nearest task that meets the constraint is selected from the nonserviced task collection and then inserted into a route. Based on the above property, the improved NIH is proposed in this paper. We revise the criteria for selecting candidate tasks, not only considering the distance, but also the service time of the worker. Supposei is the last task in the current routes, j represents the unserviced task, and Nij represents the generalized costs between i and j. Nij can be defined as follows:(18)Nij=η1×cij+η2×λkj×sj,where η1andη2 are weight coefficients, where η1+η2=1. All unserviced task generalized costs are calculated according to formula (18). Then the smallest Nij is selected, and the task j is inserted into the routes following taski. The procedure for NIH is as follows.U represents the task set, RSkrepresents the k−th route set, CLk represents the travel time of the k−th routes, and Vj represents the task set of worker j.Step 1:U=C,k=0,RSk=∅,CLk=0,j=0.Step 2: check the status ofU. If it is null, then go to Step 5. Otherwise, select the minimum costly task i. If Ti>cki, then initialize RSk, insert task i into RSk, remove i fromU, and update CLk=cki+λkisi.Step 3: according to Property1, select an unserviced task from U, then calculate the generalized costs Nij of every task, and search the minimum Nij. Then insert the corresponding task into RSk, and update CLk and U. Repeat this procedure until no task is selected.Step 4:k=k+1, CLk=0, go back to Step 2.Step 5: map the initialization solution to the encoding population. Calculate the concentration of the initial solution, and select the maximum fitness as the current optimal solution.


## 5.4. Representation and Decoding Procedure

To determine a feasible schedule for the FSSP, it needs to assign a suitable worker for each task and arrange the execution orders of task for each worker. In the HFOA, the solution is represented by anm×n matrix, where the m rows denote m workers and n columns represent the n tasks.(19)G=g00g10⋯gm−10g01g02⋯g0n−1g11g12⋯g1n−1⋯⋯⋯⋯gm−11gm−12⋯gm−1n−1.The elements in the matrixgji≠0 represent that task i is assigned to worker j. Otherwise, gji=0. Because all tasks are processed only once, gji=∑j=0m−1gji2, meaning there is only one nonzero element in each column. For every row j, the collection of nonzero elements Gj=gjl,gjm,…,gji represents the tasks that are assigned to worker j. These elements are arranged from small to large, and the corresponding task order is worker’s service route. Using the encoding scheme, the tasks and the routes for workers can be represented simultaneously, and the search operator applied to the representation influences the schedule directly. To map a solution to a feasible schedule, the decoding procedure is outlined as follows:Step 1: generate the initial allocation plan for every worker.Forj=0tom−1 {select all the nonzero elements gjl,gjm,…,gji of row j. Then sequence gjl,gjm,…,gji from small to large, and then the corresponding tasks are m,j,…,l.}Step 2: the amendment of the illegal solution. For the routesl,k,…,i of worker j, each task is checked whether the arrival time of the workers meets constraint (8) in turn. If constraint (8) is violated, the task is deleted and reinserted into the routes according to Property 1, and the procedure with the determination of the optimal insertion position is applied. If it is unable to insert, the task will be assigned to other workers. There are three principles of assignment: (a) assign to the nearest workers; (b) assign to the workers who have the shortest service time; and (c) assign to the workers who have the least task. Repeat the above procedure until all tasks in the route are feasible. For the routes that are reallocated, the process is also performed.Step 3: according to the feasible solution, the corresponding coding value is corrected, and the correction process is to exchange the corresponding value.Example 1.
Consider 3 workers and 8 tasks in FSSP, and the encoding is as follows:(20)G=02.8709.65003.120008.750001.430013.841.9400007.61.
According to the decoding algorithm, for worker 1, the tasks are (7, 2, 4), for worker 2, the tasks are (1, 5), and for worker 3, the tasks are (3, 8, 6). Then check and revise the routes, and the workers’ travel routes are as follows: no. 1 route is 2-7-4; no. 2 route is 5-1; and no. 3 route 8-6-3. Finally, the code will be encoded and the resulting code is as follows:(21)G′=01.9409.65008.750003.1200013.84007.612.8700001.43.


## 5.5. Fruit Fly Search Strategies Based on Prior Knowledge

The classical FOA utilizes real number coding and is mainly applied to function optimization. Therefore, the strategies of classical FOA are not applicable to the FSSP. In this paper, three strategies of fruit fly search are proposed according to the characteristics of the FSSP. First, we define two operators on two matrices.posSwapm,k represents that the m−th row (or column) and k−th row (or column) are exchanged in a matrix A. Arepresents an individual fruit fly. All nonzero elements in G are calculated as follows: (22)gli=gli+rand×glibest−gli,gli≠0,l=mork,i>0,where glibest denotes the corresponding value for the current best individual. From the perspective of social psychology, this operation indicates that fruit flies use population experience information to guide their search. valueSwapm,k represents that the element gmk in A is reassigned to a new value according to the following formula:(23)gmk=gmk+rand×gmknb−gmk,where gmknb denotes the corresponding value in the neighbour that is selected randomly within the field of view. From the perspective of social psychology, this operator represents the comparison of two positions of fruit flies on the horizon and determines which position is closer to the food source. It is worth noting that when gmk is updated, the other elements in column k will be set to zero to guarantee a feasible solution.Based on these two operators, three search strategies are defined:(1)
Worker-swap (W-sp):m∈D,k∈D,posSwapm,k. This strategy indicates that all tasks are exchanged between two workers, and it also causes service order changes.(2)
Task-swap (T-sp):m∈C,k∈C,posSwapm,k. This strategy indicates that two tasks are exchanged between two workers. The service orders may also change simultaneously.(3)
Task-reallocation (T-re):m∈C,k∈D,valueSwapm,k. This strategy indicates that task k is assigned to worker m. It can also change the service order.The aforementioned strategies have to perform the decoding procedure that is described in Section5.4 after execution, and if it encounters an illegal solution, it is corrected according to Property 1 and the procedure of determination of the optimal insertion position. Based on the strategies, the smell-based search and vision-based search are implemented as illustrated in Figures 6 and 7. As we know, the smell-based search is primarily responsible for exploration. Its search range is relatively large in the FOA. The vision-based search is primarily responsible for exploitation. It performs fine-grained searching in a relatively small area. According to the above principles, for smell-based search, W-sp, T-sp, and T-re are carried out in turn. We then select the best solution from the three results. Next, if the best new solution is better than the original solution, we update the original solution using the new solution. Otherwise, we repeat the above procedure until the original solution is improved. While the best acceptance principle is utilized in the smell-based search, the better acceptance principle is utilized in the vision-based search, only T-sp and T-re are carried out, and whenever a better solution is found, the previous solution will be updated.Figure 6
Smell-based search procedure.Figure 7
Vision-based search procedure.


## 5.6. Postoptimization Procedure

To improve the quality of the solution, two local search algorithms (2-Opt and Or-Opt) are carried out as the postoptimization procedure. The 2-Opt and Or-Opt algorithms will compare every possible valid combination of the swapping to find the better solution. Note that the nodes should be checked according to Property1 before swapping. The postoptimization process utilizes a better acceptance strategy to update the solution. Based on the above design, the flowchart of the HFOA is presented in Figure 8.Figure 8
Flowchart of the HFOA for FSSP.


## 5.7. Computational Complexity Analysis

To analyze the efficiency of the algorithm, computational complexity analysis is necessary. Assume that the population size isP, and the maximum iteration number is NC, the task number is n and the worker is m. According to the procedure of HFOA, its computational complexity can be analysed as follows: in the initialization procedure, the computational complexity of NIH is On2 and the computational complexity of the encoding procedure is OP×n×m. For each iteration, in the decoding procedure, there are find and sort process and the computational complexity is OP×n2×m. The computational complexity of fitness evaluation is OP×n. In the smell-based search, W-sp, T-sp, and T-re are carried out in turn. For each search strategy, the computational complexity is OP×n. Then, the decoding and fitness evaluation procedure are carried out after the search strategy. Therefore, the computational complexity of smell-based search is approximate to O3P×n2×m. Similar to smell-based search, the computational complexity of vision-based search procedure is O2P×n2×m. In the postoptimization procedure, the computational complexities of 2-Opt and Or-Opt are, respectively, On2 and On3. Usually, it is reasonable to take the highest power item as the computational complexity of the algorithm. Therefore, the analyses above show that the computational complexity is ONC×P×6×n2×m+n3. The algorithm approximates an On3 level algorithm.


## 6. Experimental Results and Comparisons

### 6.1. Test Instance

The HFOA is coded in C++ and executed on a PC with an Intel Core i5 2450M@2.50 GHz CPU. Since there is no public standard benchmark for the FSSP, we built the instances based on the well-known multidepot vehicle routing problem with time windows which were designed by Cordeau [46].The new instances keep the original coordinates. The number of workers is equal to the number of vehicles in the original instances. There are multiple vehicles in each warehouse in the original instances. Therefore, while setting the original warehouse location as a worker’s location, it is also necessary to set some customer locations as worker positions. In addition, for each instance, it is necessary to generate a matrix of workers’ proficiency levels for tasks. The matrix is generated randomly, and the range ofλki is [0.5, 3]. For each worker, bk=0,ek=1000. The time windows of the customer in the original instance are Ei,Li. In our instance, the time window of the task is Ri,Ti. Ti=Li,Ri=Ti/1+γ−1β−1. The service time is set to the standard customer service time. There are 20 instances in our experiments, and the detailed information is described in Table 1.Table 1
Instance description.
Instance(m × n)PR018 × 44PR0212 × 88PR0316 × 132PR0420 × 176PR0524 × 220PR0628 × 264PR0712 × 66PR0818 × 132PR0924 × 198PR1030 × 264PR114 × 48PR128 × 92PR1312 × 136PR1416 × 180PR1520 × 224PR1624 × 268PR176 × 72PR1812 × 138PR1918 × 204PR2024 × 270PR01 represents 4 depots and 48 customers, with 2 vehicles in each depot in the MDVRPTW dataset. Here, we modify it to 8 workers and 44 tasks. 4 workers are located at the original depot and the other four are randomly selected from the group of customers. The other instances are similarly converted. It is noted that the difference between PR01 and PR11 is only in the time window. The time window of PR01 is more compact, but PR11 is more relaxed. As a result, PR01 needs more workers.The parameters of our algorithm are set as follows: the parameters of dissatisfaction functionγ=2.55,β=0.88, population size P=100, and iteration number NC=1000. To conveniently evaluate and compare the algorithms, the relative percentage increase (RPI) is defined as follows: (24)RPI=fA−fbfb×100%,where A denotes HFOA, its variants, and the state-of-the-art algorithms.fA represents the average result of 20 runs for algorithm A, and fb is the best result among the algorithms.


### 6.2. Effectiveness of Three Key Features of the HFOA

#### 6.2.1. Effectiveness of Initialization Method

Firstly, to certificate the effectiveness of the hybrid initialization method for the HFOA, the experiments are implemented to compare the hybrid initialization method with the other two methods. The two methods are NIH and random method, and the corresponding HFOAs with the two approaches are namedn-HFOA and r-HFOA. Six instances (PR01, PR05, PR10, PR11, PR15, and PR20) are selected for the test. The RPI results are shown in Table 2. It can be seen from Table 2 that the optimization results of n-HFOA are significantly better than the random method (r-HFOA), and the RPI is improved by 4.76% on average. The optimization results of the hybrid initialization method (HFOA) are better than the n-HFOA, with an average increase of 3.51%. This is because NIH can generate an initial solution with better quality, which helps the algorithm to locate promising regions within the large search space. And the random method can generate diversity distribution initial solution. Therefore, the hybrid initialization method is more effective and efficient.Table 2
Comparisons of the RPI values for different initialization methods.
HFOAn-HFOAr-HFOAPR010.934.928.23PR050.782.9610.27PR100.123.8011.71PR110.743.978.58PR150.663.699.91PR200.735.7010.88Avg.0.664.179.93To evaluate the parametersη1andη2, we implement another comparison experiment. 9 levels are set for η1 as shown in Table 3. As η1+η2=1, the η2 is not independent and then it is not listed in the table. From Table 3, when η1=0.5, the results are significantly better than other values. As for η1 and η2, moderate values are preferred that is because η1 and η2 determine the weight of travel time and service time. A too large η1 and a too small η2 may cause overfocusing on the travel time when inserting the new task in the route. On the contrary, a too small η1 and a too large η2 may cause overfocusing on the service time when inserting the new task in the route. According to the results of the experiment, the weight coefficient of NIH is set η1=0.5,η2=0.5.Table 3
Comparisons of the RPI values for differentη1 values.
η1PR01PR05PR10PR11PR15PR20Avg.0.13.312.633.193.622.172.832.960.22.111.192.563.282.792.442.400.31.541.882.051.891.671.851.810.41.751.490.651.481.511.731.440.50.930.780.120.740.660.730.660.61.130.840.210.710.930.910.780.71.341.891.122.071.631.771.630.81.832.451.682.511.912.112.080.92.162.422.652.162.672.922.50


#### 6.2.2. Effectiveness of Fruit Fly Search Strategies

Secondly, we verified the effectiveness of the three search strategies presented above. The three search strategies were executed separately. The results of the RPI on the three search strategies are shown in Table4. It can be seen from the table that the results of T-sp are the best and the results of W-sp are the worst because W-sp mainly exchanges customers between the workers, although it can change the customers’ order, but more limited, relatively rough search. The ability of T-re is stronger than that of W-sp, and the optimization result of RPI is improved by 23.53% on average. T-re is like an insertion operator, and the search precision is better than that of W-sp. The T-sp operator has the strongest optimization ability in the three search strategies, which is 15.06% higher than the T-re, since T-sp operator does not only change the assignment of tasks between workers, but also changes the order of the tasks. It is like a 2-Opt operator that integrates between innerroutes and interroutes.Table 4
Comparisons of the RPI values for different search strategies.
T-spT-reW-spPR0113.9536.6756.05PR0518.2129.3051.71PR1011.3228.4157.87PR1119.3634.2648.63PR1518.0936.3261.76PR2016.0722.4452.58Avg.16.1731.2354.76Next, to compare the performance of the smell search and vision search, we carry out computational experiments to compare the HFOA with different search procedures. The full version that the smell search and vision search are all executed is named HFOA, the version that only the smell search is executed is named HFOAss, and the version that only the vision search is executed is named HFOAvs. 6 instances (RP01, PR05, PR10, PR11, PR15, and PR20) are tested. The average RPI for the 6 instances is 0.66% for HFOA, 1.89% for HFOAss, and 3.71% for HFOAvs. The RPI values are shown in Figure9. From the figure, we can see that the full version is significantly better than the others. The HFOAss is more effective than HFOAvs. The smell search executes the three strategies (T-re, T-sp, and W-sp) in turn and selects the best result to update the solution. On the contrary, the vision search is primarily responsible for exploitation, only T-sp and T-re are carried out, and whenever a better solution is found, the solution will be updated.Figure 9
Comparison of smell and vision strategies.


#### 6.2.3. Effectiveness of Postoptimization

Furthermore, to verify the effectiveness of the postoptimization search, we carry out computational experiments to compare the HFOA with different postoptimization procedures. Figure10 shows the effect of the postoptimization procedure on the algorithm. It is clear from the comparisons that the hybrid procedure using 2-Opt and Or-Opt can produce significantly better results than other methods. The postoptimization procedures (2-Opt + Or-Opt) lead to a performance improvement of approximately 3.56%. Using a postoptimization algorithm alone, Or-Opt has a slight advantage over 2 -Opt.Figure 10
Comparisons of postoptimization.


### 6.3. Comparison with State-of-the-Art Algorithms

To verify the performance of the proposed algorithm, we compared the HFOA with the four algorithms: GRASP [9], genetic algorithm (GA) [15], the record-to-record travel algorithm (RTR) [22], and memetic algorithm (MA) [21]. The parameters for the GRASP, GA, RTR, and MA are set to the corresponding value according to the existing literature. The RPI values for the five algorithms are shown in Table 5. The best value is marked in bold. From the table, we can see that HFOA is significantly superior to the other four algorithms. The average RPI value of the HFOA is 0.57%, which is much lower than those four algorithms. Simultaneously, the HFOA performs the best for 18 out of 20 instances, except PR09 and PR19. The MA has an average RPI value of 1.63% and it is ranked second. Meanwhile, it gets the best result in PR09 and PR19. For the other three algorithms, the average RPI of GA is equal to 3.81%, and it is ranked third. The average RPI of GRASP and RTR are 8.51% and 11.21%. Based on the above analysis, we can conclude that HFOA has better performance than other algorithms.Table 5
Comparisons of HFOA with the state-of-the-art algorithms.
InstanceGRASPGARTRMAHFOAPR018.064.478.072.450.93PR027.113.237.852.020.25PR037.325.9410.611.470.74PR049.812.4710.831.410.67PR0510.32.0812.791.950.78PR065.581.469.501.780.94PR078.192.599.241.750.19PR0811.424.089.292.530.95PR0910.924.9210.870.550.64PR1010.796.2511.851.710.12PR113.563.5513.791.030.74PR1210.674.649.041.220.23PR137.834.5615.630.910.61PR1410.913.6211.771.530.79PR156.891.5516.751.960.66PR164.764.3110.851.360.45PR175.315.0512.081.530.17PR188.634.4812.521.720.02PR1913.124.849.010.780.87PR208.912.0611.952.950.73Avg.8.513.8111.211.630.57


### 6.4. Application to Solve Vehicle Routing Problem with Time Windows

Furthermore, to verify the ability of HFOA to solve the NP-hard problem, the well-known combined optimization problem vehicle routing problem with time windows is provided in this section. The dataset including 56 Solomon instances with 100 customers is tested in the experiments. These instances are categorized into six different categories: R1, R2, C1, C2, RC1, and RC2. Each category contains R which indicates that customers are distributed randomly, C categories are clustered, and RC means customers are distributed both randomly and clustered. Moreover, the R1, C1, and RC1 instances have narrower time windows for the depot and all customers are associated with very tight time windows. By contrast, the R2, C2, and RC2 instances have a long scheduling horizon that permits many customers to be serviced by the same vehicle, and the time windows defined for the customers are wider.All instances are repeatedly solved 20 times. The HFOA results are compared to those obtained by other algorithms in the literature. We select six state-of-the-art algorithms that have obtained the best results. These algorithms include the following: genetic algorithm and set partitioning (CGH) [47], genetic algorithm (GA) [48], hybrid ant colony with tabu search (ACOT) [49], a multiadaptive particle swarm optimization (MAPSO) [50], adaptive harmony search algorithm (AHSA) [51], and a probabilistic tabu search (TS) [52]. The RPI values of the six algorithms and HFOA over all tested instances are presented and compared in Table 6. The best-known results of average total distances (TD) for each category also are reported. The results tabulated in Table 5 show that HFOA achieved competitive results compared to others, among the total 7 heuristics, HFOA is ranked second. The proposed algorithm can achieve the solutions close to the best-known solutions for the cluster problem sets C1 and C2. Moreover, HFOA can obtain comparable solutions for the problem sets R1, R2, RC1, and RC2 compared with other metaheuristics.Table 6
Comparison of the HFOA with the state-of-the-art methods.
DatasetBest (TD)CGH (%)GA (%)ACOT (%)MAPSO (%)AHSA (%)TS (%)HFOA (%)R11156.362.345.504.914.645.204.584.31R2877.202.5912.378.568.5311.0011.757.84C1826.700.202.951.840.201.010.200.91C2589.240.115.243.990.116.990.110.22RC11338.180.262.135.793.443.243.812.96RC21003.951.1910.4111.6011.5210.1711.308.68Avg.965.271.116.436.114.746.275.294.15To compare the convergence speed with the state-of-the-art algorithms, the average computational time is reported in Table7. We report the average running time in seconds. The best computational times are highlighted in bold font. It is noted that the CGH and GA do not report the runtime for each category and only provide the total average computational time; TS does not report the running time. CGH and TS also do not report the CPU type. As can be seen from the table, the computational time of HFOA is very competitive with CGH, GA, ACOT, and AHSA. Furthermore, we could observe that the algorithm converges faster in the clustered instances. Considering the tradeoff of quality and computation time, HFOA is the competitive approach among the seven methods.Table 7
The computational time (average) of the state-of-the-art methods.
R1R2C1C2RC1RC2Avg.CGH——————3600.00GA——————835.00ACOT698.00655.00210.00142.00317.00407.00404.83MAPSO22.5822.0418.5519.5523.4321.5821.29AHSA64.32635.09108.14141.54109.88442.07250.17TS———————HFOA118.90123.6798.8495.16123.20131.37115.19CPU type: CGH-; GA: Intel Pentium II 266 MMX; ACOT: Intel Pentium 1000 MHz; MAPSO: Intel Core i5 2430M@ 2.40 GHz; AHSA: Intel Xeon 2.8 GHz; TS-; HFOA: Intel Core i5 2450M@2.50 GHz.


## 6.1. Test Instance

The HFOA is coded in C++ and executed on a PC with an Intel Core i5 2450M@2.50 GHz CPU. Since there is no public standard benchmark for the FSSP, we built the instances based on the well-known multidepot vehicle routing problem with time windows which were designed by Cordeau [46].The new instances keep the original coordinates. The number of workers is equal to the number of vehicles in the original instances. There are multiple vehicles in each warehouse in the original instances. Therefore, while setting the original warehouse location as a worker’s location, it is also necessary to set some customer locations as worker positions. In addition, for each instance, it is necessary to generate a matrix of workers’ proficiency levels for tasks. The matrix is generated randomly, and the range ofλki is [0.5, 3]. For each worker, bk=0,ek=1000. The time windows of the customer in the original instance are Ei,Li. In our instance, the time window of the task is Ri,Ti. Ti=Li,Ri=Ti/1+γ−1β−1. The service time is set to the standard customer service time. There are 20 instances in our experiments, and the detailed information is described in Table 1.Table 1
Instance description.
Instance(m × n)PR018 × 44PR0212 × 88PR0316 × 132PR0420 × 176PR0524 × 220PR0628 × 264PR0712 × 66PR0818 × 132PR0924 × 198PR1030 × 264PR114 × 48PR128 × 92PR1312 × 136PR1416 × 180PR1520 × 224PR1624 × 268PR176 × 72PR1812 × 138PR1918 × 204PR2024 × 270PR01 represents 4 depots and 48 customers, with 2 vehicles in each depot in the MDVRPTW dataset. Here, we modify it to 8 workers and 44 tasks. 4 workers are located at the original depot and the other four are randomly selected from the group of customers. The other instances are similarly converted. It is noted that the difference between PR01 and PR11 is only in the time window. The time window of PR01 is more compact, but PR11 is more relaxed. As a result, PR01 needs more workers.The parameters of our algorithm are set as follows: the parameters of dissatisfaction functionγ=2.55,β=0.88, population size P=100, and iteration number NC=1000. To conveniently evaluate and compare the algorithms, the relative percentage increase (RPI) is defined as follows: (24)RPI=fA−fbfb×100%,where A denotes HFOA, its variants, and the state-of-the-art algorithms.fA represents the average result of 20 runs for algorithm A, and fb is the best result among the algorithms.


## 6.2. Effectiveness of Three Key Features of the HFOA

### 6.2.1. Effectiveness of Initialization Method

Firstly, to certificate the effectiveness of the hybrid initialization method for the HFOA, the experiments are implemented to compare the hybrid initialization method with the other two methods. The two methods are NIH and random method, and the corresponding HFOAs with the two approaches are namedn-HFOA and r-HFOA. Six instances (PR01, PR05, PR10, PR11, PR15, and PR20) are selected for the test. The RPI results are shown in Table 2. It can be seen from Table 2 that the optimization results of n-HFOA are significantly better than the random method (r-HFOA), and the RPI is improved by 4.76% on average. The optimization results of the hybrid initialization method (HFOA) are better than the n-HFOA, with an average increase of 3.51%. This is because NIH can generate an initial solution with better quality, which helps the algorithm to locate promising regions within the large search space. And the random method can generate diversity distribution initial solution. Therefore, the hybrid initialization method is more effective and efficient.Table 2
Comparisons of the RPI values for different initialization methods.
HFOAn-HFOAr-HFOAPR010.934.928.23PR050.782.9610.27PR100.123.8011.71PR110.743.978.58PR150.663.699.91PR200.735.7010.88Avg.0.664.179.93To evaluate the parametersη1andη2, we implement another comparison experiment. 9 levels are set for η1 as shown in Table 3. As η1+η2=1, the η2 is not independent and then it is not listed in the table. From Table 3, when η1=0.5, the results are significantly better than other values. As for η1 and η2, moderate values are preferred that is because η1 and η2 determine the weight of travel time and service time. A too large η1 and a too small η2 may cause overfocusing on the travel time when inserting the new task in the route. On the contrary, a too small η1 and a too large η2 may cause overfocusing on the service time when inserting the new task in the route. According to the results of the experiment, the weight coefficient of NIH is set η1=0.5,η2=0.5.Table 3
Comparisons of the RPI values for differentη1 values.
η1PR01PR05PR10PR11PR15PR20Avg.0.13.312.633.193.622.172.832.960.22.111.192.563.282.792.442.400.31.541.882.051.891.671.851.810.41.751.490.651.481.511.731.440.50.930.780.120.740.660.730.660.61.130.840.210.710.930.910.780.71.341.891.122.071.631.771.630.81.832.451.682.511.912.112.080.92.162.422.652.162.672.922.50


### 6.2.2. Effectiveness of Fruit Fly Search Strategies

Secondly, we verified the effectiveness of the three search strategies presented above. The three search strategies were executed separately. The results of the RPI on the three search strategies are shown in Table4. It can be seen from the table that the results of T-sp are the best and the results of W-sp are the worst because W-sp mainly exchanges customers between the workers, although it can change the customers’ order, but more limited, relatively rough search. The ability of T-re is stronger than that of W-sp, and the optimization result of RPI is improved by 23.53% on average. T-re is like an insertion operator, and the search precision is better than that of W-sp. The T-sp operator has the strongest optimization ability in the three search strategies, which is 15.06% higher than the T-re, since T-sp operator does not only change the assignment of tasks between workers, but also changes the order of the tasks. It is like a 2-Opt operator that integrates between innerroutes and interroutes.Table 4
Comparisons of the RPI values for different search strategies.
T-spT-reW-spPR0113.9536.6756.05PR0518.2129.3051.71PR1011.3228.4157.87PR1119.3634.2648.63PR1518.0936.3261.76PR2016.0722.4452.58Avg.16.1731.2354.76Next, to compare the performance of the smell search and vision search, we carry out computational experiments to compare the HFOA with different search procedures. The full version that the smell search and vision search are all executed is named HFOA, the version that only the smell search is executed is named HFOAss, and the version that only the vision search is executed is named HFOAvs. 6 instances (RP01, PR05, PR10, PR11, PR15, and PR20) are tested. The average RPI for the 6 instances is 0.66% for HFOA, 1.89% for HFOAss, and 3.71% for HFOAvs. The RPI values are shown in Figure9. From the figure, we can see that the full version is significantly better than the others. The HFOAss is more effective than HFOAvs. The smell search executes the three strategies (T-re, T-sp, and W-sp) in turn and selects the best result to update the solution. On the contrary, the vision search is primarily responsible for exploitation, only T-sp and T-re are carried out, and whenever a better solution is found, the solution will be updated.Figure 9
Comparison of smell and vision strategies.


### 6.2.3. Effectiveness of Postoptimization

Furthermore, to verify the effectiveness of the postoptimization search, we carry out computational experiments to compare the HFOA with different postoptimization procedures. Figure10 shows the effect of the postoptimization procedure on the algorithm. It is clear from the comparisons that the hybrid procedure using 2-Opt and Or-Opt can produce significantly better results than other methods. The postoptimization procedures (2-Opt + Or-Opt) lead to a performance improvement of approximately 3.56%. Using a postoptimization algorithm alone, Or-Opt has a slight advantage over 2 -Opt.Figure 10
Comparisons of postoptimization.


## 6.2.1. Effectiveness of Initialization Method

Firstly, to certificate the effectiveness of the hybrid initialization method for the HFOA, the experiments are implemented to compare the hybrid initialization method with the other two methods. The two methods are NIH and random method, and the corresponding HFOAs with the two approaches are namedn-HFOA and r-HFOA. Six instances (PR01, PR05, PR10, PR11, PR15, and PR20) are selected for the test. The RPI results are shown in Table 2. It can be seen from Table 2 that the optimization results of n-HFOA are significantly better than the random method (r-HFOA), and the RPI is improved by 4.76% on average. The optimization results of the hybrid initialization method (HFOA) are better than the n-HFOA, with an average increase of 3.51%. This is because NIH can generate an initial solution with better quality, which helps the algorithm to locate promising regions within the large search space. And the random method can generate diversity distribution initial solution. Therefore, the hybrid initialization method is more effective and efficient.Table 2
Comparisons of the RPI values for different initialization methods.
HFOAn-HFOAr-HFOAPR010.934.928.23PR050.782.9610.27PR100.123.8011.71PR110.743.978.58PR150.663.699.91PR200.735.7010.88Avg.0.664.179.93To evaluate the parametersη1andη2, we implement another comparison experiment. 9 levels are set for η1 as shown in Table 3. As η1+η2=1, the η2 is not independent and then it is not listed in the table. From Table 3, when η1=0.5, the results are significantly better than other values. As for η1 and η2, moderate values are preferred that is because η1 and η2 determine the weight of travel time and service time. A too large η1 and a too small η2 may cause overfocusing on the travel time when inserting the new task in the route. On the contrary, a too small η1 and a too large η2 may cause overfocusing on the service time when inserting the new task in the route. According to the results of the experiment, the weight coefficient of NIH is set η1=0.5,η2=0.5.Table 3
Comparisons of the RPI values for differentη1 values.
η1PR01PR05PR10PR11PR15PR20Avg.0.13.312.633.193.622.172.832.960.22.111.192.563.282.792.442.400.31.541.882.051.891.671.851.810.41.751.490.651.481.511.731.440.50.930.780.120.740.660.730.660.61.130.840.210.710.930.910.780.71.341.891.122.071.631.771.630.81.832.451.682.511.912.112.080.92.162.422.652.162.672.922.50


## 6.2.2. Effectiveness of Fruit Fly Search Strategies

Secondly, we verified the effectiveness of the three search strategies presented above. The three search strategies were executed separately. The results of the RPI on the three search strategies are shown in Table4. It can be seen from the table that the results of T-sp are the best and the results of W-sp are the worst because W-sp mainly exchanges customers between the workers, although it can change the customers’ order, but more limited, relatively rough search. The ability of T-re is stronger than that of W-sp, and the optimization result of RPI is improved by 23.53% on average. T-re is like an insertion operator, and the search precision is better than that of W-sp. The T-sp operator has the strongest optimization ability in the three search strategies, which is 15.06% higher than the T-re, since T-sp operator does not only change the assignment of tasks between workers, but also changes the order of the tasks. It is like a 2-Opt operator that integrates between innerroutes and interroutes.Table 4
Comparisons of the RPI values for different search strategies.
T-spT-reW-spPR0113.9536.6756.05PR0518.2129.3051.71PR1011.3228.4157.87PR1119.3634.2648.63PR1518.0936.3261.76PR2016.0722.4452.58Avg.16.1731.2354.76Next, to compare the performance of the smell search and vision search, we carry out computational experiments to compare the HFOA with different search procedures. The full version that the smell search and vision search are all executed is named HFOA, the version that only the smell search is executed is named HFOAss, and the version that only the vision search is executed is named HFOAvs. 6 instances (RP01, PR05, PR10, PR11, PR15, and PR20) are tested. The average RPI for the 6 instances is 0.66% for HFOA, 1.89% for HFOAss, and 3.71% for HFOAvs. The RPI values are shown in Figure9. From the figure, we can see that the full version is significantly better than the others. The HFOAss is more effective than HFOAvs. The smell search executes the three strategies (T-re, T-sp, and W-sp) in turn and selects the best result to update the solution. On the contrary, the vision search is primarily responsible for exploitation, only T-sp and T-re are carried out, and whenever a better solution is found, the solution will be updated.Figure 9
Comparison of smell and vision strategies.


## 6.2.3. Effectiveness of Postoptimization

Furthermore, to verify the effectiveness of the postoptimization search, we carry out computational experiments to compare the HFOA with different postoptimization procedures. Figure10 shows the effect of the postoptimization procedure on the algorithm. It is clear from the comparisons that the hybrid procedure using 2-Opt and Or-Opt can produce significantly better results than other methods. The postoptimization procedures (2-Opt + Or-Opt) lead to a performance improvement of approximately 3.56%. Using a postoptimization algorithm alone, Or-Opt has a slight advantage over 2 -Opt.Figure 10
Comparisons of postoptimization.


## 6.3. Comparison with State-of-the-Art Algorithms

To verify the performance of the proposed algorithm, we compared the HFOA with the four algorithms: GRASP [9], genetic algorithm (GA) [15], the record-to-record travel algorithm (RTR) [22], and memetic algorithm (MA) [21]. The parameters for the GRASP, GA, RTR, and MA are set to the corresponding value according to the existing literature. The RPI values for the five algorithms are shown in Table 5. The best value is marked in bold. From the table, we can see that HFOA is significantly superior to the other four algorithms. The average RPI value of the HFOA is 0.57%, which is much lower than those four algorithms. Simultaneously, the HFOA performs the best for 18 out of 20 instances, except PR09 and PR19. The MA has an average RPI value of 1.63% and it is ranked second. Meanwhile, it gets the best result in PR09 and PR19. For the other three algorithms, the average RPI of GA is equal to 3.81%, and it is ranked third. The average RPI of GRASP and RTR are 8.51% and 11.21%. Based on the above analysis, we can conclude that HFOA has better performance than other algorithms.Table 5
Comparisons of HFOA with the state-of-the-art algorithms.
InstanceGRASPGARTRMAHFOAPR018.064.478.072.450.93PR027.113.237.852.020.25PR037.325.9410.611.470.74PR049.812.4710.831.410.67PR0510.32.0812.791.950.78PR065.581.469.501.780.94PR078.192.599.241.750.19PR0811.424.089.292.530.95PR0910.924.9210.870.550.64PR1010.796.2511.851.710.12PR113.563.5513.791.030.74PR1210.674.649.041.220.23PR137.834.5615.630.910.61PR1410.913.6211.771.530.79PR156.891.5516.751.960.66PR164.764.3110.851.360.45PR175.315.0512.081.530.17PR188.634.4812.521.720.02PR1913.124.849.010.780.87PR208.912.0611.952.950.73Avg.8.513.8111.211.630.57


## 6.4. Application to Solve Vehicle Routing Problem with Time Windows

Furthermore, to verify the ability of HFOA to solve the NP-hard problem, the well-known combined optimization problem vehicle routing problem with time windows is provided in this section. The dataset including 56 Solomon instances with 100 customers is tested in the experiments. These instances are categorized into six different categories: R1, R2, C1, C2, RC1, and RC2. Each category contains R which indicates that customers are distributed randomly, C categories are clustered, and RC means customers are distributed both randomly and clustered. Moreover, the R1, C1, and RC1 instances have narrower time windows for the depot and all customers are associated with very tight time windows. By contrast, the R2, C2, and RC2 instances have a long scheduling horizon that permits many customers to be serviced by the same vehicle, and the time windows defined for the customers are wider.All instances are repeatedly solved 20 times. The HFOA results are compared to those obtained by other algorithms in the literature. We select six state-of-the-art algorithms that have obtained the best results. These algorithms include the following: genetic algorithm and set partitioning (CGH) [47], genetic algorithm (GA) [48], hybrid ant colony with tabu search (ACOT) [49], a multiadaptive particle swarm optimization (MAPSO) [50], adaptive harmony search algorithm (AHSA) [51], and a probabilistic tabu search (TS) [52]. The RPI values of the six algorithms and HFOA over all tested instances are presented and compared in Table 6. The best-known results of average total distances (TD) for each category also are reported. The results tabulated in Table 5 show that HFOA achieved competitive results compared to others, among the total 7 heuristics, HFOA is ranked second. The proposed algorithm can achieve the solutions close to the best-known solutions for the cluster problem sets C1 and C2. Moreover, HFOA can obtain comparable solutions for the problem sets R1, R2, RC1, and RC2 compared with other metaheuristics.Table 6
Comparison of the HFOA with the state-of-the-art methods.
DatasetBest (TD)CGH (%)GA (%)ACOT (%)MAPSO (%)AHSA (%)TS (%)HFOA (%)R11156.362.345.504.914.645.204.584.31R2877.202.5912.378.568.5311.0011.757.84C1826.700.202.951.840.201.010.200.91C2589.240.115.243.990.116.990.110.22RC11338.180.262.135.793.443.243.812.96RC21003.951.1910.4111.6011.5210.1711.308.68Avg.965.271.116.436.114.746.275.294.15To compare the convergence speed with the state-of-the-art algorithms, the average computational time is reported in Table7. We report the average running time in seconds. The best computational times are highlighted in bold font. It is noted that the CGH and GA do not report the runtime for each category and only provide the total average computational time; TS does not report the running time. CGH and TS also do not report the CPU type. As can be seen from the table, the computational time of HFOA is very competitive with CGH, GA, ACOT, and AHSA. Furthermore, we could observe that the algorithm converges faster in the clustered instances. Considering the tradeoff of quality and computation time, HFOA is the competitive approach among the seven methods.Table 7
The computational time (average) of the state-of-the-art methods.
R1R2C1C2RC1RC2Avg.CGH——————3600.00GA——————835.00ACOT698.00655.00210.00142.00317.00407.00404.83MAPSO22.5822.0418.5519.5523.4321.5821.29AHSA64.32635.09108.14141.54109.88442.07250.17TS———————HFOA118.90123.6798.8495.16123.20131.37115.19CPU type: CGH-; GA: Intel Pentium II 266 MMX; ACOT: Intel Pentium 1000 MHz; MAPSO: Intel Core i5 2430M@ 2.40 GHz; AHSA: Intel Xeon 2.8 GHz; TS-; HFOA: Intel Core i5 2450M@2.50 GHz.


## 7. Conclusion

In this paper, we research the field service scheduling problem with customer satisfaction. The customer satisfaction that considered customer behavioral features is described based on the prospect theory. It provides a new way to describe customer satisfaction. The mathematical model for FSSP with customer satisfaction is presented. To solve the NP model, the knowledge of the insertion feasibility on the solution is research. And an effective HFOA is proposed for the model. Based on the prior knowledge of the FSSP and endowment of the Fruit Fly Optimization Algorithm, a novel encoding method based on matrix is proposed for HFOA. To improve the solution quality, an effective nearest neighbour insertion heuristic is developed to generate the initial solution. Additionally, three search strategies and postoptimization procedure are applied to the HFOA.To verify the ability of HFOA, the well-known VRPTW dataset including 56 Solomon instances with 100 customers is tested in the experiments. The results illustrate that the HFOA algorithm provides excellent results compared to the other six metaheuristic methods. The proposed HFOA is also successfully applied to FSSP. The comparisons verified the effectiveness of the developed heuristic and search strategies. Through comparison with the other four algorithms, the results show that the proposed HFOA is an effective and efficient method to solve the FSSP. Although this work is presented in terms of FSSP with customer satisfaction, the main idea of the HFOA could also be applied to many other FSSP problems such as dynamic task arriving and dynamic road network information, and we will extend the HFOA to these problems in the future research.



---

*Source: 8571524-2021-02-03.xml*