method to compute counterfactual explanations for
CO problems by leveraging inverse optimization.
However, their method is restricted to a specific class
of CO problem which does not include the WSRP.
Besides, it assumes that at most one data element
(specifically a coefficient in the objective function
which does not appear in any constraint) may be
changed to obtain the counterfactual explanation. In
our case, such an assumption does not hold, as all the
coefficients involved in the objective function also are
in the constraints. Therefore, their method cannot be
straightforwardly applied to our WSRP case.
Thus, in this paper, we propose a new mathemat-
ical programming-based approach to compute coun-
terfactual explanations for an end-user of a WSRP-
solving system. Given a solution of a WSRP instance
as well as end-user’s questions focusing on this solu-
tion and satisfying certain assumptions, this method
provides counterfactual explanations. Such explana-
tions emphasize the few changes that may be operated
on the instance data, which would be enough for ob-
taining outputs satisfying the end-user’s desiderata.
The remainder of this article is organized as fol-
lows. In Section 2, we clarify our WSRP use case by
detailing the content of an instance, introducing at the
same time various notations, and presenting an Inte-
ger Linear Program modeling this problem. In Sec-
tion 3, we describe our approach for generating coun-
terfactual explanations, which are then provided to the
end-user of a WSRP-solving system. Finally, conclu-
sions and perspectives are given in Section 4.
2 WORKFORCE SCHEDULING
AND ROUTING PROBLEM
As mentioned in Section 1, the Workforce Schedul-
ing and Routing Problem (WSRP) consists of assign-
ing tasks to mobile workforce members and creating
a pair of routes and schedules for these members. In
this section, we describe our WSRP use case, more
precisely the content of any instance and its corre-
sponding Integer Linear Programming (ILP) model.
In our use case, we consider a scheduling hori-
zon of one day i.e. 1440 minutes. An instance in-
volves a set of employees E = {1, ..., n} and a set
of tasks T = {1, . .., m}. Each employee i ∈ E has a
name, a starting location, which we call home for the
sake of simplicity, a skill level ske
i
∈ N and working
time-window [lbe
i
, ube
i
] ⊆ [0, 1440] ∩ N. Each task
j ∈ T has a specific location, a required skill level
skt
j
∈ N, a duration dt
j
∈ N and an availability time-
window [lbt
i
, ubt
i
] ⊆ [0, 1440] ∩ N. We assume that
hours in time-windows are expressed in minutes from
12:00AM (e.g. 8:00AM = 480).
For performing tasks, employees leave their
homes when they start their working day and return
there when they end it. In order to model these
two home events, we introduce, for each employee
i ∈ E , a departure index d
i
as well as a return in-
dex r
i
- where all the indices d
i
and r
i
for i ∈ E
are different from each other and different from the
indices of T = {1, ... , m}. We then extend the
set of tasks T with the set of departure indices and
the set of return indices to form a set of activities
A = T ∪ {d
1
, ..., d
n
} ∪ {r
1
, ..., r
n
}. Besides, for
each employee i ∈ E, we note A
i
= T ∪ {d
i
, r
i
} the
set of activities obtained by extending T with the de-
parture and return indices of i.
Finally, an instance also involves traveling times.
The time needed to travel between two activities
( j,k) ∈ A
2
is assumed to be independent of the em-
ployee and is noted tr
jk
∈ N.
The instance data on which Figure 1 is based are
given in the Table 2 of the Appendix A.
In order to model the WSRP using Integer Linear
Programming (ILP), we introduce two sets of deci-
sion variables.
The first one corresponds to spatial decisions. We
introduce, for i ∈ E and ( j,k) ∈ A
2
i
with j 6= k, a bi-
nary variable U
i jk
such that U
i jk
= 1 if employee i per-
forms activity j and then moves to activity k; U
i jk
= 0
otherwise. By assigning tasks to employees and spec-
ifying the order in which the tasks are performed,
these variables define the route of each employee.
The second set of variables corresponds to tem-
poral decisions. We introduce, for each j ∈ T , the
integer variable T
j
that sets the time at which j starts
to be performed by an employee if it is.
Based on the data of the instance and the decision
variables that we previously described, we model the
WSRP using ILP as presented in Model 1.
The bi-objective function (1) is maximized ac-
cording to a lexicographic order: the first objective
equals the total working time, and the second to the
opposite of the total travel time.
Flow constraints (2) to (4) ensure that the em-
ployees start from their homes, go from tasks to oth-
ers without splitting into multiple directions, and end
their working day at home. Skill constraints (5) en-
sure that an employee i can be assigned to a task
j only if i has a skill level higher than the one re-
quired for performing j. Occurrence constraints (6)
ensure that a task j must occur at most once within all
employees’ routes. Availability constraints (7) to (8)
ensure that if a task j is performed by an employee
then j must be started and ended within its availabil-
ity time-window [lbt
j
, ubt
j
]. Work and sequencing
ICORES 2023 - 12th International Conference on Operations Research and Enterprise Systems
52