Constraint-Based Optimization for Scheduling Medical Appointments
George Assaf
a
, Sven L
¨
offler and Petra Hofstedt
Programming Languages and Compiler Construction Chair, Brandenburg University of Technology,
BTU Cottbus-Senftenberg, Konrad-Wachsmann Allee 5, Cottbus, Germany
{george.assaf, sven.loeffler, hofstedt}@b-tu.de
Keywords:
Constraint Programming, CSP Model, Optimized Scheduling, Medical Appointment Scheduling Problem.
Abstract:
In this paper, we introduce a novel approach for solving as well as optimizing the medical appointment
scheduling problem (MASP) using constraint programming. The MASP is a complex and critical task in health
care management, directly impacting both patient care and operational efficiency. We formalize the MASP as
a set of constraints that encode diverse requirements for scheduling medical appointments, including intuitive
requirements such as the availability of both patients and medical resources, including physicians, nurses and
medical equipment. Furthermore, our model accounts for patient preferences, such as favoring specific dates
and/or particular resources whenever feasible. The proposed method incorporates optimization techniques
that enhance the scheduling process by considering appointment urgency and balancing workload distribution
among the assigned resources, thereby improving the allocation of medical resources. As an outcome, our
constraint model demonstrates high efficiency by scheduling medical appointments in just milliseconds.
1 INTRODUCTION
Medical appointment scheduling problem (MASP)
within health care facilities is a complex and critical
task that directly impacts the quality of patient care
and the efficiency of the health care operations (Ab-
dalkareem et al., 2021; Ala and Chen, 2022). As the
demand for health care services continues to rise, this
calls for effective scheduling of the available medical
resources ranging from specialized doctors and nurses
to dedicated rooms and medical equipments.
Scheduling medical appointments becomes a
challenging task due to both substantially increas-
ing the number of resources within the medical do-
main and the interdependencies occurring between
different resources. For instance, in a large hospital,
scheduling a cardiac surgery is a complex task that
requires the coordination of several critical resources
such as specialized physicians and a room equipped
with specialized cardiac surgery equipment. Accord-
ing to our medical partner the Charit
´
e Univer-
sit
¨
atsmedizin Berlin, Europe’s largest university hos-
pital, traditional scheduling methods such as spread-
sheets often fall short, unable to effectively balance
many competing demands and constraints, especially
when the search period (scheduling period) as well as
a
https://orcid.org/0000-0002-8878-5871
the number of specialists and medical devices become
substantial.
In this paper, we present a novel constraint-based
model for scheduling medical appointments requir-
ing the coordination of multiple resource types. Con-
straint programming (C P ) (Apt, 2003) offers an out-
standing approach for this purpose by expressing
problem requirements as constraints. On one hand,
hard constraints must be strictly satisfied. For in-
stance, scheduling an appointment for a cardiac con-
sultation calls for a cardiologist to be available. On
the other hand, soft constraints represent preferences
or conditions that are desirable but not mandatory.
For example, a patient prefers an appointment to be
taken place on a specific date. Furthermore, model
optimization focuses on two key objectives: (1) min-
imizing the starting time of appointments to ensure
timely access to medical services, and (2) minimizing
the overall workload distribution across available re-
sources to promote a balanced utilization of medical
staff and equipment.
The remainder of this paper is organized as fol-
lows: The next section introduces the fundamen-
tals of constraint satisfaction and constraint opti-
mization problems, along with a review of relevant
prior research. In Section 3, we detail the do-
mains of the medical appointment scheduling prob-
lem (MASP), which are milestones to construct our
94
Assaf, G., Löffler, S. and Hofstedt, P.
Constraint-Based Optimization for Scheduling Medical Appointments.
DOI: 10.5220/0013091300003890
Paper published under CC license (CC BY-NC-ND 4.0)
In Proceedings of the 17th International Conference on Agents and Artificial Intelligence (ICAART 2025) - Volume 3, pages 94-103
ISBN: 978-989-758-737-5; ISSN: 2184-433X
Proceedings Copyright © 2025 by SCITEPRESS – Science and Technology Publications, Lda.
constraint model. Section 4 then presents the con-
straint model and its optimization. Computational re-
sults for the proposed model are discussed in Sec-
tion 5. Finally, Section 6 wraps up the paper and ex-
plores avenues for future research.
2 PRELIMINARIES
In this section, we recall the fundamentals of C P
including both constraint satisfaction problems and
constraint optimization problems (C OP ). C P (Apt,
2003) is a powerful paradigm within artificial intel-
ligence (AI) to model and solve complex combina-
torial problems by declaring variables and defining
constraints over these variables to specify problem re-
quirements.
2.1 Constraint Satisfaction Problems
Constraint satisfaction problems (CSP ) (Freuder and
Mackworth, 2006) P are formally defined as a 3-tuple
P xX, D, Cy, with:
X tx
1
, x
2
, . . . x
n
u is a set of variables, namely de-
cision variables.
D pD
x
1
, D
x
2
, . . . , D
x
n
q is an n-tuple of finite do-
mains, where D
x
i
represents the set of possible
values that the variable x
i
P X may take.
C tc
1
, c
2
, . . . , c
m
u is a set of constraints,
whereby c
i
pY, Rq consists of:
Y : A subset of variables Y Ď X.
R: A relation that specifies the allowable com-
binations of values for the variables in Y .
For instance, the constraint x
2
` y
2
ď z comprises
three variables x, y and z that are governed by the
relation ď.
Constraints described in natural languages are clas-
sified into hard and soft (Freuder and Mackworth,
2006). Hard constraints are constraints that must be
strictly satisfied in all solutions, whereas soft con-
straints represent desirable conditions that the solu-
tions should aim to satisfy, but it is not mandatory for
them to be fully met.
C P offers a variety of constraints to model com-
plex problems. Among these, global constraints are
particularly powerful, as they capture common pat-
terns or relations that frequently occur in many prob-
lems (Global Constraint Catalog, 2022). A com-
monly used global constraint (depending on the prob-
lem) is allDifferent, which ensures that a set of vari-
ables are all assigned distinct values. For instance,
allDifferent(tx
1
, x
2
,. . . , x
l
u) ensures that each variable
gets assigned a distinct value.
A solution of a C S P involves assigning each variable
x
i
a value from D
x
i
so that the conjunction of the prob-
lem constraints is fulfilled. This implies that a C S P
seeks any solution that satisfies the constraints.
2.2 Constraint Optimization Problems
A constraint optimization problem (C OP ) (Freuder
and Mackworth, 2006) extends a C S P by an objec-
tive function f . The goal of a C OP is twofold. First,
finding an assignment of values to variables that sat-
isfies all the constraints, similar to a C S P . Second,
optimizing (i.e. minimizing or maximizing) the given
objective function f for the purpose of finding the best
solution according to this function. A C OP is for-
mally defined as a 4-tuple P
opt
xX, D, C, f y, with:
P xX, D, Cy is a C S P .
f : D
1
ˆ D
2
ˆ . . . D
n
Ñ R a function that assigns a
real number (often a cost or utility) to each possi-
ble assignment of values to the variables.
Please note that the notation R denotes the set of
real numbers.
A C S P /C OP is solved by means of a con-
straint solver integrating techniques such as con-
straint propagation (Bessiere, 2006), i.e. domain re-
duction and search techniques, e.g. Backtracking (Bit-
ner and Reingold, 1975) for exploring search space.
In C OP problems, the constraint solver seeks not only
to satisfy the problem constraints but also to refine the
solutions to meet an objective function. For instance,
the branch and bound (Morrison et al., 2016) tech-
nique searches for feasible solutions that satisfy all
constraints while iteratively improving the objective
function.
There are different types of constraint solvers,
each optimized for specific kinds of problems. For
example, linear programming solvers like Gurobi and
CPLEX (IBM ILOG CPLEX Optimization Studio,
2019) are highly efficient for solving constraint sat-
isfaction problems with finite domains that can be ex-
pressed as linear equations. In contrast, constraint
programming solvers like Choco (R
´
egin et al., 2017)
and JaCoP (Kuchcinski and Szymanek, 2012) are
more versatile, handling a broader range of combi-
natorial problems involving discrete variables (poten-
tially over infinite domains) and non-linear relation-
ships. Tools like MiniZinc (Nethercote et al., 2007)
offer a high-level modeling language that can be used
with various back-end solvers, providing flexibility
in choosing the best solver for a particular problem
whether the domains are finite or infinite.
Constraint-Based Optimization for Scheduling Medical Appointments
95
Subsequently, we present a C P model for ad-
dressing the MASP. To this end, we adopt the Choco
solver (R
´
egin et al., 2017), as it offers a wide range
of constraints and several search strategies enhancing
the efficiency of finding optimal or feasible solutions
in large-scale and combinatorial settings.
2.3 Related Work
In this section, we review former efforts made in the
field of appointment scheduling, focusing on the var-
ious methodologies and approaches that have been
developed to address the challenges inherent in this
complex problem.
Several constraint models have been proposed
in the literature to describe scheduling appointment
problems. For example, (Gu
´
eret et al., 1996; Rappos
et al., 2022) introduced a university timetabling con-
straint model for scheduling lectures within an educa-
tional institute. While this problem is somewhat rel-
evant to appointment scheduling, but it significantly
differs from medical appointment scheduling prob-
lem. On one hand, doctors may have different work-
ing hours. On the other hand, appointment scheduling
may be governed by patients’ needs such as request-
ing a preferred specialist over others.
Further, (Topaloglu and Ozkarahan, 2011) intro-
duced a mixed-integer programming (MIP) model for
scheduling residents’ duty hours in graduate medical
education, focusing on adherence to residency pro-
gram regulations, including on-call nights, days off,
rest periods, and total work hours. The master prob-
lem aims to minimize deviations from desired ser-
vice levels during day and night shifts by configur-
ing individual schedules. The addressed problem falls
within a very narrow context, as it does not address
the broader and more complex challenges of medical
appointment scheduling, which involves coordinat-
ing appointments across multiple patients and varying
medical resources/services. Similarly, (Oliveira et al.,
2024) recently developed a constraint model for the
nurse scheduling problem, aimed at creating an opti-
mized shift plan for medical staff within a healthcare
facility.
Next, in (Hanset et al., 2010), constraint pro-
gramming was utilized to model the operating theatre
scheduling problem, addressing key constraints and
objectives, such as scheduling surgeries within avail-
able time slots, minimizing resource idle time, and
accommodating the availability of surgeons. How-
ever, this study overlooks constraints related to other
resources and does not fully consider patients’ prefer-
ences.
Besides, (Vermeulen et al., 2009) developed an
adaptive model that dynamically allocates high-cost
medical resources like CT-scans across various pa-
tient groups, taking into account their differing at-
tributes, such as expected arrival times. The model
optimizes resource usage by continuously adjusting
the resource calendar based on real-time. While
the introduced adaptive model relies heavily on dy-
namic capacity allocation for a specific resource, it
neglects various aspects of appointment scheduling
within health care systems.
In contrast to these existing approaches/models,
our constraint-based model addresses the medical ap-
pointment scheduling problem by integrating a holis-
tic set of constraints that account for the needs of both
patients and staff. Additionally, our model takes into
account appointment optimization based on two main
objectives: minimizing the start time of the next ap-
pointment and ensuring a fair distribution of workload
among medical resources, e.g. specialists.
3 DOMAIN DESCRIPTIONS
The MASP (Ala and Chen, 2022) comprises various
resources including physicians with different medi-
cal specializations, rooms, and medical equipment of
different types. Each of these resources is associated
with a calendar sketching both available and occupied
time slots over a given scheduling period, i.e. number
of days. The goal of the MASP is to find available
medical resources (at the same time) that are appro-
priate for the patient’s medical needs, while also striv-
ing to accommodate patient preferences when feasi-
ble. The complexity of the problem stems from the
fact that the search may encompass a substantial num-
ber of medical resources, each with its own calen-
dar that may span over a large number of schedul-
ing days, making the scheduling process highly in-
tricate. Crucially, appointment scheduling must ac-
count for multiple objectives. These objectives in-
clude scheduling the appointment as quickly as pos-
sible and fairly distributing the workload across the
medical facility’s resources. While the first objective
addresses the urgency of the appointment, the latter
focuses on preventing overburdening any single re-
source by consistently assigning appointments to that
resource. Balancing these objectives is essential to
ensure both timely care for patients and sustainable
resource management within the medical facility. To
construct a constraint model, we first need to deter-
mine the variable domains. In this context, we iden-
tify two domains: the time slot domain and the re-
source domain.
ICAART 2025 - 17th International Conference on Agents and Artificial Intelligence
96
Time Slot Domain. This domain describes the
available time slots of a resource calendar. The re-
source calendar is constructed based on the usual of-
fice hours per week, official holidays, and special va-
cations (off days) of the associated resource. The of-
fice hours of a resource are given as a matrix whose
rows and columns represent the time slots and the
week days, respectively, see Figure 1 as an example.
Mo Tu Wed Thu Fr Sa Su
08:00
08:15
08:30
08:45
09:00
11:45
12:00
13:00
.
15:45
Figure 1: Office hours matrix of a resource per week, i.e. 7
columns starting from 8:00 AM to 16:00, i.e. 32 time slots
(rows). Green slots depict those slots at which the given
resource is available, whereas the gray slots show the un-
available slots.
Similarly, we model a resource calendar as a matrix,
whose rows represent the number of time slots and the
columns represent the number of days, during which
appointments to be scheduled, i.e. scheduling period.
Based on the office hours of a resource, the number of
time slots of a resource calender is determined using
Equation 1.
N
T
end
´ T
start
D
, (1)
where T
start
and T
end
are the earliest and latest times
(in minutes) at which the resource starts and finishes
its usual work, respectively. D is the duration of a
time slot. For example, for a resource starting at 8:00
and ending at 16:00 with 15-minute time slots, this
yields 32 time slots per day.
Each time slot per day gets assigned an identifier
which uniquely identifies the corresponding time slot,
if a time slot is free, otherwise it gets assigned a neg-
ative value. The availability of a time slot is obtained
by the associated office hour matrix. The time slot
identifier is determined using Equation 2.
T
id
#
Day ˆ N `i if slot i is free
´1 otherwise
(2)
where Day is the day index within the calendar, N
the number of time slots per day calculated by Equa-
tion 1, and i the corresponding slot index. Figure 2
gives a resource calendar over 14 days. In this exam-
ple, the time slots between 12:00 and 13:00 are con-
sidered as occupied, i.e. -1, as no office hours at this
period are given due to, e.g. lunch time, compare Fig-
ure 1.
As a slot identifier represents a specific time slot (row
index) at a certain day (column index), information
sketched in Table 1 can be determined. For instance,
the time slot with the identifier T
id
33 corresponds
to Tuesday 13.08.2024 (assuming the calendar starts
on Monday 12.08.2024), which is the second day (i.e.,
T
id
mod N = 33 mod 32 = 1) within the given schedul-
ing period, and corresponds to the second time slot (at
8:15).
Table 1: Date/time related information determined by time
slot identifier.
No. Info. Equation Description
1 Specific
Date
d
Y
T
id
N
]
d gives the
correspond-
ing date
index.
2 Day in
a Week
d
w
Y
T
id
N
]
mod 7
d
w
gives the
correspond-
ing day (from
Monday to
Friday).
3 Time
Slot
t
s
T
id
mod N
t
s
gives the
correspond-
ing slot index.
For the purpose of reflecting an overall schedule
of the facility resources, a global calendar can be con-
structed by help of the facility resource calendars.
Both global start time slot and end time slot of the
global calendar are induced by the earliest start time
slot and latest end slot among all resource calendars,
respectively. To access an appointment scheduled for
a resource calendar within the global calendar, the
start appointment slot within the global calendar is
obtained by the following equation:
S
g
S
l
´ G
s
D
(3)
Here, S
g
denotes the start slot index of the appoint-
ment within the global calendar, S
l
is the appointment
start slot index within the local calendar, i.e. resource
calendar, and G
s
is the index of start time slot of the
global calendar. For example, assuming D 15 (min-
utes), if the start of the global calendar is at 7:30 (slot
Constraint-Based Optimization for Scheduling Medical Appointments
97
Day 0
(Mo)
Day 1
(Tu)
Day 2
(Wed)
... Day 11
(Fr)
Day 12
(Sa)
Day 13
(Su)
08:00
08:15
08:30
...
15:30
15:45
... ...
... ...
... ...
...
12:00
12:15
12:30
...
...
15:15
...
Day 3
(Th)
Day 4
(Fr)
Day 5
(Sa)
Day 6
(Su)
0
1
2
-1
-1
-1
31
30
29
32
33
34
-1
-1
-1
63
62
61
64
65
66
96
95
94
93
-1
-1
-1
97
98
-1
-1
-1
128
129
130
-1
-1
-1
127
126
125
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
352
353
354
-1
-1
Figure 2: A resource calendar within a medical facility, spanning over two-week period, i.e. 14 days. Identifier assignment
respects the resource office hours given in Figure 1. It is worth mentioning that the given resource calendar neglects the
appointments that have been previously scheduled for the associated resource.
0 in the global calendar), and the start of a local cal-
endar is at 8:00, then the identifier of the start slot in
global calendar would be 2.
Resource Domain. This domain describes the re-
sources offered by a given medical facility. To accom-
modate the facility resources into a C S P model, each
resource gets assigned a unique identifier. By using
resource identifiers, we now are able to define sub-
domains from the entire resource domain, induced by
all resource identifiers. Each resource sub-domain
contains resource identifiers belonging to the same
medical specialization for specialists. For example,
if a facility comprises n cardiologists, then the cardi-
ologist sub-domain is defined as follows.
D
c
tID
c
1
, ID
c
2
, . . . , ID
c
n
u
where each element represents an identifier of an in-
volved cardiologist. Similarly, resources represent-
ing medical devices with identical medical usage (re-
ferred to by medical type) form an individual sub-
domain. For example, the sub-domain corresponding
to medical equipment of the type CT-scan (computed
tomography device) is given as follows:
D
e
tID
e
1
, ID
e
2
, . . . , ID
e
n
u
where each element represents an identifier associated
with the medical equipment of type CT-scan.
In the same way, other resources such as surgical
rooms and nurses are defined.
4 CONSTRAINT MODEL
The goal of the MASP is to find an allocation of avail-
able resources for a medical appointment request. In
this context, the availability of these resources is de-
termined by their associated calendars. While a C S P
ICAART 2025 - 17th International Conference on Agents and Artificial Intelligence
98
focuses solely on calculating the corresponding re-
sources and time slots, a C OP considers additional
optimization goals, such as scheduling the next ap-
pointment and ensuring a fair workload distribution
among the medical staff.
The input for the problem consists of the calendars
for all resources, the search period defined in days, re-
quired resource types, and the duration of the required
appointment.
To construct a C S P model for the MASP prob-
lem, it is necessary first to determine the decision vari-
ables and their corresponding domains.
Decision Variables. Let the tuple A pR , T q
represent a medical appointment, where R
tx
1
, x
2
, . . . , x
l
u is the set of required resources for the
appointment, and T tt
1
, t
2
, . . . , t
m
u denotes time slot
identifiers that are needed to cover the required dura-
tion. The time slot length m can be intuitively de-
termined by dividing the required appointment du-
ration by the slot duration. For example, A
p
tID
c
3
, ID
e
1
u, t29, 30, 31uq which denotes an appoint-
ment requiring both a cardiologist identified by ID
c
3
and a CT-scan device identified by ID
e
1
for a period of
time covering three consecutive 15-minute time slots,
i.e. 45-minute appointment starting at 15:15. Let the
calendar shown in Figure 2 represent the calendar of
the resource identified by ID
c
3
. This means that the
slot identifier 29 corresponds to the starting time slot
of the appointment involving ID
c
3
.
Let x
i
represent the decision variable for the i-th re-
quired resource (e.g. a medical specialization or med-
ical type (see Section 3). The sub-domain of x
i
, de-
noted by Dpx
i
q, is the sub-set of resource IDs belong-
ing to similar resource type (medical specialization
for doctors or medical types for equipment). This can
be expressed as:
x
i
P Dpx
i
q for i 1, 2, . . . , l
where Dpx
i
q tID
1
, ID
2
, . . . , ID
n
u is the set of IDs
corresponding to all resources that can fulfill the type
requirement of the i-th resource, l denotes the number
of required resources for appointment A and n is the
number of resources with similar type.
Let t
j
be a variable representing a time slot of appoint-
ment A. The domain of the variable t
j
, denoted by
Dpt
j
q, is the set of all available time slots within the
calendar of the resource x
i
, given as follows:
t
j
P Dpt
j
q for j 0, 1, . . . , m
where Dpt
j
q t0, 1, . . . , su represents the set of the
identifiers of the available time slots within the calen-
dars of all required resources in R . Please note that s
denotes the last slot identifier of a resource calendar.
Model Constraints. To best of our knowledge, the
following constraints have to be taken into account for
a typical MASP.
1. Assigning the Right Resources. For instance,
scheduling an appointment for a patient diagnosed
with cardiology issues calls for one or more cardi-
ologists. This constraint is ensured by restricting
the resource variables in R to take values from
their corresponding sub-domains based on the re-
quired resources.
2. Resource Uniqueness. Since an appointment
may require multiple resources simultaneously, it
is crucial that no resource is assigned to the same
appointment more than once. This is enforced by
the allDifferent constraint as follows.
allDifferentptx
1
, x
2
, . . . , x
l
uq
3. Resource Availability This constraint is enforced
by limiting the domains of the variables t
j
P T ,
representing time slots, to those that are available,
i.e. not occupied within each involved resource
calendar.
4. Ensuring a Substantial Appointment Duration.
The constraint is satisfied by designating a num-
ber of time slots equal to m, induced by divid-
ing the required appointment duration by the pre-
defined time slot duration within a resource calen-
dar.
5. Consecutive Time Slots. The time slots allocated
for an appointment must be consecutive within a
day to ensure that the required duration is cov-
ered. This constraint implicitly covers the con-
straint given in the former item (No. 4). This con-
straint is formulated as an arithmetic constraint
1
,
expressed as follows:
t
j
t
j´1
` 1 for j 2, 3, . . . , m
where m is the total number of slots needed to
cover the required appointment duration.
6. Preferred Resource Assignment. This con-
straint is treated as a soft constraint, reflecting the
fact that patients may prefer certain resources (e.g.
a specific specialized doctor), and thus at least one
of the preferred resources should be chosen. How-
ever, if the preferred resource is unavailable, an
alternative must be chosen. To formulate this con-
1
An arithmetic constraint is a mathematical expression
that enforces a specific condition using arithmetic opera-
tions like addition, subtraction, multiplication, or division.
Constraint-Based Optimization for Scheduling Medical Appointments
99
straint, let y
j,k
be a binary variable
2
that equals 1
if resource k is selected for resource type j, and 0
otherwise. For each resource type j, if there are
preferred resources in the set Q
j
, the model en-
courages the selection of one of these preferred
resources:
ÿ
kPQ
j
y
j,k
ě 1 for x
j
P R where Q
j
H
Here, Q
j
is the set of preferred resources for re-
source type j. This constraint is implemented
by creating binary variables corresponding to re-
source assignments and ensuring that at least one
preferred resource is selected. Please note that this
is a soft constraint, as the preferred resource may
not always be available.
7. Eliminating Dates on Which a Patient Can not
Schedule an Appointment. This constraint en-
sures that no appointment will be scheduled on
dates when the patient is unavailable. Let B de-
note the set of time slot identifiers that correspond
to the unavailable dates (refer to Table 1 for the
identification of these slots). To prevent appoint-
ments from being scheduled on these dates, the
starting time slot of the appointment must not fall
within the undesired dates. This can be described
as follows:
t
1
R B
where t
1
is the starting time slot of the appoint-
ment.
8. Scheduling an Appointment on a Date Pre-
ferred by the Patient. This constraint represents
a soft constraint that seeks to schedule the pa-
tient’s appointment on one of the preferred dates.
Let P be the set of preferred dates by the patient
and the variable x
p
indicates whether a resource
is able to schedule the appointment on a preferred
date p. To encourage this preference, the model
minimizes the following sum over all days (i.e.
dates) p that are not in P :
ÿ
pRP
x
p
which represents the number of times the appoint-
ment is scheduled outside the preferred dates. We
2
A binary variable, also called BoolVar in the Choco
Solver library, is a variable that can take only two values:
0 (false) or 1 (true). It is commonly used in constraint pro-
gramming to represent boolean conditions and is useful for
tracking the satisfaction or violation of constraints.
introduce the binary variable brokenDateVar to
capture violations of this preference. Minimizing
brokenDateVar ensures that the patient’s appoint-
ment is scheduled on a preferred date whenever
possible, but the constraint remains flexible to ac-
count for resource availability.
The C S P is now fully defined, typically yielding
numerous potential solutions. To identify a most op-
timal solution among these, we proceed with the op-
timization function.
Model Optimization. In the context of MASP, we
consider two objectives. First, finding the solution
providing the next appointment as soon as possible,
i.e. the solution with minimalistic first time slot. Sec-
ond, finding the solution which fairly distribute work-
load among the resources, e.g. a cardiologist with less
workload.
Minimizing the start time of an appointment and
minimizing the workload of resources are two dis-
tinct goals that may not align naturally. If each op-
timized individually, we might find a solution that
is optimal for one objective but suboptimal for an-
other. Therefore, we combine the objectives, lead-
ing to a more holistic solution that considers both
the efficiency of the schedule (early start time) and
the fairness for workload distribution across resources
(workload minimization).
Minimizing starting time slot t
1
is expressed as
follows.
Minimize t
1
ˆ TimeSlotWeight
where t
1
is the starting time slot of the appointment
and TimeSlotWeight is a weight assigned to prioritize
the minimization of the starting time slot.
To optimize the workload, we introduce a set of
variables p
i
representing workload penality associ-
ated with assigning resource x
i
. The penality is calcu-
lated based on the current workload of a potential re-
source, i.e. time amount which already assigned over
search period, scaled by a penality factor. For each
resource x
i
and potential resource r
j
in its domain:
if x
j
r
j
, then p
i
penaltyFactor ˆworkloadpr
j
q
where workloadpr
j
q is the assigned time amount in-
duced by scheduled appointments for resource r
j
.
Then, the total penality variable totalPenalty across
all resources is defined as:
totalPenalty
N
ÿ
i1
p
i
The objective function to be minimized is
Minimize totalPenalty ˆ WorkloadWeight
ICAART 2025 - 17th International Conference on Agents and Artificial Intelligence
100
where WorkloadWeight is a weight assigned to priori-
tize the minimization of the workload penalties.
The combined objective function f to be mini-
mized:
Minimize f
t
1
ˆ TimeSlotWeight ` WorkloadWeight ˆ totalPenalty
5 MODEL EVALUATION AND
RESULTS
We performed two experiments to evaluate the
model’s performance and its behavior.
Experiment 1. In this experiment, we aim to ex-
plore the performance of the constraint model by
measuring two key metrics as the problem size varied,
i.e. problem scalability. These metrics are: the time
spent to solve the MASP problem, referred to by reso-
lution time (RT) and the time taken by the C S P solver
to reach the optimal solution, referred to as the time to
best solution (TTBS). Due to data privacy regulations
enforced by our medical partner, we conducted our
experiments using a fictional medical facility. The ex-
periments were conducted on a Ubuntu 22.04.4 LTS
machine equipped with 14GB of RAM and an 8-core
AMD Ryzen 2.02 GHz. Additionally, we utilized the
Choco solver library, version 4.10.8.
We assessed the model’s performance by gradu-
ally increasing the problem size. Specifically, the
size of the MASP is defined by either the number
of scheduling days or the number of resources in-
volved. To this end, we conducted two experiments.
In both experiments, all resource calendars have 80%
available slots with each resource’s calendar divided
into 15-minute slots. Additionally, all specialists ini-
tially have no previously scheduled appointments. We
scheduled a 60-minute appointment, each requiring a
different number of resources per problem instance.
Additionally, we considered two patient preferences:
1) excluding the dates 17.12.2024 and 18.12.2024,
and 2) prioritizing the appointment to be scheduled
on 20.12.2024. As an optimization criterion, we also
aimed to ensure a fair distribution of workload among
the available resources.
Table 2 presents the model’s performance as the
problem size is varied by adjusting the number of
involved resources. Notably, the resolution time in-
creases with the growth of both the problem size and
the number of resources required for the appoint-
ments. Table 3 illustrates the model’s performance
as the number of scheduling days is gradually in-
creased. The findings highlight the consistent per-
formance of the constraint model, even as the com-
plexity of the problem increases. For instance, with
a problem size of 252 days (36 weeks), the RT and
TTBS only increase to 392 ms and 360 ms, respec-
tively. These results demonstrate the capability of our
approach to handle large-scale scheduling problems
efficiently, which is critical for practical deployment
in large health care facilities such as Charit
´
e.
We observed variations in RT and TTBS across
different problem sizes. These variations can be at-
tributed to several factors inherent to constraint satis-
faction problems and the optimization process. Al-
though it may seem counterintuitive, smaller prob-
lem instances can sometimes take longer to solve
than larger ones. This behavior may result from the
heuristics employed by the solver, which can perform
suboptimally on certain smaller instances, leading to
longer resolution times.
Experiment 2. The purpose of this experiment is
to examine the model’s behavior when assigning re-
sources to a medical appointment. Specifically, we
aim to investigate the objective function’s effective-
ness in ensuring a fair distribution of workload among
resources. To this end, we considered ten resources,
all sharing the same medical specialization. Initially,
all resources had zero workload, except for the first
two, which started with a workload of 150 minutes.
The model was tasked with scheduling an appoint-
ment requiring two cardiologists for a duration of 60
minutes. Further, we neglect the patient’s preferences.
After determining a solution, the appointment was
confirmed, and the experiment was repeated to track
the cumulative workload across resources.
Figure 3 illustrates the resource-to-appointment
assignments in two scenarios: without workload opti-
mization (left subfigure) and with workload optimiza-
tion (right subfigure). When workload optimization
is disabled, the solver consistently assigned the first
two resources to the appointment in all rounds. As a
result, their workload accumulated progressively, in-
creasing from 210 minutes (150 initial workload +
60 for the appointment) to 450 minutes over multi-
ple rounds. In contrast, with workload optimization
enabled, the solver excluded the first two resources
from scheduling. Their workload, highlighted in red
in the heat map (right-hand subfigure), remained un-
changed. Furthermore, it is clear that the solver se-
lects the optimal schedule by consistently choosing
the resource with the minimal cumulative workload
in each scheduling round.
Constraint-Based Optimization for Scheduling Medical Appointments
101
Table 2: Problem Size (in Resources) vs. Performance Metrics. The scheduling period was set to 49 days.
Problem
In-
stance
Required
Resources
All Re-
sources
Specialists Rooms CT-Scan RT (sec) TTBS (sec)
1 2 40 24 8 8 0.222 0.130
2 4 50 30 10 10 0.614 0.506
3 6 60 34 13 13 0.911 0.804
4 8 70 40 15 15 1.107 1.002
5 10 80 46 17 17 1.401 1.219
6 12 90 50 20 20 1.642 1.330
7 14 100 56 22 22 1.982 1.521
8 16 110 60 25 25 2.649 2.197
9 18 120 66 27 27 3.420 2.420
10 20 132 72 30 30 4.111 3.510
Figure 3: Workload distribution per appointment. We consider five scheduling rounds (app1 to app5) for the same appointment
setting. The highest workload values are highlighted in red.
Table 3: Problem Size (in Days) vs. Performance Metrics.
The involved resources are 72 specialists, 30 rooms, and 30
CT-scan devices.
Problem Instance Days RT TTBS
1 21 208 ms 170 ms
2 42 234 ms 196 ms
3 56 219 ms 187 ms
4 77 249 ms 210 ms
5 112 243 ms 208 ms
6 182 274 ms 243 ms
7 252 392 ms 360 ms
8 280 425 ms 393 ms
9 350 487 ms 449 ms
10 490 638 ms 605 ms
6 CONCLUSION AND FUTURE
WORK
We proposed a stepwise constraint modeling ap-
proach for the medical appointment scheduling prob-
lem, but it also can be generalized to other applica-
tion fields. The problem has been formalized as a set
of variables defined over finite domains and a set of
constraints over these variables reflecting different re-
quirements of the problem. These requirements cover
both intuitive conditions to schedule an appointment
such as the availability of required resources as well
as patient preferences such as scheduling an appoint-
ment on a specific date. Furthermore, model potential
output is subject to be optimized to consider both cri-
ICAART 2025 - 17th International Conference on Agents and Artificial Intelligence
102
teria scheduling an appointment as soon as possible
and ensuring fair workload distribution among the fa-
cility resources.
Our experimental findings highlight the efficiency
of the proposed constraint model, effectively solv-
ing instances of varying complexity within minimal
computational time. Furthermore, the model demon-
strated exceptional performance in optimizing the
schedule and distributing the workload among re-
sources, further highlighting the efficacy of the pro-
posed approach.
Future work includes extending our model to ac-
commodate the scheduling of sequences of interde-
pendent medical appointments. This extension is par-
ticularly critical for managing treatment plans for pa-
tients with complex conditions. There are additional
objectives such as finding appointment sequences
with certain dependencies, like orders and spacing be-
tween the individual appointments. Last but not least,
we plan to incorporate patient preferences for each
appointment within the sequence, such as prioritizing
specific dates, times and physicians.
ACKNOWLEDGEMENTS
The authors would like to thank the anonymous re-
viewers for their valuable and constructive feedback,
which significantly contributed to improving this
work. This research was supported by the German
Ministry for Economic Affairs and Climate Action
(BMWK) as part of the programme ’ZIM - Zentrales
Innovationsprogramm Mittelstand’ (’Central Innova-
tion Programme for small and medium-sized enter-
prises’) (FKZ: 16KN093238).
REFERENCES
Abdalkareem, Z. A., Amir, A., Al-Betar, M. A., Ekhan, P.,
and Hammouri, A. I. (2021). Healthcare scheduling
in optimization context: a review. Health and Tech-
nology, 11(3):445–469.
Ala, A. and Chen, F. (2022). Appointment scheduling prob-
lem in complexity systems of the healthcare services:
A comprehensive review. Journal of Healthcare En-
gineering, 2022(1):5819813.
Apt, K. (2003). Principles of Constraint Programming.
Cambridge University Press.
Bessiere, C. (2006). Chapter 3 - constraint propagation. In
Rossi, F., van Beek, P., and Walsh, T., editors, Hand-
book of Constraint Programming, volume 2 of Foun-
dations of Artificial Intelligence, pages 29–83. Else-
vier.
Bitner, J. R. and Reingold, E. M. (1975). Back-
track programming techniques. Commun. ACM,
18(11):651–656.
Freuder, E. C. and Mackworth, A. K. (2006). Chapter 2
- constraint satisfaction: An emerging paradigm. In
Rossi, F., van Beek, P., and Walsh, T., editors, Hand-
book of Constraint Programming, volume 2 of Foun-
dations of Artificial Intelligence, pages 13–27. Else-
vier.
Global Constraint Catalog (2022). Global constraint cata-
log. http://sofdem.github.io/gccat/. [Online].
Gu
´
eret, C., Jussien, N., Boizumault, P., and Prins, C.
(1996). Building university timetables using con-
straint logic programming. In Burke, E. and
Ross, P., editors, Practice and Theory of Auto-
mated Timetabling, pages 130–145, Berlin, Heidel-
berg. Springer Berlin Heidelberg.
Hanset, A., Meskens, N., and Duvivier, D. (2010). Using
constraint programming to schedule an operating the-
atre. In 2010 IEEE Workshop on Health Care Man-
agement (WHCM), pages 1–6.
IBM ILOG CPLEX Optimization Studio (2019). CPLEX
User’s Manual. IBM. Version 12.10.
Kuchcinski, K. and Szymanek, R. (2012). Jacop a java
constraint programming solver. Foundations of Com-
puting and Decision Sciences, 37(4):309–324.
Morrison, D. R., Jacobson, S. H., Sauppe, J. J., and Sewell,
E. C. (2016). Branch-and-bound algorithms: A sur-
vey of recent advances in searching, branching, and
pruning. Discrete Optimization, 19:79–102.
Nethercote, N., Stuckey, P. J., Becket, R., Brand, S., Duck,
G. J., and Tack, G. (2007). Minizinc: Towards a
standard cp modelling language. In Principles and
Practice of Constraint Programming, pages 529–543.
Springer, Berlin, Heidelberg.
Oliveira, M., Rocha, A. M. A. C., and Alves, F. (2024). Us-
ing or-tools when solving the nurse scheduling prob-
lem. In Optimization, Learning Algorithms and Ap-
plications, pages 438–449, Cham. Springer Nature
Switzerland.
Rappos, E., Thi
´
emard, E., Robert, S., and H
ˆ
eche, J.-F.
(2022). A mixed-integer programming approach for
solving university course timetabling problems. Jour-
nal of Scheduling, 25(4):391–404.
R
´
egin, J.-C., Schaus, P., Prud’homme, C., Lecoutre, C.,
Rochart, J., and Legrain, A. (2017). Choco: an open
source java constraint programming library. In In-
ternational Conference on Principles and Practice of
Constraint Programming, pages 500–518. Springer,
Cham.
Topaloglu, S. and Ozkarahan, I. (2011). A constraint
programming-based solution approach for medical
resident scheduling problems. Computers & Opera-
tions Research, 38(1):246–255.
Vermeulen, I. B., Bohte, S. M., Elkhuizen, S. G., Lameris,
H., Bakker, P. J., and Poutr
´
e, H. L. (2009). Adap-
tive resource allocation for efficient patient schedul-
ing. Artificial Intelligence in Medicine, 46(1):67–80.
Artificial Intelligence in Medicine AIME’ 07.
Constraint-Based Optimization for Scheduling Medical Appointments
103