FormalPara Highlights
  • We present a novel two-stage Stochastic Mixed-Integer Linear Programming model that addresses a complex clinical multi-resource allocation and sequencing problem.

  • Our proposed model with continuous assignment decision variables without timestamp and position indices offers a solution to tackle this challenging problem effectively within reasonable computation time.

  • The model addresses care delivery inefficiencies resulting from uncertain medical resource availability and variations in patient demand by minimizing the total patient waiting time.

  • Our experimental results highlight the remarkable efficiency of our model, which successfully reduces outpatient waiting time by 60% by leveraging dominant patient pathways and their corresponding activity time distribution derived from in-hospital Real-time Location System tracking data. This demonstrates the potential impact of our approach in optimizing patient care management.

1 Introduction

Fig. 1
figure 1

Illustration of possible patient pathways in an outpatient orthopedic clinic

In recent decades, and particularly highlighted during the COVID-19 pandemic, medical service congestion and care delivery inefficiencies induced by medical resource shortages and medical demand heterogeneity have posed an increasingly serious conundrum in healthcare environments [23, 38]. More than ever, well-designed resource management strategies are urgently needed to optimize diverse care pathways utilizing scarce resources for better medical care coordination [6]. A care pathway of a patient is a sequence of chronologically ordered care delivery activities that the patient experiences during the visit to a healthcare facility. This sequence often involves patient interaction with health professionals (e.g., medical staff, physician, nurse, technician, etc.) and utilizing various resources such as exam rooms and equipment. For example, Fig. 1 illustrates three possible patient care pathways in an outpatient orthopedic clinic from registration to discharge.

As pointed out by Villa et al. [53], efficient resource allocation and sequence assignment along patient pathways are vital to improving care coordination and patient experience. It provides a better understanding of the resources needed at each step of a patient’s journey through the system. By leveraging technology, data analytics, and evidence-based practices, healthcare providers can identify areas for improvement, track performance, and implement changes to optimize resource allocation and care delivery. Efficient resource allocation and sequence assignment ensure that the necessary resources are available when needed, resulting in timely patient care, reduced delays, cost savings, and ultimately, improved patient outcomes, thus enhancing the overall patient experience. In contrast, poor patient pathway scheduling with scarce resources could create bottlenecks in the healthcare system, causing cascading treatment delays and worsening patient outcomes. Unfortunately, resource-constrained care coordination is a well-known challenging optimization problem, especially when we consider heterogeneous medical resources with varying capacities needed by patients with uncertain service duration at each activity associated with their care process stages [49]. Therefore, it is crucial to understand different care pathway patterns to build a more efficient resource allocation and care sequencing optimization model.

The emergence of robust Real-Time Location System (RTLS) technologies and their recent deployments at scale by hospitals and health systems have opened up new opportunities to capture and collect highly granular time-stamped location data of the flow of patients, staff, and medical assets through the healthcare facilities [10, 24, 40]. Such granular data allows researchers and hospital administrators to identify sources of inefficiency and improve patient pathway modeling with better care coordination and asset management [16, 24]. In healthcare settings, RTLS technology has been employed for measuring patient density and resource utilization in hospitals [5], finding people and equipment to ensure safety [7], operational error control [56], refining the inputs for clinical simulation [39], and improving care coordination and safety policies [1, 24, 31, 40]. In addition to healthcare, RTLS has also been applied in other fields such as vehicle deployment planning [25] and warehouse management [14]. However, to the best of our knowledge, RTLSs have not been extensively employed to provide support, guidance, or modify operations while taking resource constraints into consideration [3].

To address this difficult, unsolved problem, we propose an RTLS-data-enabled resource allocation and care sequence assignment framework for patient management and decision support. The framework’s objective is to minimize the expected total waiting time of all the patients within an acceptable time horizon. A schematic of our analysis framework is shown in Fig. 2. Specifically, the framework starts with leveraging RTLS data to identify dominant pathways of patient activities. These pathways, along with activity duration distribution information, serve as the core knowledge foundation for generating patient cohort scenarios, which subsequently become the input for the optimization module. The optimization module takes into account both capacitated heterogeneous resources and the uncertain service duration for patients at each activity stage. The specifics of the two modules are outlined below.

Fig. 2
figure 2

Schema: RTLS-data-enabled resource allocation and care sequence assignment framework

The Dominant Pathways Discovery is a data analytic and pattern-mining module to determine the major care pathways and their distribution among the patient population. This module plays an essential role in exploring the heterogeneity of patients’ care demands and translating care into medical resource demand for the subsequent optimization module. RTLS data enables the identification of patient navigation patterns from which dominant pathways are extracted by providing precise, real-time information on patients’ co-location sequences with specific types of medical staff and resources and their corresponding duration. Specifically, we leverage RTLS data to identify common care pathways and the service time distribution of each care activity in each pathway. The major challenges in this module include detecting and dealing with wrong RTLS records, carrying out data cleaning and prepossessing to transform raw RTLS logs to patient pathways, and fitting the care pattern distribution as well as service time distribution for each activity in different pathway patterns. Through these steps, we generate resource-demand scenarios to simulate the medical demand in the real world, which will be input parameters for the optimization module.

The Resource Allocation and Care Sequence Assignment Optimization module is constructed using an advanced stochastic programming model whose output is the suggested resource allocation and sequence assignments that minimize the total waiting time for patients in the clinical setting within an acceptable time horizon. In the optimization module, there are three major challenges associated with optimizing clinical care coordination. First, even for simplified scenarios that ignore the uncertainties in the system, the deterministic patient allocation and sequence assignment with multiple resources is complicated due to the heterogeneity of patient characteristics and limited resource capacities. Second, the randomness in service duration of care activities is significant. Ignoring such uncertainty may result in patient delays, poor utilization of limited resources, increased operating costs, and poor patient outcomes. Third, there is limited data to model such uncertainty due to the difficulties in gathering such detailed information and privacy issues [34]. As seen during the COVID-19 pandemic, health systems have struggled to provide quality care under limited resource availability and unpredictable patient length of stay in critical care units [35].

