A Home Health Care Routing and Scheduling Problem - CiteSeerX

10 downloads 0 Views 225KB Size Report
Jul 9, 1998 - The home health care industry in the United. States is a growing service industry that must perform scheduling and/or routing tasks on a daily ...
A Home Health Care Routing and Scheduling Problem Eddie Cheng Department of Mathematical Sciences Oakland University Rochester, Michigan 48309 U.S.A. and Jennifer Lynn Richy Department of Computational and Applied Mathematics Rice University Houston, Texas 77005, U.S.A. July 9, 1998

 y

Supported by a fellowship from the Natural Sciences and Engineering Research Council of Canada Supported by the Center for Research on Parallel Computation, Rice University

1

1 Introduction Many industries over the past two decades have discovered the bene ts of improving eciency by examining the routing and scheduling decisions involved in their businesses. Better routing and scheduling allows these businesses to achieve savings in their costs and, oftentimes, an expansion in their service capabilities. The home health care industry in the United States is a growing service industry that must perform scheduling and/or routing tasks on a daily basis. A Fortune 500 company expressed its interests towards the future in home health care. They envision one company providing service for a large area and employing many health care providers with whom it can communicate remotely. By using technology to relay schedule information and patient reports, companies eliminate the need for employees to travel to a central oce everyday. This setup describes many existing companies, except that the service region is broken up into several smaller local problems which are then solved by hand. While this may work, the potential for savings involved in nding a better solution over a larger service area is considerable. The problem discussed in this paper is posed in the context of a home health care problem. Despite the fact that in this industry, health care is provided by many quali ed individuals such as registered nurses, physical therapists and home health aides, for notational simplicity, we will refer to the employees as simply nurses. The only di erentiation that we make is between salaried workers (full-time nurses) and non-salaried workers (part-time nurses). Salaried workers are paid for a full-time shift everyday, whether or not they are scheduled to work the entire time. They are paid overtime if they are required to work for longer than the standard shift length. Part-time nurses are paid by the hour. The di erences in the nurses' quali cations are represented by a binary relationship with each patient; a nurse-patient pair is thus, either a feasible match or an infeasible match. Accordingly, the nurse may be scheduled to visit the patient, or he or she may not. Additionally, a company in this industry would like to not only satisfy a customer's need for health care, but also keep the customer happy by providing dependable service (i.e. providing health care when the customer requests it). Thus, most home health care companies allow the customer to specify a time window during which he or she will be at home awaiting the requested care. In 2

summary, the problem is to nd an optimal schedule such that each nurse that is scheduled to work leaves from his or her home, visits a set of \feasible" patients within their time windows, takes a lunch break within the nurse's lunch time window, and returns home, all within the nurse's time window (which indicates the times during which the nurse is willing to work) and within the known limit on the length of a shift. The optimal schedule minimizes the amount of overtime and part{time worked. This type of problem is not unique to the home health care industry. One example of the same type of problem is what Caseau and Koppstein [3] called the task/technician assignment problem. This problem involves assigning repairmen to sets of tasks. Each technician has a speci ed starting and ending location. The task must be executed within a time window and the technician must have the appropriate skills to perform the task. The goal is to maximize the amount of work by minimizing the amount of travel needed. He describes nding solutions with an expert system by dividing the problem into 2 subproblems: the matching of tasks to technicians and the scheduling of each technician's tour. This problem is essentially the same structure as the home health care problem we have described. One di erence is that in their problem each repairman{job pair has a match score rather than a binary relationship, in this way permitting less quali ed matches. The authors' decision to approach this problem heuristically was based on their having many di erent levels on which to judge the quality of any solution, making it dicult to determine the meaning of optimal. The home health care problem is, more generally, a vehicle routing problem with time windows [VRPTW], many depots, and compatibility information. It has many depots since each nurse's home acts as a depot housing a single vehicle (i.e. nurse) where a route must start and end. Several good survey articles on the topic of vehicle routing both with and without time windows are found in Desrochers et al. [6], Fisher [8] and Desrosiers et al. [7]. Although there is a signi cant amount of literature involving vehicle routing problems with time windows, most of the problems considered have a central depot, rather than multiple depots. Multiple depot problems tend not to consider time windows as side constraints. In 1984, Laporte, Nobert and Arpin [11] solved several symmetrical, multi-depot capacitated vehicle routing problems that ranged in size from 25 to 40 nodes. In this case, their algorithm, 3

