Particle Swarm Optimization and an Agent-Based Algorithm for a Problem of Staff Scheduling Maik G¨ unther and Volker Nissen Ilmenau University of Technology, Information Systems in Services, D-98684 Ilmenau
[email protected],
[email protected]
Abstract. Eight problems of a practical staff scheduling application from logistics are used to compare the effectiveness and efficiency of two fundamentally different solution approaches. One can be called centralized and is based on search in the solution space with an adapted metaheuristic, namely particle swarm optimization (PSO). The second approach is decentralized. Artificial agents negotiate to construct a staff schedule. Both approaches significantly outperform todays manual planning. PSO delivers the best overall results in terms of solution quality and is the method of choice, when CPU-time is not limited. The agent approach is vastly quicker in finding solutions of almost the same quality as PSO. The results suggest that agents could be an interesting method for real-time scheduling or re-scheduling tasks. Keywords: staff scheduling, sub-daily planning, particle swarm optimization, multi-agent system, combinatorial optimization.
1
Introduction
Employees spend up to 36% of their working time unproductively, depending on the branch [14]. Major reasons include a lack of planning and controlling. Staff scheduling assigns employees to workstations subject to constraints. In practice, planning often takes place based on prior experience or with the aid of spreadsheets [1]. It is obvious that demand-oriented staff scheduling cannot be realised with these planning tools. Even with popular staff planning software employees are regularly scheduled for one workstation per day. However, in many branches, such as logistics and trade, the one-employee-one-station concept does not correspond to the actual requirements and sacrifices potential resources. Intra-day variations in demand require more flexible changes of employees among workstations. Therefore, sub-daily planning should be an integral component of demand-oriented staff scheduling. Staff scheduling is a hard optimization problem. Garey and Johnson [6] demonstrate, that even simple versions of staff scheduling problems are NP-complete. Kragelund and Kabel [10] show the NP-hardness of the general employee timetabling problem. According to Puppe et al. [15], centralized scheduling approaches are difficult to employ successfully. In this paper we investigate whether C. Di Chio et al. (Eds.): EvoApplications 2010, Part II, LNCS 6025, pp. 451–461, 2010. c Springer-Verlag Berlin Heidelberg 2010
452
M. G¨ unther and V. Nissen
this is actually true for sub-daily staff scheduling problems, which are typical for industries such as trade and logistics as well as call centers. A centralized metaheuristic approach that utilizes Particle Swarm Optimization (PSO) is compared to a decentralized multi-agent approach. PSO was chosen because in previous tests it outperformed other heuristics, namely evolution strategies [12] and Local Search [16] on the given test problems. Multiple artificial agents, on the other hand, are a promising way to achieve decentralized problem solving. In the following section, we describe the practical planning scenario from logistics before we discuss work related to our own research in Section 3. Section 4 presents the two solution methods based on PSO and artificial agents. The experimental setup and empirical results are presented and discussed in Section 5. The paper concludes with a short summary.
2
A Real-World Problem from Logistics
Due to the given page limit the problem can not decribed in detail here. For a compehensive description and a mathematical representation see [12]. And for real-world data sets and benchmarks see [16]. The present problem originates from a German logistics service provider where the task is to find a staff schedule that respects certain hard constraints and minimizes the violation of soft contraints. An example of a hard constraint is that any one employee must only be assigned to one workstation at a time. An example of a soft constraint would be the avoidance of understaffing. The violation of soft constraints is penalized with error points that reflect the companys requirements. The objective is to minimize the total count of error points. Ernst et al. offer a summary of papers related to the issue of staff scheduling [5]. They identify certain categories of problems, such as flexible demand. Our application can be classified as this category and additionally as task assignment. The tasks of employees concern logistic services e.g. loading and unloading or short distance transportation. The employees are quite flexible in terms of their working hours, which results in 13 different working-time models. There are strict regulations with regard to qualifications, because the assignment of unqualified employees might lead to significant damage. Many employees can work at several different workstations. Currently, monthly staff scheduling is carried out manually within MS EXCELTM . Employees are assigned a workingtime model and a fixed workstation each day. Several considerations are included, such as absence, timesheet balances, qualifications and resting times etc. The personnel demand for each workstation is subject to large variations during the day, causing large phases of over- and understaffing. This lowers the quality of service and the motivation of employees and leads to unnecessary personnel costs as well as downtime. We investigate a total of 8 problem instances associated with this practical case: planning for the full week as well as planning each of the seven days individually. The full week problem covers seven days (20 hours each), divided into 15-minute intervals. It includes 65 employees and, thus, an uncompressed total
PSO and an Agent-Based Algorithm for a Problem of Staff Scheduling
453
of 36,400 dimensions for the optimization problem to be solved. The general availability of the employees (based on working-time models) is known for each interval from the previous full-day planning and must not be changed. Nine different workstations need to be filled. Planning the individual days is less complex with 80 time slots and between 38 and 46 employees to be considered. The demand schemes vary significantly for different days so that a representative spectrum of the real-world situation is given in the problem instances. A solution is represented as a two-dimensional matrix of employees and time periods, where the cells are filled with workstation assignments (Table 1). To mark times, in which an employee is not present due to his work-time model, workstation 0 is used. For example, employee two is absent in the first period and then is assigned to workstation 2. Assignment changes can only be made to cells of available employees. Table 1. Assignment of workstations in a matrix
employee 1 2 3 ...
3
1 1 0 0
2 1 2 1
period 3 4 5 1 1 1 2 2 2 1 2 2
6 ... 1 2 2
Related Work
Poli analysed the IEEE Xplore database for the thematic grouping of PSO applications in 2007 [13]. Of approximately 1,100 publications only one work is focused specifically on timetabling [3], which is related to our own application problem. Chu et al. adjust PSO to the combinatorial domain [3]. No longer is the position of a particle determined by its speed, but rather by using permutation operators. Brodersen uses this concept for a related problem of university timetabling [2]. In a different paper, we compare heuristics based on PSO and evolution strategies (ES) for the current problem set. PSO outperforms ES on a statistically significant level [12]. Moreover, PSO also shows better performance than local search [16]. It is this PSO-implementation (with a repair heuristic added) that we compare to a multi-agent approach here. In [7] various neighbourhood topologies are tested for the same problems with a gBest topology, where each particle is a neighbour of every other particle, performing best. Puppe et al. [15] present two concepts for artificial agents on scheduling in hospitals. In the resource-oriented view each resource or the associated organizational unit is represented as an agent. This concept is more applicable, when the problem is static. In the patient-oriented view, an agent is created for every patient examination, which is more adapted to dynamical problems.
454
M. G¨ unther and V. Nissen
Krempels [11] also creates a staff schedule by using agents. The agent approach is divided in several phases. Initially a planner agent creates a plan ignoring staff preferences. Thereafter, the planner tries to improve the plan by incorporating preferences. A knowledge tank stores all relevant aspects of the resources. In case of a conflict, an agent is created for each staff member, followed by a negotiation phase. De Causemaecker et al. [4] make comments on negotiation schemes for course timetabling. Only necessary information should be exchanged among agents. Moreover, a negotiation process should not take exceedingly long.
4 4.1
PSO and Artificial Agent Approach PSO for This Application
The basic principles of PSO were developed by Kennedy and Eberhart among others [8], [9]. Swarm members are assumed to be massless, collision-free particles, that search for optima with the aid of a fitness function within a solution space. In this process, each single particle together with its position embodies a solution to the problem. While looking for the optimum, a particle does not simply orient itself using its own experience, but also using the experience of its neighbours. The particles exchange information, which can then positively influence the development of the population in the social system as a whole. The following pseudocode presents an overview of the implemented PSO. Here, pBest represents the best position found so far by the particle while gBest corresponds to the best position of all particles globally. 01: 02: 03: 04: 05: 06: 07: 08: 09: 10: 11: 12:
initialise the swarm evaluate the particles of the swarm determine pBest for each particle and gBest loop for i = 1 to number of particles calculate new position // use the 4 alternative actions repair the particle evaluate the particle if f(new position) 0, as compared to the initial plan. This, however, is sensible because employees can still support each other instead of being idle when demand = 0. PSO provides the best results with a rather small swarm size of 10 particles, but also larger swarm sizes produce good results. Many steps are required to arrive at a good schedule. Thus, it seems preferable to track changes for more iterations as compared to a higher diversity through larger population or swarm size with the current termination criterion.
PSO and an Agent-Based Algorithm for a Problem of Staff Scheduling
459
The results from the multi-agent system are quite close to the schedules created by PSO. With 30 independent runs for each heuristic it is possible to test the performance difference of the best parameterisation of PSO (swarm size 10) and the multi-agent approach for statistical significance with a t-test (see Table 3). A Levene-test revealed the heterogeneity of variances (test level 5%) between both groups (F = 6.585, p = 0.013). The corresponding t-test with a 95% confidence interval confirms the better performance of PSO (10) with a very high statistical significance (p < 0.001 for H0 ). An advantage of the multi-agent system, alongside the low CPU-requirements, is the relative simplicity of its scheduling strategy. While it is hard for a staff planner to grasp what is really happening during optimization with PSO, the acceptance for the agent-derived solution is likely to be far higher, since the individual steps of the planning and negotiation procedure are relatively straightforward and familiar for staff managers. The importance of this comprehensibility for the acceptance of the resulting schedule should not be underestimated. The agent approach does not violate qualification constraints and over- as well as understaffing are reduced to the possible minimum as found by PSO. It is only the number of sub-daily workstation rotations that is greater in the solutions produced by the multi-agent system. To achieve an improved solution quality, an extended re-scheduling and swapping of assignments would have been required. It must consider more than two staff members in parallel as well as large parts of the planning horizon. This is beyond what is possible through oneto-one negotiation of a staff agent with the service agent or other staff agents. It can only be achieved with the aid of a central planning instance, that partly ignores the individual preferences of agents for a better overall result of the entire schedule. Such a central planning instance, however, is not in line with the distributed negotiation and decision scheme that is generally associated with multi-agent systems. The multi-agent and PSO approaches were also tested on the smaller problem sets, representing the individual days of the week. Table 4 shows the respective mean errors (based again on 30 runs) for each day. The relative performance is similar to the more complex week problem discussed before, supporting our previous conclusions. Two forms of hybridization of the agent approach with PSO were tested, but both could not improve upon the results for the ”pure” approaches presented above. First, our additional experiments indicated, that initializing the PSO start solutions with the help of the multi-agent system leads to premature conTable 4. Mean results for individual days of the week problem (30 runs each). Best results are bold and underlined. PSO (10) PSO (20) PSO (100) Agents
Mo 7712 7726 7725 7727
Tu 5900 5910 5909 5917
We 8161 8171 8170 8183
Th 8248 8257 8255 8272
Fr 5500 5508 5508 5528
Sa 8838 8846 8844 8861
So 7330 7325 7325 7337
460
M. G¨ unther and V. Nissen
vergence. The swarm is not sufficiently diversified from the beginning and the particles are already in a very good local optimum, such that further progress is extremely difficult. Second, trying to use PSO as an individual optimization strategy for staff agents was also not successful, since it is relatively straightforward how individual agents can improve their situation through negotiation. (If an employee wants to remove his workstation rotation at time t, then his staff agent negotiates with other staff agents whether he can work at the workstation he occupies at t-1 or t+1.) The same applies to the strategy of the scheduling agents. Thus, so far the experimental results indicate, that hybridization of PSO and the agent-based scheduling approach is not a fruitful strategy in our domain.
6
Conclusion and Future Work
Using complex, high-dimensional and highly constrained planning scenarios, it was demonstrated, that PSO (as a rather centralized approach) and artificial agents (a constructive and decentralized approach) produce far better results than today’s spreadsheet-based full day scheduling. Thus, sub-daily scheduling significantly increases the value contributions of individual staff members. Because PSO in its traditional form is not suitable for the planning problems at hand, the method was adapted to the combinatorial domain without sacrificing the basic PSO mechanism. Based purely on solution quality, the PSO approach has a slight advantage over the agent approach and should, thus, be favored when runtime is not a seriously limiting factor for optimization. In our practical applications this is the case. This success of PSO contradicts Puppe et al. [15] who suggest that centralized scheduling methods are likely to fail due to the many constraints and complexity of the task. The multi-agent approach is vastly quicker in finding solutions of almost the same quality as PSO. Multi-agent systems have rarely been shown to be competitive with modern metaheuristics. Moreover, the results suggest, that artificial agents could be useful for real-time scheduling or re-scheduling tasks where runtime for the optimization is usually very limited. Investigations of seven easier versions of the same application problem were undertaken, in which similar results were achieved. In order to base the conclusions of this work on a wider foundation, the investigations done here are currently extended to a practical problem from the trade domain, which is even more extensive with respect to dimensions and constraints.
References 1. ATOSS Software AG, FH Heidelberg (eds.): Standort Deutschland 2006. Zukunftssicherung durch intelligentes Personalmanagement. M¨ unchen (2006) 2. Brodersen, O.: Eignung schwarmintelligenter Verfahren f¨ ur die betriebliche Entscheidungsunterst¨ utzung. Cuvillier, G¨ ottingen (2008) 3. Chu, S.C., Chen, Y.T., Ho, J.H.: Timetable Scheduling Using Particle Swarm Optimization. In: Proc. of ICICIC 2006, vol. 3, pp. 324–327 (2006)
PSO and an Agent-Based Algorithm for a Problem of Staff Scheduling
461
4. De Causemaecker, P., Ouelhadj, D., Vanden Berghe, G.: Agents in Timetabling Problems. In: Proc. of MISTA 2003, pp. 67–71 (2003) 5. Ernst, A.T., et al.: An Annotated Bibliography of Personnel Scheduling and Rostering. In: Annals of OR, vol. 127, pp. 21–144 (2002) 6. Garey, M.R., Johnson, D.S.: Computers and Intractability. In: A Guide to the Theory of NP-Completeness. Freeman, New York (1979) 7. G¨ unther, M., Nissen, V.: A Comparison of Neighbourhood Topologies for Staff Scheduling With Particle Swarm Optimisation. In: Mertsching, B., Hund, M., Aziz, Z. (eds.) KI 2009. LNCS (LNAI), vol. 5803, pp. 185–192. Springer, Heidelberg (2009) 8. Kennedy, J., Eberhart, R.C.: Particle Swarm Optimization. In: Proc. of IEEE Int. Conf. on Neural Networks,, pp. 1942–1948 (1995) 9. Kennedy, J., Eberhart, R.C., Shi, Y.: Swarm Intelligence. Kaufmann, San Francisco (2001) 10. Kragelund, L., Kabel, T.: Employee Timetabling. An Empirical Study. Master’s Thesis, Dep. of Computer Science, Univ. of Aarhus (1998) 11. Krempels, K.H.: L¨ osen von Scheduling-Konflikten durch Verhandlungen zwischen Agenten. In: Sauer, J. (ed.) Proc. of PuK 2002, pp. 86–89 (2002) 12. Nissen, V., G¨ unther, M.: Staff Scheduling with Particle Swarm Optimization and Evolution Strategies. In: Cotta, C., Cowling, P. (eds.) EvoCOP 2009. LNCS, vol. 5482, pp. 228–239. Springer, Heidelberg (2009) 13. Poli, R.: An Analysis of Publications on Particle Swarm Optimization. Report CSM-469, Dep. of Computer Science, Univ. of Essex (2007) 14. Proudfoot Consulting: Produktivit¨ atsbericht 2007. Company Report (2007) 15. Puppe, F., Kl¨ ugl, F., Herrler, R., Kirn, S., Heine, C.: Konzeption einer flexiblen Agentenkomponente f¨ ur Schedulingaufgaben im Krankenhausumfeld. In: Proc. of 2. Kolloquium Intelligente Softwareagenten und betriebswirtschaftliche Anwendungsszenarien (2000) 16. Sub-Daily Staff Scheduling Data Sets and Benchmarks, http://www.tu-ilmenau.de/fakww/2608+M54099f70862.0.html