In summary, this paper focuses on resource allocation and sequence assignment modeling based on the learned dominant patient pathways. Specifically, the model will generate the solution of which and how many resources/staff will serve the patient at which visit stage and at what time. With our analytical model-driven decision support framework and optimization solution, hospitals and health systems will be able to obtain highly efficient resource assignment strategies for scheduling their patients in the clinical setting. Given the historical data on patient flows from using the RTLS technology, we assume that we can estimate patients’ future pathways as defined by the room, providers, and the resources they consume. Furthermore, we derive distributions for each activity duration along the patient pathways based on the real data. The proposed Resource Allocation and Sequence Assignment Module generates the optimal assignment solution in the dynamic environment by utilizing the activity sequence information along with the duration information for each stage for each pathway type.

The remainder of this paper is structured as follows. Section 2 provides a detailed literature review on optimization models for resource allocation and sequence assignment. Section 3.1 introduces the assumptions, parameters, and decision variables of the proposed models. Section 3.2 contains the complete formulation of the proposed model with a solution approach. The data, experiment settings and results are detailed in Section 4. Section 5 summarizes the research and concludes with a discussion of some limitations and future directions.

2 Literature review

The clinical resource allocation and schedule sequencing problem has been an active research topic since the pioneering papers in the 1950s [55]. These early studies mostly assumed that patients are homogeneous concerning service time distribution and arrival pattern [11, 21]. However, consistent with precision medicine goals, researchers have more recently been developing resource allocation models that actively consider patient characteristics and needs to design more personalized solutions for healthcare delivery and management [41, 46]. Kong et al. [29] reported that utilizing the heterogeneity of patients is conducive to arrival order sequencing. Srinivas et al. [50] found that applying cluster scheduling based on grouped patients is appropriate for clinics to reduce appointment delays. Salzarulo et al. [43] further demonstrated how patient characteristics at the individual level could be used to predict patient service duration and support effective scheduling decisions. It is worthwhile to note that few studies have explored patient flow patterns using the highly granular data from RTLS for downstream scheduling or resource allocation.

The resource allocation and sequencing problem is a variant of the Job-Shop Scheduling Problem (JSP), which is well-known as one of the most challenging combinatorial optimization problems to solve using both exact and approximation methods [18]. Specifically, the NP-hard JSP considers the following task: there are n jobs to be processed through each of m machines exactly once with their predefined orders \(\pi _i\ (i\in [n])\); for short, we call the event of job i processing on machine \(j\ (j\in [n])\) as operations \(o_{ij}\); the time duration required for \(o_{ij}\) is known and denoted as \(d_{ij}\); each machine can only process one job at a time, which means that the successor operations cannot start before the completion of their predecessors on each machine; an operation cannot be paused or interrupted once begun; the scheduling goal is to determine the optimal job sequence for each machine to minimize the total makespan or time to completion of the job [2].

To obtain an exact optimal solution for the JSP, mathematical programming models, particularly Mixed Integer Linear Programming (MILP) models, are the most common approach. There are three standard formulation categories for JSP, that is, the time-indexed formulation [8], the rank-based formulation [54], and the disjunctive formulation [36]. Ku et al. [30] showed that disjunctive models perform best for JSP with commercial Integer Programming software such as CPLEX or Gurobi regarding the Mean Relative Error performance over time. However, none of these models can be directly modified to solve the medical resource allocation and staff sequencing model in this study.

The general resource allocation problem can be deemed as an extension of the JSP by relaxing its strict assumptions. First, instead of requiring the job process on each machine exactly once, the job can be processed on a subset of machines. Moreover, each operation can be processed on a candidate set of machines. A number of studies have developed integer-programming-based models for finding exact solutions [9, 12, 19, 42, 51, 52]. Second, further relaxation of the assumption that each machine only processes one job at a time and each operation only requires one machine at a time is also necessary. For example, in some healthcare settings, a single clinician may be responsible for a group of patients simultaneously, and a patient may require multiple resources and medical staff at the same time within a single step of medical service. In this context, each machine (clinician) can process more than one job, and each job requires more than one machine. However, to the best of our knowledge, this problem has not been addressed in the literature and is the focus of this research.

To handle modeling uncertainties in the healthcare setting while conducting resource allocation optimization, simulation-based models [20, 23], stochastic programming [26, 34, 48], and distributionally robust optimization models [13, 22, 47] have been developed to improve performance. Granja et al. [20] optimizes patient admission sequence with simulated annealing algorithm and linear programming to minimize waiting time and improve diagnostic imaging workflows. Kim et al. [26] shows that the two-stage stochastic model can lead to significant cost savings compared with the deterministic model for integrated staffing and scheduling for nurse management under demand uncertainty. With time-indexed formulation, Mandelbaum et al. [34] developed an offline appointment sequencing robust optimization approach to reduce 15% - 40% waiting time plus overtime in a clinic’s infusion units. Deng et al. [13] formulates distributionally robust chance constraints for the stochastic surgery planning problem to minimize waiting and operating room (OR) over time under limited data conditions. He et al. [22] proposed a hybrid, robust, stochastic, rank-based formulation of the patient scheduling problem in the Emergency Department and obtained a near-optimal solution. However, they simplify the patient pathways into a queuing network with one waiting pool and only consider the activity event of physicians during the encounter with the patient. Similarly, other recent stochastic scheduling and sequencing literature have not considered the whole path of the patient care and their interactions with different types of staff and resources.

We note that the models mentioned above mainly fall into the time-indexed and rank-based categories, which are intractable in the larger-scale settings that consider all the clinical activities encountered during a patient visit. To address this issue, we propose a new two-stage Stochastic Mixed-Integer Linear Programming (SMILP) formulation without time-indexed or rank-indexed variables for clinical resource allocation and sequencing problems under random activity duration. The proposed SMILP allows for utilizing real-time location data that provide high precision and granularity. We employ the Monte Carlo Optimization (MCO) approach to obtain near-optimal solutions to the SMILP model via its Sample Average Approximation (SAA). Due to its desirable convergence properties, the SAA approach is a popular method for data-driven decision-making problems under a stochastic environment. Our work will apply SAA to tackle the uncertainty challenges in solving complex resource allocation and sequencing problems in the specific context of optimizing patient care pathways. We refer to the references [27, 28, 33, 45] therein for the technical details and discussions on SAA.