which did not allow for time windows, encountered increased diculty as the number of depots grew. They considered as many as 8 depots in their problem sets. In 1988, Laporte, Nobert, and Taillefer [12] considered an exact algorithm to solve asymmetrical multi-depot problems with up to 80 nodes, but there were no time windows and the number of depots needed to be small{ only two or three. Carpeneto et al. [2] also considered multple depot problems with only two or three depots, but in this case the trips were already time-tabled, so routing was not an issue, only scheduling. There have been a handful of papers aimed at approaching the multi-depot vehicle problem heuristically. None of these considered time window conditions, either. The most recent of these papers is Chao et al. [4]. The authors of this paper give a good description of the previous work done on the multi-depot problem, as well as provide their test data. In Section 2, we describe two approaches in formulating our problem as a MIP. Section 3 describes our heuristic, the way the test data are generated, and computational results. Finally some remarks and observations are given in Section 4.

2 MIP Formulations The problem can be formulated as a mixed integer linear programming problem. Two di erent formulations, one using double-indexed variables, the other using triple-indexed variables, are common in the literature on vehicle routing problems with and without time windows. We present both formulation approaches as they apply to this particular problem.

2.1 Notation The home health care problem can be de ned on a simple, directed graph G = (V; A). The set of nodes, V , consists of three disjoint sets: (1) a set N of nurses (or health care providers); (2) a set P of patients; and (3) a set L of lunches. The set of nurses is made up of the disjoint union of full-time nurses, F , and part-time nurses, H . Each nurse has a time window [ai ; bi] in which he or she must begin and end his or her shift. (Throughout this paper, times are recorded in minutes where the start of the day is 0 and the end of the day is 1440.) Full-time nurses are salaried workers that get paid for some xed length of time each day, regardless 4

of whether or not they are scheduled to work. These workers only incur an additional cost ( ) per amount of overtime that they are scheduled to work (overtime is taken to be the time past the standard shift length, SL). Part-time nurses incur a cost ( ) proportional to the total time that they work. De ne a maximum shift length, MSL, that limits the total time any nurse may work. Each patient in the set P has a duration, di, which indicates the time it takes to provide health care at that patient, and a time window, [ai; bi ], where ai is the earliest time service may begin at patient i and bi is the latest time service may begin at patient i. Included in the set P are the original patients of the problem plus a dummy patient for each nurse, de ned to be feasible only for its corresponding nurse. The reason for these dummy patients will become clear in the discussion of the formulation. The dummy patient corresponding to some nurse n is denoted by DP (n). Each dummy patient's time window is de ned to match the time window of its corresponding nurse. The set of lunches consists of a unique lunch node for each nurse, where each lunch has a duration and a time window as de ned for each patient. Once again, the lunch corresponding to some nurse n can be identi ed using the notation L(n). The set of arcs, A, is based on a notion of compatibility. There exists a binary relationship between each nurse and every other node. In other words, each nurse is either allowed or disallowed to visit a node in V . This known relationship is entirely contained in the set of feasibility lists for each nurse:

Bn = fj 2 P [ N [ L : nurse n may visit node j g By de nition, there is only one lunch node and one dummy patient node that each nurse is permitted to visit. Thus, the set A contains the following feasible arcs:

 (n; p) and (p; n) where n 2 N and p 2 P , and the nurse n is compatible with p (p 2 Bn)  (n; L(n)) and (L(n); n) where n 2 N  (p ; p ) where p ; p 2 P; p 6= p 1

2

1

2

1

2

 (p; L(n)) and (L(n); p) where p 2 P; n 2 N and nurse n is compatible with p (p 2 Bn) Note that the graph does not contain any loops nor does it contain arcs between two nurse nodes or between two lunch nodes. Let tij denote the duration of service at node i plus the 5

time it takes to travel from i to j for every (i; j ) in A. If i is a nurse node then the duration of service at i is zero and tij represents only travel time. If either i or j is a lunch node, then de ne the value tij to be zero. An ordered pair of nodes (i; j ) are said to be time window compatible if ai + tij  bj . Thus, any arc (i; j ) in the graph G that does not satisfy this condition is infeasible and can be removed from the graph.

2.2 A Double{Indexed Formulation Let xij be the binary variable de ned on the set of arcs A such that xij = 1 if some nurse travels from node i to node j and xij = 0 otherwise. The continuous variable yi indicates the starting time at node i and is de ned for all nodes in the graph. The variable zn is de ned for n 2 N and refers to the ending time of nurse n's shift. The variable sn is de ned only for n 2 F and represents the slack in a full-time nurse's shift. Additionally, it is necessary to create free variables jn for n 2 N; j 2 V which are used to prevent nurses from visiting disallowed nodes. The model can be formulated as the following mixed integer programming problem: Minimize

X (z ? y + s ? d ? SL) + X (z ? y ) n n n n n Ln ( )

n F

n H

2

subject to

xik ? xki = 0; i 2 N; k = L(i); or i 2 P; k 2 L x((L(n))) = x((L(n))) = 1 n 2 F x((L(n))) = x((L(n))) = (1 ? xDP n ;n) n 2 H X X x((i)) ? xik = x((i)) ? xiv = 1 i 2 N [ P ( )

k L k L yi + tij ? yj  (bi + tij ? aj )(1 ? xij ); 2

2

i 2 N [ P; j 2 P; i 6= j dL n xL n n + yi + tin ? zn  (dL n + bi + tin ? an)(1 ? xin); i 2 P; n 2 N yj + dj ? yi  (bj + dj ? ai)(1 ? xij ); i 2 P; j 2 L yL n + dL n ? zn  (bL n + dL n ? an)(1 ? xnL n ); n 2 N yi + tij ? yk  (bi + tij ? 21 ak )(2 ? xij ? xjk ) i 2 N [ P; j 2 P; k 2 L; i 6= j yi + tin ? yL n  (bi + tin ? 21 aL n )(2 ? xin ? xnL n ); i 2 P; n 2 N ( )

( )

( )

( )

( )

( )

( )

(1)

2

( )

( )

( )

( )

6

(2) (3) (4) (5) (6) (7) (8) (9) (10) (11)

yn + d L n  z n ; n 2 F yn  z n ; n 2 H zn ? yn + sn ? dL n ? SL  0; sn  0; n 2 F zn ? yn  MSL; n 2 N jn ? in  1 ? xij ; (i; j ) 2 A; n 2 N jn ? nn  1; n 2 N; j 2 (P [ N [ L)nBn xnDP n = 1; n 2 N a n  yn ; z n  b n n 2 N a i  yi  b i ; i 2 P [ L xe 2 f0; 1g; e 2 A

(12)

( )

(13) (14)

( )

(15) (16) (17) (18) (19)

( )

(20) (21)

The objective function seeks to minimize the cost associated with the amount of overtime and part-time work that is scheduled. Constraints (2){(5) and (21) guarantee that a feasible solution will have two kinds of circuits: (1) circuits containing exactly one lunch node and one non-lunch node, and (2) circuits containing two or more non-lunch nodes. Every lunch node is either a member of exactly one circuit of the rst type (sometimes referred to as the \tail") or it is an isolated node in the solution. Note that since equation (18) ensures Lunch Node

Lunch Node

part-time nurse

dummy patient

Figure 1: The solid nodes represent either nurse or patient nodes linked together to form the \body" of the main circuit. The lunch node is connected to the body by a two{node circuit called the \tail" if the body corresponds to a full time nurse or a working part{time nurse; otherwise, the lunch node is an isolated node in the solution. 7

that each nurse visits his or her dummy patient rst, it is easy to determine if that nurse is actually scheduled to visit any real patients by simply looking at the value of the arc from the dummy patient back to the nurse. If that arc has value 1, then the nurse does not visit any other patients. This observation is used in equation (4) to force a part-time nurse that does not visit any real patients to have a corresponding lunch node that is not visited. In this case, the lunch is never taken and the lunch node becomes its own component{ not connected to any other node in the graph. Every non-lunch node is a member of exactly one circuit of the second type (the \body"). A part-time nurse may not be scheduled to visit any patients other than the dummy patient, in which case, the body consists of these two nodes forming a circuit. So, if a nurse travels to a lunch node from some patient or nurse node i, then it immediately travels back to the same patient or nurse node from which it came. This equates to a nurse taking his or her lunch break before providing service at the patient or nurse node i. Also, note that every nurse is required to visit at least one patient and every patient must be visited exactly once. Additionally, these constraints, taken with equation (18) allows the elimination of all the arcs out of the nurse node going to patients other than the dummy patient since the single arc out of the nurse is always xed. Constraints (6){(12) and (19){(21) enforce the time window and route constraints. Clearly, (12), (19) and (20) bound the variables y and z within the appropriate time window feasibility constraints. The constraints (6){(11) are variations on the Miller-Tucker-Zemlin (MTZ) [13] subtour elimination constraints adapted for our model to include lunch nodes. All of these constraints are trivially true if any of the x variables on the right hand side of the constraint equal zero. Thus, they are equivalent to the following:

xij = 1 ) yi + tij  yj xin = 1 ) dL n xL n n + yi + tin  zn; xij = 1 ) y j + d j  yi ; xim = 1 ) yL n + dL n  zn ; xij = xjk = 1 ) yi + tij  yk ; xin = xnL n = 1 ) yi + tin  yL n ; ( )

( )

( )

( )

( )

( )

i 2 N [ P; j 2 P; i 6= j i 2 P; n 2 N i 2 P; j 2 L n2N i 2 N [ P; j 2 P; k 2 L; i 6= j i 2 P; n 2 N

(22) (23) (24) (25) (26) (27)

Note that if a lunch node m is connected to some patient node j , then the start of lunch 8

(ym) must be at least the length of that lunch (dm) before the start time at node j (yj ). In such a case, there must be some non-lunch node i such that the arc from i to j is traversed as well, thus the start time of lunch ym must also be at least as large as yi + tij since service at patient j may begin immediately after lunch. If a lunch node m is connected to its corresponding nurse node n, then the lunch must be taken after the last patient visited by that nurse and before the end of the nurse's shift (zm ). We also adapted the extensions to the MTZ constraints developed by Desrochers and Laporte [5] and found that the addition of these to our formulation generally improved performance of the solvers on the model. The inequalities in (14)-(15) describe overtime for full-time nurses and limit the length of any nurse's shift to no longer than MSL, the maximum shift length. Constraints (16)-(17) are shortest paths constraints that are needed to restrict the solution set to routes that contain only one nurse, one lunch (when scheduled to visit more than just the dummy patient), and patients which that nurse is permitted to visit. To understand the derivation of these inequalities, suppose xi 2 f0; 1g for i 2 S  V and that they satisfy conditions (2) to (5). As we have seen above, this induces a graph that is a collection of \cycles with tails", cycles and isolated nodes. We can ignore any isolated lunch nodes and the corresponding nurse{dummy patient circuits, since those are clearly feasible routes which correspond to the nurse not being scheduled at all. Now consider this reduced graph. Suppose there is a component that does not contain a nurse-node. Consider the \body" of the component. Let this directed cycle be (v ; v ; : : : ; vq ). (Each of these vertices is a patient-node.) Then condition (6) implies that yv1 = yv2 =    = yvq . Hence tv1 ;v2 = tv2 ;v3 =    = tvq ;v1 = 0. This is impossible. Thus, there must be at least one nurse node in every component; and since each nurse node is connected to at least one patient by (18), there is at least one patient in every component as well. We would like to show the following: The graph is a collection of cycles with one tail and each contains exactly one nurse-node; only compatiable nodes are allowed to be in the same component with the corresponding nurse node. Let we = 1 ? xe . Let v a particular nurse-node and u be any other node. Then they are in the same component if and only if there exists a path of weight 0 from v to u. Since the weight function is integral, if a path is not of weight 0, it is of weight at least 1. So they are in di erent components if and only if the shortest path from v to 1

9

2

u is at least 1. Let ft : t 2 V g be a set of values, known as feasible potentials, satisfying b ? a  wa;b for every edge (a; b). Then it is well-known (and easy to show) that the value of a shortest path from v to u is at least u ? v . Hence if we have a set of feasible potentials with the extra condition that u ? v  1, then u and v are in di erent components. This observation gives us conditions (16) and (17). Since no two nurse-nodes are compatible, each component has exactly one nurse-node. Since each nurse-node is compatible to only one lunch-node and the number of lunch-nodes is equal to the number of nurse-nodes, each component has exactly one tail as required. Moreover, now that the graph has the appropriate shape to de ne the routes for each nurse, it is easy to show that the variables y and z have the correct interpretation in our model.

2.3 Triple{Indexed formulation An alternate formulation can be de ned using much of the same notation and a graph G = (V; A ) where the nodes remain the same as in the rst formulation, but the arcs are de ned di erently. An ordered triple (n; i; j ) is feasible if n is a nurse node and i and j are both nodes which n is permitted to visit and the ordered pair (i; j ) is time window compatible. Thus, there is one arc de ned for every feasible triple (n; i; j ) in the new graph G . The x variables are now de ned on the arcs of the graph G , so that xnij = 1 if nurse n travels from node i to node j , and xnij = 0 otherwise. (Such a solution could be made feasible for the double{indexed formulation with the following assignment: xij = Pn N xnij .) The constants remain the same as in the two-index formulation and the y, z, and s variables remain the same. The  variables are no longer needed in this new graph, since we can require that the routes be kept feasible without the use of the shortest paths constraints. The mixed integer programming problem de ned on this graph is as follows: 0

0

0

0

2

Minimize

X (z ? y + s ? d ? SL) + X (z ? y ) n n n n n Ln

n F

( )

2

n H

(28)

2

subject to

xniL n ? xnL n i = 0; n 2 N; i 2 (N [ P ) \ Bn x((L(n))) = x((L(n))) = 1 n 2 F ( )

( )

10

(29) (30)

x((L(n))) = x((L(n))) = (1 ? xnDP n n ) n 2 H x((n)) ? xnnL n = x((n)) ? xnL n n = 1; n 2 N X X x((i)) ? xniL n = x((i)) ? xnL n i = 1 i 2 P ( )

( )

Xx

( )

( )

( )

X x ; n 2 N; i 2 P \ B nij n j Bn j Bn X x  0; n 2 N; i 2 P \ B xnL n i ? xnni ? nji n j P Bn X y + t ? y  (b + t ? a )(1 ? x ); i; j 2 P; i 6= j n N

n N

2

nji

2

=

2

(31) (32) (33) (34)

2

( )

2

i

ij

j

(35)

\

i

ij

j

nij n N dL(n)xL(n)n + yi + tin ? zn  (dL(n) + bi + tin ? an)(1 ? xnin);

(36)

2

i 2 P; n 2 N (37) yL n + dL n ? yi  (bL n + dL n ? ai)(1 ? xniL n ); i 2 P; n 2 N (38) yL n + dL n ? zn  (bL n + dL n ? an)(1 ? xnnL n ); n 2 N (39) yn ? yL n  (bn ? 21 aL n )(1 ? xnDP n L n ); n 2 N (40) 6= j yi + tij ? yL n  (bi + tij ? 21 aL n )(2 ? xnij ? xnjL n ); n 2 N; i; j 2 P \ Bni(41) yi + tin ? yL n  (bi + tin ? 21 aL n )(2 ? xnin ? xnnL n ); n 2 N; i 2 P \ Bn ;(42) yn  yDP n ; n 2 N (43) yn + d L n  z n ; n 2 F (44) yn  z n ; n 2 H (45) zn ? yn + sn ? dL n ? SL  0; sn  0; n 2 F (46) zn ? yn  MSL; n 2 N (47) xnnDP n = 1; n 2 N (48) a n  yn ; z n  b n n 2 N (49) a i  yi  b i ; i 2 P [ L (50) xe 2 f0; 1g; e 2 A (51) ( )

( )

( )

( )

( )

( )

( )

( )

( )

( )

( )

( )

( ) ( )

( )

( )

( )

( )

( )

( )

( )

( )

( )

( )

0

This MIP is almost exactly like the rst formulation, with only the necessary modi cations to the x variables and the substitution of a smaller set of constraints for the shortest path constraints which contain the  variables. The objective (28) is exactly the same as (1). Constraints (29)-(33) correspond to constraints (2)-(5) in the rst model. The inequalities in (34) require for each node that the amount of ow entering the node from any nurse n 11

must equal the ow out of that node from nurse n. The next constraint, (35), then forces the upper bound on any arc from a lunch node to a feasible node i to be bounded by the amount of ow coming into node i from the nurse n corresponding to that lunch node. Thus, a lunch node can only be assigned to a route at node i which is being serviced by the appropriate nurse. These two simple sets of constraints in this new graph eliminate the need for the shortest path constraints. Constraints (36)-(42) correspond to the time window and route constraints (6)-(11) with only the necessary adjustments to the x variables. The equivalence of the remainder of the MIP to constraints of the rst model is clear. Both of these formulations are large. Let n be the number of nurses and p be the number of patients. Then the number of variables in the rst formulation is O(p ) and the number of constraints is O(np ). In the second formulation the number of variables and the number of constraints is O(np ). The more constrained the problem is, the fewer variables are needed since in such a case there will be fewer feasible nurses between pairs of nodes. In general, the second formulation contains more integer variables, no  variables, and fewer constraints. 2

2

2

3 Heuristics The heuristic which we have chosen to implement is a very natural two{phase algorithm. The rst phase of the heuristic falls into the category of a parallel tour{building procedure since it typically builds several routes simultaneously. The second phase attempts to make improvements on the tours identi ed in phase one. A few important observations about this problem need to be made before describing the heuristic itself. First, note that the time windows are assumed to be \hard." In other words, if a nurse arrives at a patient's home prior to the earliest start time, ai, then it must wait at that patient until the beginning of the time window before it may start servicing the patient. Similarly, service absolutely must begin by the latest start time, bi . And nally, recall from the formulation that for patient j to follow patient i on some nurse's route, the starting times, yi and yj , at i and j , respectively, must satisfy the following conditions: ai  yi  bi ; aj  yj  bj ; yi + tij  yj . In the rst phase of our heuristic, feasible schedules, that is, collections of tours for each nurse, are generated using a randomized greedy algorithm. Some of these schedules may not 12

even be feasible, in that all the patients may not be visited, but as schedules are generated, the algorithm maintains the best schedule. The basic structure of the heuristic is such that given an ordered list of patients, a patient is selected from the beginning of the list and added to the end of some nurse's route. Since lunch breaks as well as patients need to be included in routes, the decision whether or not to take a lunch break before visiting a patient is taken into account while deciding the feasibility of adding a patient to a route. Thus, the algorithm maintains a set of nurses and the corresponding tour listing the patients and lunches in the order that they are to be visited. A schedule is deemed better than the current best schedule if (1) there is no current best schedule, (2) the number of unscheduled patients in the schedule is smaller than the corresponding number in the current best schedule, (3) if the number of scheduled patients is the same in both schedules, but the new schedule has less scheduled overtime and part{time, or (4) the number of patients scheduled and the sum of overtime and part{time are the same in both schedules, but the amount of regular time or part{time scheduled is smaller than the current best schedule's regular time or part{time. The randomized elements of the algorithm are the way in which the patients are ordered and the way in which the feasibility of a patient at the end of a nurse's schedule is determined. In the case of the patient list, the patients are rst sorted by their time window lower bounds. The patient list is then taken to be this sorted list or it is sectioned into intervals such that within each interval the patients are randomly reordered. Let p be the total number of patients. Then the intervals are taken to be p, p/10, p/5, 11, 13, 14, 17, or a random number between 10 and 25. These numbers were determined through computational experimentation on our data sets. The feasibility involved in adding a patient to the end of some nurse's route involves the necessary conditions stated previously for time window feasibility and the compatibility requirement that the nurse be allowed to visit the patient. Beyond these conditions, it is possible to limit the amount of waiting time allowed at a node. By randomizing the choice of this parameter, we can make it more or less dicult to nd a feasible solution. In our data sets we found that the algorithm worked well picking this parameter randomly from the set f0, 20, 40, 60, 80g. In other words, if the parameter is equal to 0 for some iteration of the heuristic, then it will not allow any waiting time as it attempts to build the current schedule for that iteration. This parameter is also used in 13

determining if a lunch break should be taken prior to a newly added patient on the route. When considering whether or not a patient may be added to the end of a given nurse's route, two times are calculated. The rst is the starting time at that patient if lunch is taken before service may begin, and the second is the starting time at that patient if lunch is not taken before service. Clearly, if the nurse has already had a lunch break previously scheduled on the route, then the rst time need not be considered. Otherwise, if the di erence between the rst and second time is less than or equal to the wait time parameter, then the option including the lunch before the patient is selected. The heuristic is weighted in such a way that it tends to schedule the lunches as early as possible in the routes. Once a schedule is found with the randomized greedy algorithm, the second phase of our heuristic attempts to nd improvements to this solution. Each time a re{solve is referred to in this phase, it refers to sending a problem with possibly xed elements of the schedule and a known current best solution back to the phase one algorithm. First, a form of local search is performed in the following manner:

 Select 2 nurses, i and j , such that at least one nurse is scheduled to work overtime or part{time.

 Free the patients on both nurse's routes while xing all other patients in the schedule.  Re{solve, both allowing and disallowing the nurses i and j to be scheduled.  Keep the best known schedule created thus far. The idea behind this procedure is to provide local x{ups in small portions of the solution. Next, an attempt is made to improve the current best solution by tightening the schedule. For each scheduled nurse, determine the rst point in his/her route that the nurse is forced to wait. Fix all of the patients on the route prior to this point and free all of the rest. So, if a route has no waiting time, then all of the patients are xed along that route. Note that other patients may be added at the end of the route prior to the nurse's return trip home. This reduced problem can now be re{solved. At this point in the heuristic, the question is asked whether or not there are still unscheduled patients in the best known solution. If the answer is yes, then there are two procedures, 14

Randomized tour generator

Tighten schedule & re-solve

Free subset of patients & re-solve

Unscheduled Patients? No

Yes

Tour minimizer

Reduce wait time

Insert

No

Shuffle

Isolated patient swap

Unscheduled Patients? Yes

DONE

Figure 2: This owchart describes the steps involved in the heuristic.

15

insert and shue, which are performed in an attempt to schedule all of the patients. The insert procedure is a very basic attempt to insert each unvisited patient into feasible nurse's routes. Typically this procedure is not especially bene cial, so it becomes necessary to shuf e other patients around to make room for the unvisited patient. The shue procedure in this heuristic considers each feasible nurse n for each unvisited patient, plost, until either all feasible nurses for plost have been considered or plost is placed in some route. For this nurse n, consider each patient p on n's route. If it is possible to insert p into some other nurse's route, then do the insertion, followed by a check to see if plost can now be inserted into nurse n's route. If plost was inserted into the schedule, then the shue procedure succeeded in this case and continues with the remaining unvisited patients. If plost was not inserted, then advance p to the next patient on the route (or if no other patients on the route, consider the next feasible nurse's route) and repeat. Now, the question of whether all the patient have been scheduled is asked again. If there still exists unscheduled patients, the algorithm terminates and reports the incomplete schedule. Otherwise, it continues with the tour improvement procedures that it performs if the schedule is complete without the insert and shue procedures. The rst of these is a procedure aimed at minimizing the time schedules for the given tours. The time schedule for each nurse's tour is made to be minimal by using the results on optimality of a time schedule by Florkiewicz and Kulej [9]. At the same time, a check is made to see if the lunch should be moved forward in the schedule. Recall that the rst phase of the heuristic favors inserting lunches as early as possible. Sometimes a route can be greatly improved by simply moving the lunch forward by one patient. So, without changing the order a nurse visits assigned patients the actual time may be reduced. The second procedure seeks to reduce the maximum waiting time at a patient so long as that patient is visited by a part{time nurse. Given a schedule, the patient with the maximum waiting time by the nurse assigned to him or her is determined. If that patient is visited by a part{time nurse, then reducing the waiting time by that nurse can reduce the overall amount of part{time labor required, so it is sent to the procedure. Similarly, if the patient is visited by a nurse that works overtime, then there exists the possibility of reducing the amount of overtime. If removing this patient from his or her assigned nurse reduces the 16

amount of part{time or overtime in the nurse's tour, then the patient is removed. Then, if the patient can be inserted into another feasible nurse's schedule with a cost in terms of part{time and overtime which is less than the initial gain, the reduction is complete. If not, then the patient is returned to the original nurse's tour. If there is only one other patient on the nurse's tour, then this patient can be removed and tested for a better insertion place in an attempt to improve the overall solution, as well. This procedure can be called repeatedly, so long as the total amount of overtime and part{time labor in the best solution is reduced at each step. At the end of the loop to reduce the maximum waiting time, the abovementioned tour minimizing procedure is run on the best solution. The last procedure is labeled as an isolated patient swap. Oftentimes, the procedure to reduce wait times will contribute to the creation of tours in which nurses visit only one patient. This procedure takes such isolated patients and attempts to insert them into other feasible nurse's tours. If inserting the patient into the tour makes the new tour feasible and reduces the objective value, then the procedure ends. Otherwise, the new tour was made infeasible, and it is checked to see if moving one of the original patients onto the schedule of the nurse that was assigned to visit the isolated patient is a feasible option. If this swap is feasible and improves the overall solution, than it is performed. The entire process is repeated while improvements are found. At the end, the tour minimizing procedure is once again applied to the best solution.

3.0.1 Results from Heuristic We tested our heuristic on two types of data sets. The rst type of data we randomly generate using the following rules: 1. All lunch breaks have a length of 60 minutes. 2. The (x; y){coordinates of the nurses' and patients' homes are supplied by the user. The traveling time between two points is an adjusted Euclidean distance. To be precise, the times are adjusted so that all of the traveling times are between 10 minutes and 60 minutes. 17

3. The service time required at each patient is chosen at random from 10 minutes to 30 minutes with 5 minutes as the step size. 4. The patient time windows are chosen at random from [0, 120] to [840, 1020] with 60 minutes as the step size. 5. To increase the chance of the existence of a feasible solution, a predetermined number of part-time nurses (usually one) have [0, 1440] as both the work time window and the lunch time window. Furthermore, they are compatible with every non{dummy patient. 6. The time windows for all other nurses are chosen at random from [0, 960] to [480, 1440] with 60 minutes as the step size. 7. The lunch time windows for these nurses depend on the corresponding nurse's time window. If [a; b] is the nurse's time window, then the lunch time window for the nurse is de ned to be [a + 120; b ? 120]. 8. Given a nurse and a patient, the probability of them being compatible is 1/2 (unless the nurse is one of the part-time nurses already de ned to be compatible with all non{dummy patients). We ran our test data on a Sun UltraSparc I 143 MHz machine with 128 MB of memory. The largest problem instance of this type that CPLEX was able to solve using the MIP solver contained 2 regular nurses, 2 part-time nurses, and 10 patients. With dummy patients and lunch nodes, this corresponds to a problem on a graph with 22 vertices. We tested the heuristic on 40 di erent problem instances generated with 10 di erent seed values for 4 di erent input les. Since the heuristic takes a random seed as input each time it is run, we used three di erent seed values to generate three solutions for each problem instance. The best solution value out of the three runs is reported in Table 1 under \Heuristic Best." The optimal value and the time CPLEX required to determine it are reported next, and nally the percentage optimality gap between the heuristic value and the optimal value can be found in the last column. The time the heuristic took to run is less than a second in all cases. 18

Unfortunately, it is not possible to evaluate the heuristic's performance on larger data sets, since we have no means to determine the optimal solution in such cases. We do, however, have three problem instances that were given to us by the Fortune 500 company which originally brought us this problem. These are generated instances, as well, but details on the rules used to generate them were not provided. We do know that this company developed its own heuristic for the problem as well, and their method was able to nd a solution for instance A with some diculty, could not determine if instance B is solvable; and solved instance C easily. From the results in Table 2, it appears that our heuristic did at least as well as the company's heuristic. Neither method could nd a solution for instance B, but in our case, we could supply a partial solution that excludes only 6 out of 900 patients.

4 Remarks The CPLEX results presented in the previous section are obtained using the triple-indexed formulation. For our test data, this formulation performed better than the double-indexed formulation (usually more than ten times faster). This is somewhat surprising since the triple-indexed formulation has more integer variables. The increased diculty encountered in the two{indexed formulation appears to be caused by the SPP constraints which are not needed in the three{indexed formulation. Since this is a generalization of the symmetric traveling salesman problem (STSP), it is natural to borrow the known cutting planes from the STSP for our problem. (Although these problems are equivalent as they are both NP Hard, the reduction from STSP to our problem is a natural one.) In the next section, we outline these cutting plane procedures.

4.1 Cutting Planes In this section, we make use of the results on the STSP. Let (x; y; z) be a feasible solution to the mixed integer program. (When considering formulation two, let xij = Pn N xnij over pairs of nodes, i and j , so that the vector x is de ned over pairs of nodes, rather than triples.) Let G be the graph induced by x with the removal of all lunch nodes and connected edges. If the graph has a component that is a cycle of patients, it is called a subtour. Although our 2

19

formulation guarantees the exclusion of subtours in an integer solution, it is well-known that these constraints produce a weaker LP relaxation than the typical STSP subtour elimination constraints which can be written as x((S ))  2 [5]. For our directed graph, this translates to the pair of constraints x((S ))  1 and x((S ))  1 for S  P . It is easy to see that only x((S ))  1 is necessary in our problem. Once we have identi ed all the nurse-nodes, the separation problem for the subtour elimination constraints is a standard application of any max ow algorithm. Theoretically, these subtour inequalities could be strengthened by letting the right hand side equal the minimum number of nurses needed to visit the set S , but this is not a trivial value to nd. A lower bound on this value can be determined based solely on the minimum number of nurses that can cover the set S based on compatibilty information. So, this bound could be found by solving an LP relaxation of an integer programming problem which minimizes the number of nurses subject to every patient having at least one nurse which may visit it. This was not used in our test cases since we designed the problems so that at least one part-time nurse was feasible for every patient, thus making the right hand side lower bound always equal to one. Like the STSP, our next set of constraints are the blossom inequalities. Blossom inequalities are a subset of the more general comb inequalities which we now describe. Given H , a subset of the vertex{set known as the handle, and Ti (i = 1; 2; : : : ; 2k + 1), subsets of the set of patient{nodes known as the teeth, then

x( (H ) +

k k X X x( (T ))  jH j + (jT j ? 1) ? (k + 1)) 2 +1

2 +1

i=1

i

i=1

i

is a valid inequality. The Chvatal-Gomory procedure for proving its validity is essentially the same as the one for the STSP. If every tooth is of size two, we have the blossom inequalities. Let A be the set of edges corresponding to the teeth, then the blossom inequalities can be written as:

x((H ) n A) + (jAj ? x(A))  1: To separate the bloosom inequalites, we mimick the technique of Padberg and Grotschel [14]. To modify this procedure to our problem, though, we may not simply identify all of the nurse nodes. The separation algorithm preceeds as follows: Find the components of the 20

graph induced by x, with directions ignored. It is easy to see that there is a violated blossom inequality if and only if there is a violated blossom inequality in a component. For each of the non-cycle components (A cycle component must be a valid schedule for a nurse since G has no subtour.), we will determine whether there is a violated blossom inequality in it. Let H be the undirected graph obtained from a component by deleting direction on all the edges and by replace multiple edges with a single edge whose weight is the sum of the weights of the edges that it replaces. Note that in H , an edge may have a weight greater than one. But at least one of its ends is a nurse-node since there is no violated subtour inequality. For the STSP, the procedure of Padberg and Grotschel transforms H into H by replacing every edge (v; w) with weight xe by three edges (v; u ) with weight xe, (u ; u ) with weight 1 ? xe and (u ; w) with weight xe where u and u are new vertices, known as subdivision vertices. Let T be the set of subdivision vertices. In the STSP, the separation problem for the blossom inequalities can be solved by nding a minimum T -cut in H . In our case, the only adjustment necessary is to replace the weight of (u ; u ) by 1 if either v or w is a nurse-node. We note that this corresponds exactly to those edges that may have weights greater than 1. Then, as in STSP, an separation problem for the blossom inequalities can be found by nding a minimum T -cut in H . We note that this is correct since in the STSP case, a subdivision edge (u ; u ) is in the cut corresponding to the edge (v; w) being a tooth. Hence the vertices of all our teeth are patient{nodes. In actuality, our implemenation works on a smaller graph achieved by replacing edges with only two, rather than three edges, as suggested by Padberg and Grotschel [14]. Finally we consider comb inequalities. As in the STSP, if S is a set (in our case S  P ) and S is tight with respect to our subtour inequalities, that is, x( (S )) = x((S )) = 1, then we can contract S to a single node. Moreover, if there is a violated blossom inequality in the reduced graph, there is a violated comb inequality in the original graph. We use the heuristics of Grotschel and Holland [10] when choosing such an S . In our cutting plane implementation, the max ow code is taken from an implemenation written by R. Andersen and J. Setuball [1]. Although this set of separation procedures are known to work well for the STSP, it does not produce the desired e ect here. For the examples that we have tried, although many violated inequalities are found over the entire branch{and{bound search tree, only 1

1

2

1

1

2

1

1

1

1

2

21

2

2

a handfull are found in each iteration. Moreover, about 10% of these actually changed the objectice function value in the triple-indexed formulation, and 4% of these violated inequalities actually changed the objectice function value in the double-indexed formulation. Perhaps more disappointing is the fact that in these examples, the total number of search nodes with or without cutting planes are essentially the same. So it appears that such a natural implementation of the cutting plane procedures is not e ective in this setting.

References [1] Anderson, R.J., and J.C. Setubal. Goldberg's algorithm for maximum ow in perspective: a computational study. In Network Flows and Matching, DIMACS Series in Discrete Mathematics and Theoretical Computer Science, Vol 12, eds D.S. Johnson and C.C. McGeoch (eds.), American Mathematical Society, 1993, 1{18. [2] Carpaneto, G., Dell'Amico, M., Fischetti, M., and Toth P., A branch and bound algorithm for the multiple depot vehicle scheduling problem, Networks, 1989, 19, 531{548. [3] Caseau, Y., and Koppstein, P., A Coopearative-Architecture Expert System for Solving Large Time/Travel Assignment Problems. In Database and Expert Systems Applications, Proceedings of the International Conference in Valencia, Spain, eds A. Min Tjoa and I. Ramos, Springer-Verlag, Wien, 1992, 197{202. [4] Chao, I.-M., Golden, B.L. and Wasil, E. A new Heuristic for the Multi-Depot Vehicle Routing Problem that Improves upon Best-Known Solutions, American Journal of Mathematical and Management Sciences, 1993, 13, 371{406. [5] Desrochers, M. and Laporte, G., Improvements and Extensions to the Miller-TuckerZemlin subtour elimination constraints, Operations Research Letters, 1991, 10, 27{36. [6] Desrochers, M., Lenstra, J.K., Savelsbergh, M.W.P. and Soumis, F., Vehicle routing with time windows: optimization and approximation. In Vehicle Routing: Methods and Studies, eds B. Golden and A.A. Assad, North-Holland, Amsterdam, 1988, 65{88. 22

[7] Desrosiers, J., Dumas., Y, Solomon, M. and Soumis, F., Time Constrained Routing and Scheduling. In Handbooks in Operations Research and Management Science, Vol. 8, eds M.O. Ball, T.L. Magnanti, C.L. Monma and G.L. Nemhauser, Elsevier Science, Amsterdam, 1995, 35{129. [8] Fisher, M.L., Vehicle Routing. In Handbooks in Operations Research and Management Science, Vol. 8, eds M.O. Ball, T.L. Magnanti, C.L. Monma and G.L. Nemhauser, Elsevier Science, Amsterdam, 1995, 1{34. [9] Florkiewicz, B., and Kulej, M., Feasibility and optimality of time schedules in vehicle routing and scheduling problem with time window constraints, Central European Journal of Operations Research and Economics, 1993, 2, 65{78. [10] Grotschel, M. and Holland, O., Solution of large-scale symmetric travelling salesman problems. Matematical Programming 1991, 51, 141{202. [11] Laporte, G., Nobert, Y., and Arpin, D., Optimal Solutions to Capacitated Multidepot Vehicle Routing Problems, Congressus Numerantium, 1984, 44, 283{292. [12] Laporte, G., Nobert., Y, and Taillefer, S., Solving a Family of Multi-Depot Vehicle Routing and Location-Routing Problems, Transportation Science, 1988, 22, 161{172. [13] Miller, C.E., Tucker, A.W. and Zemlin, R.A., Integer programming formulations and traveling salesman problems, J. ACM, 1960, 7, 326{329. [14] Padberg, M.W. and Grotschel, M., Polyhedral Computations. In The Traveling Salesman Problem, eds E.L. Lawler, J.K. Lenstra, A.H.G. Rinnooy Kan and D.B. Shmoys, Wiley, Chichester, 1985, 307{360.

23

Table 1: Heuristic results on data sets with 2 full{time nurses, 2 part{time nurses, 10 patients Heuristic Cplex Heuristic Cplex Case Best Opt sec. Gap Case Best Opt sec. Gap 1 689 652 219.69 5.7 21 426 409 713.58 4.2 2 967 896 1966.61 7.9 22 312 312 242.70 0.0 3 402 396 687.23 1.5 23 458 458 743.12 0.0 4 360 360 180.27 0.0 24 302 302 219.89 0.0 5 456 456 438.25 0.0 25 312 260 447.81 20.0 6 378 354 617.29 6.8 26 557 503 196.13 10.7 7 471 451 306.57 4.4 27 427 427 319.02 0.0 8 622 588 56.09 5.8 28 445 445 812.93 0.0 9 485 485 288.18 0.0 29 385 337 119.44 14.2 10 527 517 224.88 1.9 30 346 286 327.43 21.0 11 564 551 352.94 2.4 31 528 515 414.07 2.5 12 483 483 400.21 0.0 32 445 445 103.62 0.0 13 557 547 522.11 1.8 33 440 440 966.26 0.0 14 410 351 161.05 16.8 34 364 328 303.82 11.0 15 312 296 391.35 5.4 35 289 241 402.62 19.9 16 508 463 473.28 9.7 36 409 409 410.64 0.0 17 403 403 456.68 0.0 37 404 404 200.79 0.0 18 477 477 735.57 0.0 38 487 487 1229.71 0.0 19 320 307 193.91 4.2 39 323 279 379.69 15.8 20 274 274 320.81 0.0 40 270 267 1062.36 1.1 Table 2: Heuristic results on outside company data sets Case num-nurses num-patients unvisited time (sec) A 30 96 0 1.0 B 229 900 6 78.0 C 294 900 0 100.0 24