Workforce Planning with a Parallel Genetic Algorithm Enrique Alba
Manuel Laguna
Gabriel Luque
Dept. de Lenguajes y Ciencias de la Computación ETS Ingeniería Informática Univ. de Málaga 29071 Málaga
[email protected]
Leeds School of Business, University of Colorado Boulder, USA
[email protected]
Dept. de Lenguajes y Ciencias de la Computación ETS Ingeniería Informática Univ. de Málaga 29071 Málaga
[email protected]
Abstract A workforce planning problem is formulated here as a mixed-integer program and then solved with Cplex. Our experiments show that Cplex is capable of solving to optimality of near optimality small “structured” problem instances but it fails to solve those considered “unstructured”. We describe the development of a parallel genetic algorithm capable of finding high-quality solutions to both structured and unstructured problem instances. Additional enhancements to the genetic algorithm are necessary to improve upon competitive approaches to solving the problem at hand.
1. Introduction Decision making associated with workforce planning results in difficult optimization problems because it involves multiple levels of complexity. The workforce planning problem that we tackle in this paper consists of two sets of decisions: selection and assignment. The following description of the problem is taken from Glover, et al. [3]. A set of jobs J = {1, …, m} must be completed during the next planning period (e.g., a week). Each job j requires dj hours during the planning period. There is a set I = {1, …, n} of available workers. The availability of worker i during the planning period is si hours. For reasons of efficiency, a worker must perform a minimum number of hours (hmin) of any job to which he/she is assigned and, at the same time, no worker may be assigned to more than jmax jobs during the planning period. Workers have different skills, so Ai is the set jobs that worker i is qualified to perform. No more than t workers may be assigned during the planning period. In other words, at most t workers may be chosen from the
set I of n workers and the subset of selected workers must be capable of completing all the jobs. The objective is to find a feasible solution that optimizes a given objective function. We use the cost cij of assigning worker i to job j to formulate the optimization problem associated with this workforce planning situation as a mixed-integer program. We refer to this model of the workforce planning problem as WPP:
xij
1 ® ¯0
if worker i is assigned to job j otherwise
yi
1 ® ¯0
if worker i is selected otherwise
zij = number of hours that worker i is assigned to perform job j Qj = set of workers that are qualified to perform job j
¦ ¦c
Minimize
ij x ij
(1)
iI j Ai
Subject to
¦z
ij
d si y i
iI
(2)
¦z
ij
tdj
jJ
(3)
d jmax yi
iI
(4)
i I, j Ai
(5)
j Ai
iQ j
¦x
ij
j Ai
hmin xij d zij d si xij
912
Metaheurísticas Paralelas
¦y
i
dt
(6)
iI
xij {0, 1} yi {0, 1} zij t 0
i I, j Ai iI i I, j Ai
In the model above, the objective function (1) minimizes the total assignment cost. Constraint set (2) limits the number of hours for each selected worker. If the worker is not chosen, then this constraint does not allow any assignment of hours to him/her. Constraint set (3) enforces the job requirements, as specified by the number of hours needed to complete each job during the planning period. Constraint set (4) limits the number of jobs that a chosen worker is allowed to perform. Constraint set (5) enforces that once a worker has been assigned to a given job, he/she must perform such a job for a minimum number of hours. Also, constraint (5) does not allow the assignment of hours to a worker that has not been chosen to perform a given job. Finally, constraint set (6) limits the number of workers chosen during the current planning period. The same model may be used to optimize a different objective function. Let cˆij be the cost per hour of worker i when performing job j. Then, the following objective function minimizes the total assignment cost (on hourly basis): Minimize
¦ ¦ cˆ
ij z ij
(7)
iI j Ai
Alternatively, pij may reflect the preference of worker i for job j, and therefore, the following objective function maximizes the total preference of the assignment: Maximize
¦¦p
ij x ij
(8)
iI j Ai
When preference values are used, other objective functions may be formulated. For instance, it may be desirable to maximize the minimum preference value for the set of selected workers. In this paper, we assume that the decision maker wants to minimize the total assignment cost as calculated in (1).
As pointed out in [6], this problem is related to the capacitated facility location problem (CFLP) as well as the capacitated p-median problem [1,5]. In fact, our location-allocation problem reduces to a CFLP if the complicating constraints (4)-(6) are relaxed in a Lagrangean manner. In the context of the CFLP, implied bounds are typically added to strengthen the linear programming (LP) relaxation of the mixed-integer programming formulation. The equivalent bounds for the WPP formulation are: xij – yi 0
i I, j Ai
(9)
Also in the case of the CFLP, an aggregate capacity constraint is usually added to the problem formulation in order to improve some Lagrangean bounds. Even in the case of an LP approach this surrogate constraint can be helpful; it can be used for generating possibly violated lifted cover inequalities. The form of such a constraint for the WPP model is:
¦s y t ¦d i
iI
i
j
(10)
jJ
The difficulty of solving instances of WPP with an optimization code based on branch-andbound is related to the relationship between hmin and dj. In particular, problem instances for which dj is a multiple of hmin (referred to as “structured”) are easier to handle than those for which dj and hmin are unrelated (referred to as “unstructured”). We show the performance of a commercial branch-and-bound solver on structured and unstructured problem instances. We also study the effect of adding the implied bounds (9) and the aggregate capacity constraint (10). In the next section, we describe the development of a parallel GA (PGA) for the solution of WPP. The development of the PGA has the goal of providing a tool for finding highquality solutions to structured and unstructured instances of the WPP of realistic size.
2. Genetic Algorithm The genetic algorithm [4] that we have developed for the solution of the WPP follows the basic structured shown in Figure 1.
IV Congreso Español sobre Metaheurísticas, Algoritmos Evolutivos y Bioinspirados, MAEB2005 913 Generate (P(0)) t := 0 while not Termination_Criterion(P(t)) do Evaluate(P(t)) P’(t) := Selection(P(t)) P’(t) := Recombination(P’(t)) P’(t) := Mutation(P’(t)) P(t+1) := Replace(P(t), P’(t)) t := t+1 return Best_Solution_Found
2.3. Repairing/Improving Operator The purpose of this operator is to repair trial solutions in such a way that they either become feasible with respect to the original problem or the infeasibility of these solutions is reduced. The operator performs the 4 steps outlined in Figure 2. 1. 2.
Figure 1. Basic GA structure
Within the basic structure of Figure 1, we have added context information through a special solution representation and crossover operators with improving and repairing mechanisms. 2.1. Representation Solutions are represented as an num matrix Z, where zij represents the number of hours that worker i is assigned to job j. In this representation, a worker i is considered to be assigned to job j if zij > 0. Therefore the following relationships are established from the values in Z.
x ij
1 ® ¯0
z ij ! 0 otherwise
yi
1 ° ® °¯0
¦z
ij
!0
j Ai
otherwise
2.2. Solution Evaluation Solutions are evaluated according to the objective function (1) plus a penalty term. The additional term penalizes violations of constraints (2), (3), (4) and (6). The penalty coefficients that are multiplied by the constraint violations are p2, p3, p4 and p6, respectively. Before the fitness value is calculated, new trial solutions are subjected to a repairing/improving operator that makes sure that constraint (5) is satisfied. This operator also ensures that no worker is assigned to a job that he/she is not qualified to perform.
3. 4.
Eliminate violations with respect to hmin Eliminate violations with respect to assignments of unqualified workers Load feasible workers Reduce infeasibility Figure 2. Repairing/improving operator
The first step of this operator repairs solutions with respect to the minimum number of hours that a worker must work on any assigned job. The repair is done only on those qualified workers that are not meeting the minimum time requirement. In mathematical terms, if 0 < zij < hmin for i I and j Ai, then zij = hmin. The second step takes care of assignments of workers to jobs for which they are not qualified to perform. A value of zero is given to the corresponding entry in Z. Using our notation, if zij > 0 for i I and j Ai, then zij = 0. The third step considers that a worker is feasible if he/she satisfies constraints (2) and (4). This step attempts to use up the capacity slack of feasible workers. The slack time for worker i (i.e.
si
¦z
ij
) is equally divided among his/her
j Ai
current job assignments. This allows for a higher utilization of the workers that are currently assigned to jobs and thus facilitating the satisfaction of constraint (6). The last step starts with a partial order of the workers in such a way that the most infeasible ones (with respect to constraints (2) and (4)) tend to appear at the top of the list. This is not a complete order because the operator counts on certain amount of randomness for this step. Once the partial order is established, a process of reducing the infeasibility of workers is applied. The process of reducing the violation of constraints (2) and (4) is such that it guards against new violations of constraints (3) and (5).
914
Metaheurísticas Paralelas
2.4. Crossover Operator A special crossover operator has been designed for the solution of WPP. The operator employs a parameter Uc that may be interpreted as the probability that two solutions exchange their current assignments for worker i. The process is summarized in Figure 3. for (i = 1 to n) do if rand() Uc then for (j = 1 to m) do
z 1ij l z ij2 endfor endif endfor Figure 3. Crossover operator
Given two solutions Z1 and Z2, the crossover operator in Figure 3 selects, with probability Uc, a worker i. If the worker is selected, then the job assignments of solution Z1 are exchanged with the assignments of solution Z2. The rand() function in Figure 3 generates a uniform random number between 0 and 1. 2.5. Mutation Operator In addition to the crossover operator described above, our GA implementation includes a mutation operator. This mechanism operates on a single solution by exchanging the job assignments of two workers. The job exchange occurs with probability Um, as shown in Figure 4. for (i = 1 to n) do for (j Ai) do k = random worker|k z i and k Qj if rand() Um then
z ij l z kj endif endfor endfor Figure 4. Mutation operator
Given a solution Z, the mutation operator considers all workers and jobs that the workers are qualified to perform. A random worker k is
chosen from the list of qualified workers and the exchange of job assignments is considered. As before, the rand() function returns a uniform random number between 0 and 1. 2.6. Parallel Version A parallel GA (PGA) [2] is a procedure that consists of multiple copies of an implementation (typically serial) of a genetic algorithm. The individual GA’s include an additional communication phase that enables them to exchange information. A PGA is characterized by the nature of the individual GAs and the type of communication that is established among them. Our particular implementation is a distributed GA (dGA), which allows for an efficient exploitation of machine clusters. Typically, dGAs consist of a small number of independent GAs that periodically exchange information. Each individual GA operates on a considerably large population. To fully characterize a dGA, the migration policy must be established, which is related to the topology of the set of individual GAs. The policy dictates when migration occurs, the number and identity of the individuals that will be exchanged and also determines the synchronization scheme. Our implementation uses a unidirectional ring topology, where each GA receives information from the GA immediately preceding it and sends information to the GA that is immediately after it.
3. Computational Experiments In order to test the merit of the procedure, we generated artificial instances. Given the values of n, m, problem instances were generated following characteristics:
proposed problem and t the with the
si = U(50, 70) jmax = U(3, 5) hmin = U(10, 15) Category of worker i = U(0, 2) P(i Qj) = 0.25 * (1 + Category of worker i)
dj
§ § s * t 1.5 * s * t · · max¨¨ hmin , U ¨ , ¸ ¸¸ m © 2*m ¹¹ ©
IV Congreso Español sobre Metaheurísticas, Algoritmos Evolutivos y Bioinspirados, MAEB2005 915
¦s where
s
i
n
¦d
i
and
j
s *t
j
d Į.
cij = |Ai| + dj + U(10, 20) The generator establishes a relationship between the flexibility of a worker and his/her corresponding cost. That is, workers that are able to perform more jobs are more expensive. In our first experiment, we test the merit of adding the implied bounds (9) and the aggregate capacity constraint (10) to the original formulation of the WPP. We use Cplex 8.0 on a Pentium 4 machine at 2.53 GHz to solve twenty structured and unstructured problems. The ten unstructured problems were generated with the following parameter values: n = 20 m = 20 t = 10 D = 0.97 Note that the problem generator uses D as the limit for the expected relative load of each worker. The set of ten structured problems was constructed using the same parameter values but hmin was set to 4 and the dj values were adjusted as follows:
time is the CPU seconds required to find the upper bound. The columns under Modified Model report the values related to a Cplex execution for the WPP model with the implied bounds. The default Cplex parameter values were used for all the runs and no priority or preferred branching directions were given to any of the variables in the model. The time limit was set to 1 CPU hour. Table 1. Cplex results for structured problems. Original Model Prob.
UB
1
Modified Model
Time
UB
855
205
855
450
2
899
64
899
307
3
980
0.94
3196
979
4
935
2
935
1004
5
961
1.62
3019
957
2965
6
968
631
968
366
7
904
950
904
639
8
994
4.88
402
988
4.04
9
931
6.00
1621
926
5.31
10
866
283
866
Gap
Time
0.84
743
2772 1113 2145
Table 2. Cplex results for unstructured problems.
dj = dj – mod(dj, 4) where mod(x,y) calculates the remainder of x/y. All twenty instances were generated in such a way that a single value for the total number of available hours (si) is drawn and assigned to all workers. This makes the addition of constraint (10) unnecessary given that all subsets of t workers are guaranteed to provide enough capacity to satisfy the total demand. Tables 1 and 2 summarize the results of our first experiment with structured and unstructured problem instances, respectively. The columns under Original Model show the upper bounds (UB), optimality gap (Gap) and solution time (Time) associated with solving the WPP model with Cplex. Optimality gaps are reported as a percent deviation from the best lower bound available at the end of the search. If no gap is reported, it means that the optimal solution was found before the time limit was reached. Solution
Gap
Original Model
Modified Model
Prob.
UB
Gap
Time
UB
Gap
Time
1
1215
27.27
2756
956
8.46
2481
2
1039
11.52
1380
939
2.97
1039
3
1151
14.79
1889
1071
7.82
3404
4
1228
22.63
2668
1026
8.34
2866
5
1093
15.01
1096
1047
9.69
974
6
1083
11.12
2131
1091
13.03
159
7
995
8.35
3175
941
5.05
3514
8
1009
14.25
3509
906
4.34
2449
9
890
4.46
270
844
142
10
913
5.29
2043
887
916
The results in Tables 1 and 2 reveal the advantage of adding the implied bounds (9) to the
916
Metaheurísticas Paralelas
original model. All upper bounds improve when solving the modified model. An additional confirmed optimal solution is found for the structured problems (see problem 5 in Table 1) and two confirmed optimal solutions are found for the unstructured problems (see problems 9 and 10 in Table 2). These tables do not give conclusive evidence regarding the time required to find the best upper bounds (or optimal solutions) with the two different models. In our second set of experiments, we test the performance of our PGA. The parameter values used to perform these tests were: p2 = 50 p3 = 50 p4 = 200 p6 = 800 Uc = 0.8 Um = 0.2 The first four parameters are the penalty coefficients of the fitness functions, while Uc and Um are the probabilities of the crossover and mutation operators, respectively. These values were selected after preliminary experimentation. Table 3. GA results for structured problems. PGA
Seq. GA 4 islands Prob.
Best
Time
Best
Time
8 islands Best
Time
1
951
61.34
873
12.97
867
7.21
2
987
41.25
934
9.72
901
5.88
3
1092
111.5
987
28.82
994
13.39
4
1103
87.51
990
22.03
937
11.76
5
1015
40.15
988
13.8
964
11.57
6
1101
114.3
1002
33.52
988
18.91
7
1047
49.85
918
16.15
918
7.35
8
1173
42.7
1037
11.39
1001
6.95
9
1052
67.6
935
20.45
969
12.67
10
1003
102.20
883
28.85
876
14.91
Table 4. GA results for unstructured problems (an asterisk indicates that the best solution found is infeasible).
Seq. GA
PGA 4 islands
Prob.
8 islands
Best
Time
Best
Time
Best
Time
1
1467*
95.12
1244*
27.92
1186
14.81
2
1173
87.82
1044
27.31
1065
10.03
3
1372*
51.71
1127
14.31
1181
6.09
4
1439*
79.2
1222
24.05
1187
15.56
5
1222
57.18
1122
18.26
1127
8.62
6
1135
105.38
1162
19.21
1066
13.09
7
1152
79.87
1083
21.28
1037
12.69
8
1020
119.97
1089
22.45
1032
14.72
9
1044
72.16
932
23.53
898
13.61
10
1092
95.12
1085
20.83
903
12.15
Tables 3 and 4 summarize the results of the GA experiments with structured and unstructured problem instances, respectively. These tables show the best solution found (Best) and the execution time (Time) of a sequential GA and two parallel GAs (with four and eight islands). Several conclusions can be drawn from these tables. First, there is a significant improvement of the parallel versions over the sequential version in both solution quality and time to best. Comparing against the Cplex results (Tables 1 and 2), we observe that the PGAs are capable of reducing the time to finding the best solution, however these solutions are of inferior quality. Only in one case (unstructured problem 6), the parallel GAs improved upon the best bound found by Cplex.
4. Conclusions We have formulated and solved a workforce planning problem. To achieve this goal we have used two approaches: a commercial branch-andbound solver and a parallel genetic algorithm. By adding a set of implied bounds, we were able to improve the performance of the branchand-bound solver, which found 9 out 20 optimal solutions. Even though structured problems were solved to optimality or near optimality, there is still a need for a heuristic solution to the WPP because some practical problems may be in the
IV Congreso Español sobre Metaheurísticas, Algoritmos Evolutivos y Bioinspirados, MAEB2005 917 order of ten times larger than those tackled here (i.e., n | m | 200). The development of our parallel version of a genetic algorithm aims at tacking problems of realist size. In the small test problems, our PGAs operate at a faster speed than Cplex but they are not as accurate. Additional work is required to improve upon the quality of the solutions generated by the PGAs before applying the approach to larger problem instances.
Acknowledgements The work by the first and the third authors was partially funded by the Ministry of Science and Technology and FEDER under contract TIC200204498-C05-02 (the TRACER project).
References [1] Aardal, K. (1998) “Capacitated Facility Location: Separation Algorithm and Computational Experience,” Mathematical Programming, vol. 81. pp. 149-175. [2] Alba, E. and Tomassini, M. (2002) “Parallelism and evolutionary algorithms”, IEEE Transactions on Evolutionary Computation, vol. 6, no. 5, pp. 443-462. [3] Glover, F., Kochenberger, G., Laguna, M., and Wubbena, T. (2004) “Selection and Assignment of a Skilled Workforce to Meet Job Requirements in a Fixed Planning Period,” Actas del Tercer Congreso Español sobre Metaheurísticas, Algoritmos Evolutivos y Bioinspirados, Córdoba, pp. 636-641. [4] Holland, J. H. (1992). Adaptation in Natural and Artificial Systems, The MIT Press, Cambridge, Massachusetts, Second Edition. [5] Klose, A. (1999) “An LP-based Heuristic for Two-stage Capacitated Facility Location Problems,” Journal of the Operational Research Society, vol. 50, pp. 157-166. [6] Laguna, M. and Wubbena, T. (2005) “Modeling and Solving a Selection and Assignment Problem, in The Next Wave in Computing, Optimization, and Decision Technologies, B. L. Golden, S. Raghavan and E. A. Wasil (Eds.), Springer, pp. 149-162.