Professional Documents
Culture Documents
Sciencedirect: Workforce Scheduling Linear Programming Formulation
Sciencedirect: Workforce Scheduling Linear Programming Formulation
Sciencedirect: Workforce Scheduling Linear Programming Formulation
com
ScienceDirect
IFAC PapersOnLine 51-11 (2018) 264–269
Unassigned tasks
A solution to the WSRP requires all tasks to be assigned 𝑊𝑊, 𝑗𝑗 ∈ 𝑇 is the quality of service.
while satisfying some requirements:
[𝑇𝑊𝑊 𝑤𝑤 , 𝑇𝑊𝑊 𝑤𝑤 ] time
[𝑒𝑗𝑗 , 𝑙𝑗𝑗 ]
workingwindow
time of task 𝑗𝑗.of worker 𝑤.
window
Assignment of tasks must be achieved considering 𝑖𝑖𝑛𝑖𝑖 𝑠𝑢𝑝
workers skills;
Assignment of workers to tasks must be achieved 3.3 Notations for decision variables
considering customers preferences;
Binary variables:
Assignment of workers to tasks must be achieved =1 if worker w moves from task i to j
𝑥𝑤𝑤 {
considering the worker-customer compatibility matrix (a 𝑖𝑖,𝑗𝑗
=0 otherwise
customer cannot be assigned to a worker due to legacy =1 if worker w moves from departure
constraints). 𝑤𝑤
𝑥0,𝑗𝑗 { location to task i
Time-conflicts must be avoided to obtain workers’ =0 otherwise
planning with no overlapping in time. =1 if worker w moves from task i
𝑤𝑤
A high quality solution for a WSRP should have both low 𝑥𝑖𝑖,0 { to finishing location 0
operational costs and a penalty cost referring to high quality =0 otherwise
of service for customers and workers. =1 if the worker w is assigned to a task j
𝜓𝜓𝑗𝑗𝑤𝑤 { situated outside w's preference region
In this section, we introduce a MILP that deals with the =0 otherwise
WSRP. The proposed MILP simultaneously considers the =1 if time window violation occurs when task j
following 𝑗𝑗
set of constraints: 𝜃𝜃𝑤𝑤 {is assigned to worker w
1. the assignment of tasks to workers to define trip for =0 otherwise
workers; Continuous variables:
2. the assignment of workers to tasks considering the number number of workers not available to achieve the
𝑦𝑗𝑗 task 𝑗𝑗.
of workers required by each task
𝑡𝑗𝑗 starting time of task 𝑗𝑗.
3. the assignment of tasks depending on the workers’ 𝑑𝑤𝑤 departure time of worker 𝑤 from task 𝑗𝑗.
𝑗𝑗
working time window that differ for each worker according 𝑎𝑤𝑤
𝑗𝑗 arrival time of worker w to task 𝑗𝑗.
to their individual contract; and the satisfaction of the
workers’ preference regions;
4. the respect of the contracts between workers and
customers;
3.4 Linear Programming
5. the departure/arrival time of the workers at the task
location depending on the transportation time and the
finishing time of the previous task;
𝖶 𝑇 𝑇
𝑇 𝑇 𝖶 𝑇 𝖶 𝑇
𝑀𝑑𝑑𝑛 𝑓𝑓(𝑆) = 𝜆1 ∑ ∑ ∑( 𝑑𝑑𝑑𝑠𝑡𝑖𝑖,𝑗𝑗 + 𝑝 𝑤𝑤 )𝑥 𝑤𝑤 + 𝜆2 ∑ (3𝑟𝑗𝑗 − ∑ ∑ 𝜌 𝑤𝑤 𝑥 𝑤𝑤 ) + 𝜆3 ∑ ∑ (𝜓𝜓 𝑤𝑤 + 𝜃𝜃 𝑤𝑤 ) + 𝜆4 ∑ 𝑦𝑗𝑗
𝑗𝑗 𝑖𝑖,𝑗𝑗 𝑗𝑗 𝑖𝑖,𝑗𝑗 𝑗𝑗 𝑗𝑗
𝑤𝑤=1 𝑖𝑖=0 𝑗𝑗=1 𝑗𝑗=1 𝑖𝑖=0 𝑤𝑤=1 𝑗𝑗=1 𝑤𝑤=1 𝑗𝑗=1
s.t.
∑𝑇𝑗𝑗=0 𝑥 𝑤𝑤 ≤ 1 ∀ 𝑖𝑖 = 0. . |𝑇|, 𝑤 = 1. . |𝑊𝑊 | (1.1)
𝑖𝑖,𝑗𝑗
∑𝑇𝑖𝑖=0 𝑥 𝑤𝑤 ≤ 1 ∀ 𝑗𝑗 = 0. . |𝑇|, 𝑤 = 1. . |𝑊𝑊 | (1.2)
𝑖𝑖,𝑗𝑗
∑𝑇 𝑥 = 𝑤𝑤
∀ 𝑗𝑗 = 0. . |𝑇|, 𝑤 = 1. . |𝑊𝑊 | (1.3)
∑𝑇 𝑥𝑤𝑤
𝑖𝑖=0 𝑖𝑖,𝑗𝑗 𝑢=0 𝑗𝑗,𝑢
𝖶 𝑇 𝑤𝑤
∑𝑤𝑤=1 ∑𝑖𝑖=0 𝑥 𝑖𝑖,𝑗𝑗 + 𝑦𝑗𝑗 = 𝑟𝑗𝑗 ∀ 𝑗𝑗 = 1. . |𝑇| (2)
𝜓𝜓𝑤𝑤 + 𝑀. 𝑝𝑎𝑤𝑤 ≥ ∀ 𝑤 = 1. . |𝑊𝑊 |, 𝑗𝑗 = 1. . |𝑇| (3)
∑𝑇 𝑥𝑤𝑤
𝑗𝑗 𝑗𝑗 𝑖𝑖=0 𝑖𝑖,𝑗𝑗
𝑀. 𝜃𝑗𝑗 ≥ 𝑡𝑗𝑗 + 𝐷𝑢𝑟𝑗𝑗 − 𝑇𝑊𝑊 𝑤𝑤 + ∀ 𝑤 = 1. . |𝑊𝑊 |, 𝑗𝑗 = 1. . |𝑇| (4.1)
(∑𝑇 𝑥 𝑤𝑤 − 1). 𝑀
𝑠𝑢𝑝 𝑖𝑖=0 𝑖𝑖,𝑗𝑗
𝑀. 𝜃𝑗𝑗 ≥ 𝑇𝑊𝑊 𝑤𝑤 − 𝑡𝑗𝑗 + 𝑥 𝑤𝑤 − 1). 𝑀 ∀ 𝑤 = 1. . |𝑊𝑊 |, 𝑗𝑗 = 1. . |𝑇| (4.2)
(∑𝑇
𝑖𝑖𝑛𝑖𝑖 𝑖𝑖=0 𝑖𝑖,𝑗𝑗
𝑤𝑤
∑𝑇 𝑥 ≤ 𝑐
𝑤𝑤
∀𝑗𝑗 = 1. . |𝑇| , 𝑤 = 1. . |𝑊𝑊 | (5)
𝑖𝑖=0 𝑖𝑖,𝑗𝑗 𝑗𝑗
𝑑𝑤𝑤 ≥ (𝑡𝑗𝑗 + 𝐷𝑢𝑟𝑗𝑗) + (∑𝑇 𝑥 𝑤𝑤 − 1). 𝑀 ∀𝑤 = 1. . |𝑊𝑊 |, 𝑗𝑗 = 1. . |𝑇| (6.1)
𝑗𝑗 𝑖𝑖=0 𝑖𝑖,𝑗𝑗
𝑎 ≥ (𝑑 𝑤𝑤 + 𝑑𝑖𝑖𝑠𝑡𝑖𝑖 ,𝑗𝑗 ) + (𝑥 − 1). 𝑀
𝑤𝑤 𝑤𝑤 ∀𝑤 = 1. . |𝑊𝑊 |, 𝑖𝑖 = 0. . |𝑇|, 𝑗𝑗 = 1. . |𝑇| (6.2)
𝑗𝑗 𝑖𝑖 𝑖𝑖𝑗𝑗
other task (constraint 1.1); to a task 𝑗𝑗 a worker can travel can be rewritten as:
from
at most one task (1.2); and if 𝑤 is assigned to a task 𝑗𝑗 after 𝑀. 𝜃𝑗𝑗 ≥ 𝑡𝑗𝑗 + 𝐷𝑢𝑟𝑗𝑗 − 𝑇𝑊𝑊 𝑤𝑤 (4.1.)
task
𝑖𝑖 then 𝑥𝑤𝑤 = 1 and (1.3) can be rewritten as ∑𝑇 𝑥𝑤𝑤 = 1 𝑠𝑢𝑝
𝑖𝑖,𝑗𝑗 𝑢=0 𝑗𝑗,𝑢 𝑀. 𝜃 ≥ 𝑇𝑊𝑊 𝑤𝑤 − 𝑡 (4.2.)
meaning that 𝑤 must travel to another task (or to the finishing 𝑗𝑗 𝑖𝑖𝑛𝑖𝑖 𝑗𝑗
location) and cannot stay in this position.
Constraint (4.1) ensures that if the completion time (𝑡𝑗𝑗 +
2) The assignment of workers to tasks considering the 𝐷𝑢𝑟𝑗𝑗 ) of task 𝑗𝑗 exceeds 𝑇𝑊𝑊𝑠𝑢𝑝
𝑤𝑤
, the binary variable 𝜃𝜃𝑗𝑗 is set to
number of workers required by each task (constraint 2) 1. Since 𝑡𝑗𝑗 + 𝐷𝑢𝑟𝑗𝑗 − 𝑇𝑊𝑊𝑠𝑢𝑝 > 0, the constraint (4.1.) is
𝑤𝑤
The number of assigned workers to task 𝑗𝑗 must comply with 𝑟𝑗𝑗 rewritten as 𝑀. 𝜃𝑗𝑗 ≥ 𝑡𝑗𝑗 + 𝐷𝑢𝑟𝑗𝑗 − 𝑇𝑊𝑊𝑠𝑢𝑝
𝑤𝑤
> 0 and ensures that
i.e. with the number of required workers to achieved task 𝑗𝑗 𝜃𝑗𝑗 = 1. Constraint (4.2.) ensures that 𝜃𝑗𝑗 = 1, if 𝑡𝑗𝑗 < 𝑇𝑊𝑊𝑖𝑖𝑛𝑖𝑖 𝑤𝑤
,
(constraint 2). 𝑦𝑗𝑗 is the number of missing workers to i.e. when 𝑇𝑊𝑊𝑖𝑖𝑛𝑖𝑖 − 𝑡𝑗𝑗 > 0, meaning that worker 𝑤 has to
𝑤𝑤
achieved
task 𝑗𝑗 and it is defined by: 𝑦𝑗𝑗 = 𝑟𝑗𝑗 − 𝑤𝑤=1 ∑𝑇𝑖𝑖=0 𝑥𝑤𝑤
𝑖𝑖,𝑗𝑗 . If a task perform task 𝑗𝑗 before the end of his working time window.
∑𝖶 𝑗𝑗
requires 3 workers (𝑟𝑗𝑗 = 3), but only one worker 𝑤1 is 4) The assignment of tasks to workers considering the legacy
assigned to 𝑗𝑗 so there exists one and only one 𝑥𝑖𝑖,𝑗𝑗𝑤𝑤
= 1 and constraints meaning that a task can be assigned to
(2) ∑ 𝑖𝑖,𝑗𝑗
can be rewritten as 𝑤𝑤=1 𝑇𝑖𝑖=0 𝑥𝑤𝑤 + 𝑦𝑗𝑗 = 1 + 𝑦𝑖𝑖 = 3. By authorized workers (constraints 5) only
∑𝖶
consequence, 𝑦𝑖𝑖 = 2 that is the number of missing workers to 3) The assignment of tasks depending of the workers’
perform the task.
In the scenarios tackled in this paper, a worker can achieve been included in the customer’s contract (5), in this case 𝑐𝑤𝑤
a task requires by a customer if and only if the worker has = 1, 𝑗𝑗
preferences (constraints 3, 4.1. and 4.2) otherwise 𝑐𝑤𝑤 = 0 and 𝑥𝑤𝑤 < 0 that enforces 𝑥𝑤𝑤 = 0.
∑𝑇
𝑗𝑗 𝑖𝑖=0 𝑖𝑖,𝑗𝑗 𝑖𝑖,𝑗𝑗
Ideally, a worker should be assigned to tasks in his available
5) The departure and arrival time of the workers to the tasks
geographical regions. However preference region violations
(constraints 6.1 and 6.2.)
are possible and have to be measured to define the third part
of the objective function. In the constraint 3, if 𝑝𝑎𝑗𝑗𝑤𝑤 = 0, the If a worker 𝑤 is assigned to a task 𝑗𝑗 after a task 𝑖𝑖, so 𝑥𝑖𝑖,𝑗𝑗
𝑤𝑤
=1
worker 𝑤 is assigned to task 𝑗𝑗 which is located into a non then constraint (6.1) can be rewritten as 𝑑 𝑗𝑗 ≥ (𝑡𝑗𝑗 + 𝐷𝑢𝑟𝑗𝑗)
𝑤𝑤
The objective function The linear programs have been solved by CPLEX 12.7 with
the parameter “set threads 1”: in this case the CPU times of
The objective function to be minimized involves four criteria CPLEX is equal to the User Time.
which are balanced by four weights (𝜆1, … , 𝜆4) corresponding
to priority levels. The associated weights to each criteria 4.3 Results
clearly reflect the difference between the priority levels and Table 2 introduces: the best solution from (Laesanklang and
are defined in (Algethami and Landa-Silva, 2017). Landa-Silva, 2017), with the objective value and the
Since one of the most important objectives of the service is to computational time; the optimal solutions found by CPLEX
perform as many tasks as possible, the highest priority in the and the CPU time of CPLEX to find the optimal solutions.
objective function is given to minimize unassigned tasks Let us note that the data of the instance C-02 are incoherent
through weight 𝜆4. and so the instance is impossible to solve.
Since, in practical case (in particular in HHC, see Table 2. Linear programming results
(Rasmussen
et al., 2012) and (Laesanklang and Landa-Silva, 2017)), some (Algethami and Proposed MILP
workers must accept to perform some tasks that are over their Landa-Silva, 2017)
working time window or outside their available geographical
region; the second highest priority in the objective function is |𝑇| |𝑊𝑊 | S* t (sec) S* t (sec)
to minimize the number of workers time availability A-01 32 23 3.49 7.00 3.119 2.11
violations and the number of working region preference A-02 31 22 2.49 8.00 1.608 2.18
violations, through weight 𝜆3. A-03 38 22 3.00 14.00 1.978 5.23
Weight 𝜆2 gives priority to minimize the preferences A-04 28 19 1.42 5.00 0.521 1.87
penalties: preferred workers-customers pairing, workers A-05 13 19 2.42 1.00 1.574 0.21
preferred regions and customers preferred skills. The degree A-06 28 21 3.55 5.00 2.516 1.28
of satisfaction of these preferences when worker 𝑤 is A-07 13 21 3.71 1.00 2.559 0.11
assigned to B-01 36 25 1.70 21.00 0.294 7.06
task 𝑗𝑗 is given by 𝜌𝑘 = 𝑝𝑎𝑤𝑤 + 𝑝𝑤𝑤𝑤 + 𝑝𝑠𝑤𝑤 which has a value B-02 12 25 1.75 2.00 0.684 0.07
𝑗𝑗 𝑗𝑗 𝑗𝑗 𝑗𝑗
B-03 69 34 1.72 6003.00 0.229 82.47
in the range [0, 3] since the satisfaction of the three types of
preferences for each assignment has value 𝑝𝑎𝑤𝑤, 𝑝𝑤𝑤𝑤, 𝑝𝑠𝑤𝑤 ∈ B-04 30 34 2.07 25.00 0.429 6.50
[0,1]3 B-05 61 32 1.82 585.00 0.355 46.21
𝑗𝑗 𝑗𝑗 𝑗𝑗
: a value of 1 means that 𝑤 is fully satisfied, a value 0 B-06 57 32 1.62 184.00 0.257 38.11
meaning 𝑤 is not at all satisfied. The satisfaction level is B-07 61 32 1.79 300.00 0.262 47.71
reverted to penalty by subtracting it from the maximal C-01 177 1037 114.21 301.32 113.406 8959.79
satisfaction score, which is 3𝑟𝑗𝑗 for each task 𝑗𝑗. These values
C-02
are given by (Pinheiro et al., 2016). C-03 150 1077 103.52 550.29 103.449 1775.47
Lastly, through weight 𝜆1, the lowest priority is given to C-04 32 979 11.15 90.00 11.129 23.71
minimize the monetary cost that represents the operational cost C-05 29 821 12.44 55.00 12.427 7.51
in terms of total travel cost 𝑑𝑖𝑖𝑠𝑡𝑖𝑖 ,𝑗𝑗 and worker’s salary 𝑝 𝑤𝑤 . C-06 158 816 140.44 323.52 140.319 615.81
C-07 6 349 4.30 1.00 4.304 0.17
𝑗𝑗