3 Methods

3.1 Definitions and assumptions

Consider a healthcare setting (e.g., a clinic) where there is a set \(\mathcal {J}\) of medical resources (including personnel and equipment), and a set \(\mathcal {I}\) of patients that need to be served within service hours [0, u]. Given the scheduled appointment time of patients’ clinic visits, our research aims to determine the optimal resource allocation and sequence assignment of the medical activities required to meet patients’ needs within the planning horizon u. Each resource in \(\mathcal {J}\) belongs to a certain type g, where \(g\in \mathcal {G}\) and \(\mathcal {G}\) is the collection of all resource types, such as specialist, nurse, exam room and equipment. We also define a collection of sets \(\mathcal {J}_g\) where \(g\in \mathcal {G}\), where each set \(\mathcal {J}_g\) contains all the resources that belong to type g. For simplicity, let \(\mathcal {G} = \{1,2,\cdots , |\mathcal {G}|\}.\)

Associated with each scheduled patient, there is a list of activities that need to be completed in a predetermined order, where each activity has a random duration and requires one or more resources. We denote an aggregated list of all patient activities as \(\mathcal {A}\). Each activity a in \(\mathcal {A}\) represents only one particular activity for one patient (not shared by different patients). We denote \(\mathcal {A}_0\) as the set of all initial activities for each patient. In addition, we let \(\mathcal {A}_1\) represent the set of all activities, excluding the first activities. Therefore, we have \(\mathcal {A}= \mathcal {A}_0 + \mathcal {A}_1\). Moreover, we define a function pre(a) that describes the precedence mapping relationship between activity a and its immediate predecessor, where \(a\in \mathcal {A}_1\). To link the activities with their resource requirements, we define a collection of sets \(\mathcal {A}^{(g)}\), which includes patients’ activities requiring a resource of type g, where \(g\in \mathcal {G}\).

Next, we define the parameters of the model. For each activity \(a\in \mathcal {A}\), we define a non-negative random variable \(d_a\) as the service duration of activity a, which is independent of the specific resource type serving the activity. To be noted, \(d_a\) is a random parameter due to the heterogeneity of patients and the changing dynamics of the healthcare setting. We define scheduled time as \(t_a\), where \(a\in \mathcal {A}_0\) corresponds to the initial activity for each patient. The time-related parameters, \(u,\ d_a,\ t_a\), are integers (in minutes). We define the activity-resource mapping matrix as \(\textbf{V}\) with \(|\mathcal {A}|\) rows and \(|\mathcal {G}|\) columns. The integer element at the ath row and gth column in matrix \(\textbf{V}\), denoted as \(V_{a,g}\), represents the number of type g resources that are needed for activity a. Finally, we denote integer parameters \(k_j\) as the capacity of resource j, where \(j\in \mathcal {J}\).

In the following, we introduce the decision variables for modeling the problem. To represent which resources are assigned to each activity, we define the binary decision variable \(x_{j}^a\) that is equal to 1 if resource j serves activity a and is 0 otherwise, for all pairs (aj) where a requires the resource of type j; mathematically, \(\exists g\in \mathcal {G}\), s.t., \(j \in \mathcal {J}_g\) and \(a \in \mathcal {A}^{(g)}\). For each \(a\in \mathcal {A}\), we define a non-negative continuous decision variable \(b_{a}\) to represent the beginning time of activity a. We define the binary decision variable \(s_{1}^{a,a'}\) equals 1 if activity a is not assigned before activity \(a'\) starts, and is 0 otherwise. We define the binary decision variable \(s_{2}^{a,a'}\) that is equal to 1 if activity a is assigned before activity \(a'\) ends, and is 0 otherwise. For both \(s_{1}^{a,a'}\) and \(s_{2}^{a,a'}\), we only consider the activity pairs \((a,a')\) that share at least one resource of the same type; mathematically, \(\exists g\in \mathcal {G}\), s.t, \(a\in \mathcal {A}^{(g)}\) and \(a^{\prime }\in \mathcal {A}^{(g)}\). Also, the two activities in the pair \((a, a')\) should not be the same activity. Note that only if \(s_{1}^{a,a'}\) and \(s_{2}^{a,a'}\) are both equal to 1, it means that activity \(a^\prime \) is still ongoing at the time activity a starts. Otherwise, if \(s_{1}^{a,a'}\) is 0 and \(s_{2}^{a,a'}\) is 1, this means that when activity a starts, activity \(a'\) has not started yet; if \(s_{1}^{a,a'}\) is 1 and \(s_{2}^{a,a'}\) is 0, this indicates that when activity a starts, activity \(a'\) has already ended (including those that have just ended). The reason we use decision variables \(s^{a,a'}_1\) and \(s^{a,a'}_2\) is to determine the activity sequence between each pair of activities sharing the same type of resource, which further helps us to establish capacity constraints for each resource used by activity a. Along with resource allocation decision \(x_j^a\) and \(x_j^{a'}\), we can determine which activity \(a'\) is sharing at least one common resource at the time that we start the activity a. To do this, we define binary variables \(q_{a,a'}^j\) that is equal to 1 if and only if activity \(a'\) is in progress at the time activity a is assigned and both activities require resource j, and is 0 otherwise; mathematically, we have \(\exists g\in \mathcal {G}\), s.t, \(j \in \mathcal {J}_g\), \(a\in \mathcal {A}^{(g)}\) and \(a^{\prime }\in \mathcal {A}^{(g)}\). The purpose of \(q_{a,a'}^j\) is to subsequently count the total number of ongoing activities sharing the same resource j required by the activities so that we can gather information about the serving capacity in use for each resource j at the time a starts. By constraining the summation of \(q_j^{a,a'}\) over \(a'\), our model can guarantee that all resources j required by a have enough remaining capacity to serve this new activity when it starts. Compared to the time-index-based formulation, our formulation simplifies the capacity constraint check as it only needs to be verified at the start of an activity.

Table 1 summarizes all the notations.

Table 1 Notations

We make the following practical assumptions to complement the model setup:

  1. 1.

    We can obtain the pathway type and its associated activity details for each scheduled patient based on historical data.

  2. 2.

    There are sufficient resources to serve all scheduled patients within the time horizon.

  3. 3.

    Once an activity ends, the patient will wait until the next activity begins.

  4. 4.

    We only consider the segment of patient waiting time after their scheduled appointment time.

Based on the settings and assumptions above, our clinic resource allocation and sequencing model will assign different types of clinicians, staff, and resources to the sequential activities of each patient at specific time points to satisfy their clinic visit requirements while minimizing the expected total waiting time for all patients. Our model will determine the optimized medical personnel assignment, resource allocation, and time sequencing of each activity.

3.2 Optimization models

In this section, we first present the two-stage SMILP formulation in Section 3.2.1. Then, in Section 3.2.2, we present the details of the MCO procedure and the SAA formulation.

3.2.1 The two-stage stochastic model

We model the resource allocation and sequence assignment problem as a two-stage SMILP formulation with recourse to minimize the total waiting time along the entire path of the visits for all patients scheduled in the system under uncertainty in the duration of each activity of each patient during their visit. Recourse models arise when the decision-maker must make some (first-stage) decisions (e.g., assign activities to resources at the time when the patient appointment is scheduled) before information relevant to uncertainty (e.g., activity duration on the day of service) is available. In contrast, some (second-stage) decisions (e.g., the start time of each activity) can be delayed until this information is available [4]. It is important to recognize that the timing of the decisions is a property of the problem at hand. For example, in our problem, at the planning stage, we need to assign patient care activities to medical staff and resources and determine the sequence of activities on each resource when scheduling patient appointments while respecting the capacity of the available resources (via first-stage decisions \(\varvec{x}, \varvec{s}_1, \varvec{s}_2, \varvec{q}\)) before we observe the duration of each activity. These decisions represent the planned schedule and mimic the practice of many healthcare settings employing appointment schedules to manage patient appointments. Due to the uncertainty in the durations of activities, the start time (\(\varvec{b}\)) may deviate from the scheduled time (\(\varvec{t}\)). Hence, the activity start time is a second-stage variable.

Our SMILP model incorporates the randomness of activity duration, which is denoted as \(\varvec{\xi }\) with the known distribution. We assume that the duration of each activity follows a fully known probability distribution. In reality, there are multiple scenarios of activity duration, with the probability distribution representing all possible scenarios. We denote the set of realizations of duration random variables as \(\varvec{\widetilde{d}}\). We estimate the probability distribution of activity duration for each patient from their pathway that is discovered using historical data. Our two-stage model is shown in Formulations () and (). In the first stage, we assign activities to resources and sequence them via decisions \(\varvec{x}, \varvec{s}_1, \varvec{s}_2\), and \(\varvec{q}\). Again, these are planning decisions we make before observing activity duration and thus are not a function of duration scenarios (i.e., remain the same for each scenario). Then, in the second stage, we determine the start time of each activity (represented by decision \(\varvec{b}\)) on each resource and compute the waiting time of each activity for each scenario of the activity duration and fixed (\(\varvec{x}, \varvec{s}_1, \varvec{s}_2, \varvec{q}\)). All inequalities involving the start time decision variables \(\varvec{b}\) are placed in the second stage model () since the optimal start time assignment cannot be determined before the specific activity duration realizations. All remaining inequalities without \(\varvec{b}\) are included in the first stage model (), which determines the optimal assignment to minimize the expectation of the total waiting time based on the duration distribution \(\varvec{\xi }\) without the specific realizations.

Our first stage formulation is as follows.

$$\begin{aligned}&v = \min _{\varvec{x},\varvec{s_1},\varvec{s_2},\varvec{q}} f:=\mathbb {E}_{\varvec{\xi }}\left[ Q(\varvec{x},\varvec{s_1},\varvec{s_2},\varvec{q},\xi )\right] \end{aligned}$$
(1a)
$$\begin{aligned} \text {s.t. }&V_{a,g} = \sum _{j\in \mathcal {J}_g} x_j^a, \qquad \qquad \qquad \quad \ \forall a\in \mathcal {A},g\in \mathcal {G}\end{aligned}$$
(1b)
$$\begin{aligned}&q_{a,a^{\prime }}^j \ge s_{1}^{a,a^{\prime }}+s_2^{a,a^{\prime }} + x_j^a + x_j^{a^{\prime }} - 3, \nonumber&\\&\qquad \qquad \ \forall g\in \mathcal {G},\ j\in \mathcal {J}_g,\ a\in \mathcal {A}^{(g)},\ a^{\prime }\in \mathcal {A}^{(g)} \end{aligned}$$
(1c)
$$\begin{aligned}&\sum _{a^{\prime }\in \mathcal {A}^{(g)},a^{\prime } \ne a} q_{a,a^{\prime }}^j \le k_j-1, \nonumber \\&\qquad \qquad \qquad \qquad \quad \forall g\in \mathcal {G},\ j\in \mathcal {J}_g,\ a\in \mathcal {A}^{(g)} \end{aligned}$$
(1d)

The objective (1a) aims to find optimal first stage decisions (\(\varvec{x}, \varvec{s}_1, \varvec{s}_2, \varvec{q}\)) that minimize the expected total waiting time. Constraint (1b) is the resource assignment constraint, which guarantees that the resource requirements of each activity will be satisfied. Constraints (1c)–(1d) ensure that activities are sequenced without violating resource capacity constraints. Specifically, constraint (1c) ensures that variables \(q_{a,a'}^j\) will equal 1 if and only if all binary variables \(s_1^{a,a'}\), \(s_2^{a,a'}\), \(x_j^{a}\), \(x_j^{a'}\) are equal to 1. In other words, constraint (1c) guarantees that \(q_{a,a'}^j = 1\) if activity \(a'\) is still in progress with resource j when activity a is scheduled with j. Constraint (1d) ensures that the total number of activities being served by resource j does not exceed the capacity. These capacity constraints prevent activity a from being scheduled to a resource when the resource has already reached its capacity limit.

In the second stage, we compute the beginning time of each activity and the associated waiting time (if any). Recall that we use \(\xi \) to represent a realization of a vector of activity duration. For each \(\xi \) and feasible (\(\varvec{x}, \varvec{s}_2, \varvec{s}_2, \varvec{q}\)), our second stage problem is as follows:

$$\begin{aligned}&\min _{\varvec{b}}\left\{ \sum _{a\in \mathcal {A}_0}\left( b_a - t_a\right) + \sum _{a\in \mathcal {A}_1}\left( b_a - b_{pre(a)} - \widetilde{d}_{pre(a)}\right) \right\} \nonumber \\ :=&\ Q(\varvec{x},\varvec{s_1},\varvec{s_2},\varvec{q},\xi ) \end{aligned}$$
(2a)
$$\begin{aligned} \text {s.t. }&b_a- t_a \ge 0, \qquad \qquad \qquad \qquad \qquad \quad \forall a \in \mathcal {A}_0 \end{aligned}$$
(2b)
$$\begin{aligned}&b_{a} - b_{pre(a)} - \widetilde{d}_{pre(a)}\ge 0, \qquad \qquad \quad \forall a \in \mathcal {A}_1 \end{aligned}$$
(2c)
$$\begin{aligned}&Ms_{1}^{a,a^{\prime }} \ge b_{a}-b_{a^{\prime }}+1, \nonumber \\&\qquad \qquad \qquad \qquad \forall g\in \mathcal {G},\ a\in \mathcal {A}^{(g)},\ a^{\prime }\in \mathcal {A}^{(g)} \end{aligned}$$
(2d)
$$\begin{aligned}&M(1-s_{1}^{a,a^{\prime }}) \ge b_{a^{\prime }}-b_{a}, \nonumber \\&\qquad \qquad \qquad \qquad \ \forall g\in \mathcal {G},\ a\in \mathcal {A}^{(g)},\ a^{\prime }\in \mathcal {A}^{(g)} \end{aligned}$$
(2e)
$$\begin{aligned}&Ms_2^{a,a^{\prime }} \ge b_{a^{\prime }}-b_{a}+\widetilde{d}_{a^{\prime }}, \nonumber \\&\qquad \qquad \qquad \qquad \ \forall g\in \mathcal {G},\ a\in \mathcal {A}^{(g)},\ a^{\prime }\in \mathcal {A}^{(g)} \end{aligned}$$
(2f)
$$\begin{aligned}&M(1-s_2^{a,a^{\prime }}) \ge b_{a}-b_{a^{\prime }}-\widetilde{d}_{a^{\prime }}+1, \nonumber \\&\qquad \qquad \qquad \qquad \ \forall g\in \mathcal {G},\ a\in \mathcal {A}^{(g)},\ a^{\prime }\in \mathcal {A}^{(g)} \end{aligned}$$
(2g)

This formulation seeks to minimize the waiting time by assigning the specific starting time (second-stage decision variables) of each activity based on the first-stage assignment and the realized activity duration \(\varvec{\widetilde{d}}\). Constraints (2b)–(2c) require that the beginning time of each activity a be no earlier than the scheduled start time \(t_a\) if a is an initial activity, otherwise no earlier than the completion time of its preceding activity (i.e., \(b_{pre(a)} + \widetilde{d}_{pre(a)}\)). Constraints (2d)–(2g) require that the beginning time of activity a obey the first-stage sequencing assignment indicated by \(s_1^{a,a'}\) and \(s_2^{a,a'}\). Specifically, when \(s_1^{a,a'}=1\) (i.e., \(a'\) assigned no later than a), constraint (2e) reduces to \(b_a \ge b_{a'}\), indicating that the second-stage decision for the start time of activity a is no earlier than that of activity \(a'\), and constraint (2d) is relaxed to \( M\ge b_{a} - b_{a^\prime }+ 1\), which is always valid for sufficiently large M. In contrast, when \(s_1^{a,a'}=0\), constraint (2d) reduced to \(b_{a'} \ge b_{a} + 1\), ensuring that activity \(a'\) starts later than the start time of activity a, and constraint (2e) is relaxed. Similarly, when \(s_{2}^{a,a'} = 1\), constraint (2f) is relaxed, while constraint (2g) is reduced to \(b_{a}\le b_{a^{\prime }}+\widetilde{d}_{a^{\prime }}-1\), ensuring that the second-stage decision for the start time of activity a should be strictly less than the end time of activity \(a'\); otherwise, constraint (2g) is relaxed, while constraint (2f) is reduced to \(b_{a}\ge b_{a^{\prime }}+\widetilde{d}_{a^{\prime }}\), meaning that activity a should start no earlier than the end of activity \(a'\).

Our proposed two-stage decision model is a realistic fit for healthcare delivery settings since it is necessary to assign patients to medical staff and resources in advance when the patient is scheduled and before realizing activity duration. Appendix B provides an illustration of the deterministic counterpart of the model.

3.2.2 Monte Carlo optimization

Finding the exact optimal solution and objective function value v to the two-stage stochastic programming model in Formulations () and () is computationally intractable, since computing \(\mathbb {E}_{\varvec{\xi }}\left[ Q(\varvec{x},\varvec{s_1},\varvec{s_2},\varvec{q},\xi )\right] \) requires multidimensional integrals. To obtain a near-optimal solution, we apply MCO with the SAA approach to solve the problem. The key idea of MCO is to replace the duration randomness \(\varvec{\xi }\) with the empirical distribution based on N i.i.d. sampled scenarios over the original distributions \(\varvec{\xi }\). Hence, we can write the SAA transformation of the two-stage model into Formulation (), where we map all previous scenario-related parameters \(\widetilde{d}_a\)’s and scenario-induced decision variables \(b_a\)’s into N sets of different \(d_a^{(n)}\)’s and \(b_a^{(n)}\)’s, where \(n = 1, ..., N\). As the weight of each scenario in SAA is equal to 1/N, the new objective function becomes the average total waiting time over all the scenarios, shown in Objective (3a). As for the SAA constraints, on the one hand, we can directly reuse the constraints in Formulation () since they do not involve scenario variables; on the other hand, we need to include constraints in Formulation () N times. The SAA formulation can now be stated as follows.

$$\begin{aligned} v_N :=&\min _{\varvec{x},\varvec{s_1},\varvec{s_2},\varvec{q},\varvec{b}} f_N \nonumber \\ :=&\min _{\varvec{x},\varvec{s_1},\varvec{s_2},\varvec{q},\varvec{b}} \Bigg \{\frac{1}{N}\sum _{n=1}^N \bigg [ \sum _{a\in \mathcal {A}_0}\left( b_a^{(n)} - t_a\right) +\nonumber \\&\qquad \qquad \ \sum _{a\in \mathcal {A}_1}\left( b_a^{(n)} - b^{(n)}_{pre(a)} - d^{(n)}_{pre(a)}\right) \bigg ]\Bigg \} \end{aligned}$$
(3a)
$$\begin{aligned} \text {s.t. }&\text {(1b) -- (1d)} \end{aligned}$$
(3b)
$$\begin{aligned}&\text {(2b) -- (2g)}, \qquad \qquad \qquad \qquad \forall n = 1, ..., N \end{aligned}$$
(3c)

Note that the sample average \(f_N\) in the objective of SAA formulation is an unbiased estimator of the expected value \(f:=\mathbb {E}_{\varvec{\xi }}\left[ Q(\varvec{x},\varvec{s_1},\varvec{s_2},\varvec{q},\xi )\right] \) in the objective of the SMILP. By the Law of Large Numbers and [44], \(f_N \rightarrow f\) with probability one (w.p.1) as \(N \rightarrow \infty \). It follows that we have \(v_N \overset{p}{\rightarrow }\ v\) as \(N\rightarrow \infty \), i.e., the optimal value of the SAA problem converges to that of the SMILP. However, for a fixed N, the SAA formulation reduces to a MILP. Hence, one would expect the computational effort and solution time of solving the SAA formulations to increase as N grows. Therefore, we employ the MCO procedure to determine the appropriate sample size N to obtain near-optimal solutions that provide a good trade-off between approximation accuracy and computational time.

Algorithm 1 summarizes the steps of the MCO procedure. MCO is able to find an appropriate sample size N of duration scenarios which could lead to a near-optimal first-stage decision-making solution within a threshold of the optimal gap. Starting with an initial SAA sample size \(N = N_0\), where \(N_0\) is far smaller than the pre-defined simulation sample size \(N'\), the MCO algorithm first runs K replicates of optimization + simulation, in each of which \(N+N'\) i.i.d. samples \(\varvec{d}^{(n)}\,(n\in [N+N'])\) are drawn from the duration distributions \(\varvec{\xi }\); then, the SAA formulation is executed, given the first N sampled duration scenarios, which outputs the optimal objective value \(v^k_N\) and the first-stage decision solution in this optimization step; next, the SAA formulation is rerun by replacing N with \(N'\) and changing another set of parameters, that is, the last \(N'\) sampled duration scenarios and the fixed first-stage decision parameter gained from the previous optimization step; we then obtain the simulation objective value \(v^k_{N'}\). After the K replicates, we compute the average optimization-stage objective value \(\bar{v}_N\) and the average simulation-stage objective value \(\bar{v}_{N'}\). It has been shown that \(\bar{v}_N\) and \(\bar{v}_{N'}\) are, respectively, the statistical lower and upper bounds of the optimal two-stage model [32].

To evaluate the optimality of the optimization-stage solution under the current sample size N, the metric Approximate Optimality Index (AOI) is applied, which is defined by \(AOI_N = (|\bar{v}_{N'}-\bar{v}_{N}|)/\bar{v}_{N'}\). If the \(AOI_N\) is smaller than the pre-determined termination optimality tolerance \(\epsilon \), then we can directly output the results, including the final optimization step N, \(AOI_N\), the statistical descriptions of lower bound \(v^k_{N}\) and upper bound \(v^k_{N'}\), and the computational complexity metrics; otherwise, the algorithm will go onto the iteration starting from the scenario generation step until the final \(AOI_N\) is smaller than the desired threshold \(\epsilon \).

Fig. 3
figure 3

RTLS data visualization example

4 Results

In this section, we use the RTLS data to extract the dominant care pathways with a corresponding demand for patient care resources, fit the service time distribution of each care activity for each pathway, and conduct a series of experiments to analyze the computational and operational performance of our SMILP approach. Section 4.1 first describes the RTLS dataset we obtained from our technology partner in Section 4.1.1, then presents the mined pathways in Section 4.1.2, followed by optimization experiment setup in Section 4.1.3. Section 4.2 summarizes the experimental results.

4.1 Data and experiment setup

4.1.1 Data description

The data we used in this work was shared by our technology collaborator. We ran experiments using the RTLS data collected from an orthopedics clinic from December 1, 2019, to February 28, 2020. The dataset includes the following four major components:

  1. 1.

    Room information: with attributes of room ID, room name, room location coordinates, and room type;

  2. 2.

    Resource information: with attributes of resource ID, resource type;

  3. 3.

    Patient RTLS data: each row represents a visit activity of a patient in a room, with attributes of patient ID, visit start time, visit end time, move start time (the time of entry into the room), move end time (the time of leaving the room), room name, room ID;

  4. 4.

    Resource RTLS data: each row represents the resource details in a room, with attributes of resource ID, room name, room type, start time, and end time.

4.1.2 Discovery of dominant pathways

Patient pathways are chronologically ordered activity se-quences of clinic visits. From the raw RTLS data, we extract the patient-resource interaction events by identifying overlapping periods when patients and resources are in the same location by aggregating patient location data with resource location data. Therefore, each patient’s pathway consists of a sequence of clinical activities, and each of them requires a set of resources in the same room at the same time. When the room changes or the resources that the patient interacts with change, we deem that the patient moves on to the next activity. Notice that even though activity in the pathway is defined based on the co-location interaction with specific types of medical staff, the room is not a scarce resource in this facility setting. Consequently, we do not treat the room as a capacity-limited asset requiring optimization, and it does not directly factor into our experiment’s optimization module. Nevertheless, our SMILP formulation is able to adapt to scenarios where room availability may be restricted, necessitating its consideration as a capacitated resource for optimization.

Table 2 Dominant pathways mined from RTLS data

Figure 3 shows an example of RTLS data visualization for Patient 5010, the medical staff Patient 5010 interacted with, and other patients who had interactions with the same set of staff, all within the duration of Patient 5010’s visit. We observe from the plot that different patients do have distinct pathways and medical resource demands; moreover, waiting is a serious problem in this facility.

After data cleaning and preprocessing, we compile all pathways from the raw RTLS data logs of 5644 retrospective clinic visits. The pathways are grouped such that the activity sequences in the same pathway group are exactly the same. The grouping results show that the top 5 types of pathways represent more than 50% of the total visit records. Therefore, we select the top 5 dominant pathway types in our experiments for illustrative purposes and brevity. For the convenience of further pathway sampling, we use the occurrence proportion of each type among these 5 types as the pathway sampling weights.

To determine the characteristics of the duration of each activity for different types of pathways, we use the Python package Scipy to fit the best distributions to the data vectors of activity duration. As shown by May et al. [37], log-normal distributions are the state-of-the-art choice for fitting the actual processing times in clinical settings. Therefore, we fit the log-normal distribution to the duration of each activity type within each pathway type. Our results also confirm that the fitted log-normal distributions are highly consistent with the real data. The dominant pathways and the mean and variance of the fitted distributions are shown in Table 2. During each round of the experiment, we use the dominant pathways to generate a sequence of patients following different pathway patterns. These patterns are sampled using computed proportions. Once the patterns are known, we can identify the mean and variance of duration distribution of each activity for each patient and can further sample different duration scenarios based on the log-normal distribution, which serve as the input to the SAA model.

Fig. 4
figure 4

Experiment framework

4.1.3 Description of experiment setup

The framework of each trial in each experiment is shown in Fig. 4. Given the dominant patient pathways shown in Table 2, we generate visit instances for patients following these pathways of activity sequences with their known duration distributions weighted by their likelihood of occurrence. This forms the input to the Monte Carlo Optimization approach described in Algorithm 1. Alongside this, we use the mean value of the activity duration in the generated pathways to solve the deterministic counterpart of the proposed SMILP model, where the deterministic solutions of resource allocation and sequencing variables (the counterpart decisions in the first stage of SMILP) will be used for model comparison. The MCO module outputs its simulation scenarios \(\varvec{d}_{N'}\) in the last iteration for all the replicates, the average simulation objective value \(\bar{v}_{N'}\), and all decision variables’ solution. Note that the model output can also be represented as a resource assignment Gantt chart with the same format as Fig. 6.

For model evaluation, we consider a baseline mean value model whose first-stage solution is derived by the deterministic MILP model under the mean duration setting. Note that this mean value model ignores the randomness in the first stage, which thereby is an appropriate comparison with the SMILP model. For the second stage, we run the SAA model in Formulation () for K iterations and obtain K objective values. In all K replicates, the first-stage variables are fixed with the mean value model solution, while at each iteration, we change the duration scenario with a different scenario from the MCO module’s last iteration. The average of baseline mean value solution objective value is denoted as \(\bar{v}_{N'}^{base}\).

Finally, we apply a metric called the value of the stochastic solution (VSS) to measure the value of using SMILP to model the uncertainty in activity duration compared with using a deterministic model, considering only the expected values. VSS is a widely used metric for evaluating stochastic programming models [17]. Specifically, VSS is the difference between the SMILP solution objective value (approximated as \(\bar{v}_{N'}\)) and the deterministic baseline solution objective value (approximated as \(\bar{v}_{N'}^{base}\)). Though \(\bar{v}_{N'}\) is the approximation of the SMILP solution’s objective value, as we show later, our SAA model provides a small gap for the optimal solution of the SMILP model. Therefore, we use \(\bar{v}_{N'}-\bar{v}_{N'}^{base}\) as an estimator of the VSS.

We consider the following combination of key parameters to generate problem instances for our experiments: the number of patients, the arrival sequences of patients with pathway patterns that follow their likelihood of occurrence, patients’ arrival interval, and resource/staff numbers and their capacity. Since we are considering an orthopedics clinic, the scheduling horizon is about 4 hours long. Based on the data summaries, we find that patients arrive at near-equal intervals of around 10 minutes. Hence the average number of hourly arrivals is around 6. Therefore, we follow these interval settings in the design of the experiment by testing two arrival intervals of 10 and 15 minutes each to understand their impact on the total wait time and computational complexity.

On the clinic side, we observe that the main staff types are labeled as Intake, Radiology Technician, Provider, Orthopedics Technician, Discharge, and Others. As Intake and Discharge are not bottleneck activities in the system, we simplify the problem complexity by only evaluating the capacity impact of the Radiology Technician, Provider, and Orthopedics Technician on the clinic’s efficiency, model performance, and computational complexity. For each combination of the parameters, we execute the experiment once based on the framework shown in Fig. 4 to obtain the outputs for different trials. For each trial, we set the initial optimization sample size to \(N_0 = 100\) and the simulation optimization sample to \(N'=500\).

We executed all the experiments on the Ubuntu 20_04 Devel and Docker operation system with 44 CPUs and a memory size of 120 GB. We employed the CPLEX interface, DOcplex, in Python 3.8 to solve the optimization problem. We used 44 threads to parallelize the computation and set a time limit of 1 hour for solving each optimization problem.

Fig. 5
figure 5

Experiments results: at the iteration of \(N = 100\)

4.2 Experimental results

Table 3 shows all the MCO procedure’s results based on the settings described in the previous section, where we consider different combinations over multiple parameters. We summarize the results using scatter plots and violin plots for the following metrics:

  1. (a)

    The VSS, shown in Fig. 5a;

  2. (b)

    The ratio of the VSS over the mean value solution objective value, \(\bar{v}_{N'}^{base}\), shown in Fig. 5b;

  3. (c)

    The average computation time for the optimization stage, shown in Fig. 5c;

  4. (d)

    The Approximate Optimality Index (AOI), shown in Fig. 5d.

In all four subplots, the x-axis delineates the number of patients considered in each experiment, while the color denotes distinct schedule intervals for patient arrivals. In Fig. 5a and c, each point in the scatter plot signifies an experiment setting defined by the number of patients (x-axis), schedule interval (color), patient arrival sequence in terms of pathway patterns, and resource capacity (not shown on these plots); The y-axis represents the corresponding average VSS and average computation time, respectively. Figure 5b showcases violin plots depicting the dual-sided rotated kernel density of the VSS-to-mean-value baseline model objective ratio grouped by patient number (x-axis) and schedule interval (color); Within each violin shape, the vertical position (y-axis) of the horizontal line indicates the actual ratio of an experiment within the group, while the width of the line represents the doubled kernel density at that point. Figure 5d displays a violin plot illustrating the AOI distribution for each experiment set, grouped by the number of patients (x-axis) and the schedule interval (color); This plot, akin to a box plot, incorporates an additional rotated kernel density on each side with trimmed tails beyond extreme values or boxplot range.

For consistent comparative analysis, the results in Fig. 5 are from the first iteration (\(N=100\)) for each trial. Note that higher VSS and ratio mean better performance of the SMILP model for resource assignment compared to the deterministic solution. The results in Fig. 5a and b indicate that in a more congested setting (shorter schedule interval), our SMILP model can achieve great improvement in the total waiting time compared to the deterministic baseline. The improvement (VSS and the ratio) grows significantly as the number of patients considered in the model (complexity) increases. The total waiting in the system can be reduced by 60% on average with the proposed SMILP model for the most complicated setting (20 patients and an interval of 10 minutes). The most significant reduction in patient waiting time among all the settings is nearly 70%.

From Fig. 5d, we also observe that the SMILP model demonstrates close-to-optimal results for most settings, with the optimality gap smaller than 5%. For the low congestion settings, there is an obvious increase in the AOI as the number of patients increases. One plausible reason is that the low congestion scenarios have more flexibility to assign and sequence the required resources, which results in more computation over multiple resource-pair swappings.

As for the computation time, we conclude from Fig. 5c that the computation time of the optimization stage grows exponentially as the complexity of the model grows (number of patients), noting that the y-axis of Fig. 5c uses the \(\log _{10}\)-scale. These results are consistent with the literature that the resource allocation problem is NP-hard. Hence, the more congested settings require higher computation time since the model has more constraints. However, we can still obtain near-optimal solutions for the complex model within acceptable time limits that can be implemented in the actual clinic or hospital settings.

5 Conclusions, perspectives

This paper focuses on the problem of allocating and sequencing multiple resources so that patients scheduled for clinical care can experience efficient and coordinated care with the shortest overall wait time. We formulate the problem as a two-stage Stochastic Mixed-Integer Linear Programming model. We consider the specific scenario of the resource allocation and sequence assignment that can be conducted by operations staff at the clinic and demonstrate near-optimal solutions for the SMILP problem with different patient arrival sequences generated based on dominant pathways derived from real-time, highly granular, time-stamped location data collected from a single facility. We apply an iterative Monte Carlo Optimization approach for solving the stochastic resource allocation and sequence assignment problem that considers capacitated heterogeneous resources and uncertain service duration for each activity. The objective of the optimization is to minimize the expected total waiting time of all the patients in the clinic during a given planning horizon.

We particularly note that an important innovation in the modeling and solution of this problem is the computationally efficient formulation that uses continuous assignment decision variables without timestamp and position indices, overcoming the significant inefficiencies in traditional formulations with discrete-time-indexed and rank-based (position-indexed) binary assignment decision variables. Within the framework of Monte Carlo Optimization, our Sample Average Approximation formulation realizes fast computation, enabling the solution of the large-scale problem for real-time allocation adjustment in a dynamic clinical environment with complex coordination constraints. We verify the feasibility and superior performance of the proposed model using RTLS data provided by our technology partner. With a detailed design of experiments, the results indicate that our proposed model can significantly reduce waiting time for patients in the clinic by 60%, on average, with acceptable computational resource requirements and time complexity.

The following limitations and extensions provide some directions for future studies.

First, the study insights are limited by the availability of data from a single clinic. Hence, expanding the experiments with additional data from multiple clinics will also allow fitting inter-arrival distributions that consider ‘no-shows’ and the early, late, and on-time arrivals of patients, and their variability, instead of using the deterministic values would be an immediate extension of this work that is more realistic in healthcare settings. The current model can fully support these arrival and ‘no-show’ patterns in varied clinic settings to derive new insights for the multi-resource allocation and sequence assignment problem.

Second, the current pathway discovery approach is limited by data availability to identify the top pathway groups using simple mining methods. With additional data, combining our stochastic model with deeper pathway mining and prediction modeling to construct an end-to-end resource allocation solution is a very promising and needed direction. A more advanced time-series prediction model based on the recurrent neural network or attention network may provide superior accuracy for learning the dominant pathways and predicting the duration for both new and existing clinic patients. The more accurate the pathway information, the better the decision-making performance obtained from the near-optimal solution generated by the MCO approach will be.

Third, limitations imposed by the intractability of the stochastic optimization model may be alleviated by developing an innovative closed-loop model incorporating the further impact of the resource allocation decisions on pathway discovery and prediction. Therefore, the self-feedback mechanism may adaptively predict and optimize [15] to realize a better decision-making allocation for solving the multiple-resource allocation and sequence assignment problem.