View
230
Download
0
Embed Size (px)
Citation preview
A Hospital Placements Allocation Problem
Stephen Cresswell
and
Lee McCluskey
(paper to be presented at PlanSIG 2005)
Introduction
• Problem belongs to University of Huddersfield’s course on Operating Department Practice (ODP).
• 1st year students are sent on 6 placements to hospitals in Yorkshire.
• Previously, each student has been allocated to a single hospital for the year – so hospitals have taken the responsibility for organising a suitable programme.
Introduction (2)
• ODP wanted to organise placements centrally.– Don’t want the hospitals to ‘own’ the students.
– Work around bottlenecks to increase the capacity of the course.
• A side-effect of this change is that allocating students to placements has become a problem too difficult to manage without computer support.
• In the rest of the talk describe the problem and our approaches to solving it.
The placements problem
• We tackle the problem of allocating 1st year of ODP course.– 60 students (approx.)
– 11 hospitals
– 6 timeslots
– 4 specialities, from which each student takes any 3. For each speciality selected, the student has 1 anaesthetic placement and 1 surgery placement.
Constraints
• Capacity: Each hospital has a limited capacity (usually 0-2) for the number of placement students that can be accepted in each speciality.
• Reachability of hospitals: Hospital must be within reasonable commuting distance from home location of student.
• Non-repetition: Each of 6 placements is in either anaesthetics or surgery in one of 4 specialities.
• Alternation: A student should not have – 2 consecutive placements of anaesthetic, or – 2 consecutive placements of surgery.
Example allocationStudent t1 t2 t3 t4 t5 t6
1 BUPA BUPA Dewsbury Dewsbury LGI LGI
Ortho Ortho General General Gynae Gynae
Surgery Anaesth Surgery Anaesth Surgery Anaesth
2 Bradford Bradford Calderdale Calderdale Bradford Bradford
Ortho Ortho Urology Urology General General
Anaesth Surgery Anaesth Surgery Anaesth Surgery
3 …
Simplifying assumptions
• Pair timeslots so that students take – Surgery then Anaesthetic, or – Anaesthetic then Surgery
in the same speciality.
Student has same phase for all placements.
• We then have 3 timeslots, and we must allocate 3 from 4 specialities.
Goals
• Can we produce an allocation of students to placements which meets all the constraints?
• How many more students can be accommodated under the central placements system?– The availability of placements is the main
factor limiting the expansion of the course.
Model
• Symbols:h - hospital, st - student,sp - speciality, t - timeslot, ph - phase
• cap(h,sp)– Integer capacity of hospital h in speciality sp
• reachable(st)– Set of hospitals reachable by student st
• alloc(st,t)– Allocation of student st at time t, – Allocation is tuple <h,sp,ph>
Model: Capacity
• Number of students allocated to a particular hospital, speciality and phase is within available capacity.
),(,,),(:.... sphcapphsphtstallocsttphsph
Model: Reachability of hospitals
• Student can only be allocated to reachable hospitals
)(
,,),(..
...
streachableh
phsphtstallocphsp
htst
Model: Non-repetition
• Don’t repeat same speciality – i.e. set of student’s allocated specialities has
unique element for each time slot.
3,,),(...:. phsphtstallocphhtspst
Model: Alternation
• Phase for student matches allocation for student in all timeslots:
phsphtstallocsphtphst ,,),(.....
Related Problems
• Scheduling
• Timetabling
• Hospitals residents problem
3 approaches
• Programmed heuristic solution– Depth first search with a priori ordering of variables.
• Constraint programming– Generalisation of programmed heuristic solution
– Propagate constraints to maintain domains of variables
• Integer linear programming– Modelled relaxed version of problem.
– Mainly useful for giving bound on optimal solution.
Programmed heuristic solution
• For each alloc(st,t) we have a Prolog term t(H,Sp), where H and Sp are initially uninstantiated variables.
• Use Prolog built-in depth-first search with heuristic ordering determining solution order for students.
• Constraints checked as allocations made:– Capacity: total for of each <h,sp,ph,t> tracked.– Alternation: checked via phase variable for each
student.
Constraint Programming
• A finite domain variable for each alloc(st,t).• Each tuple <h,sp,ph> represented by an integer
value.• Constraint types:
– Capacity - ‘atmost’ constraint
– Reachability - a priori pruning of domain
– Non-repetition - ‘alldifferent’ constraint
– Alternation - element constraint linking a phase variable for student with indexes of compatible tuples.
Constraint Programming
• Post constraints first, then impose search strategy.• Finds schedule with (almost) no backtracking.• Default search strategy was “fail first” heuristic.
– Select variable with smallest domain.– Not so different from heuristic used in Prolog prog.
• There are some symmetries - e.g. between timeslots and between some sets of students. We didn’t try breaking those symmetries.
• (Implemented in Oz).
ILP model
• Integer linear programming can be used where all constraints can be expressed as linear (in)equalities
• Tools:– eclipse + xpress-mp– Oz + lp_solve
• Model is a bit different, using alloc(st,h,sp,t), which is solved for 0 or 1
• Various relaxations of the problem tried.
ILP model
• An allocation for each student in each timeslot
• Capacity
st
sphcaptsphstalloctsph ),(),,,(...
1),,,(.. h sp
tsphstalloctst
ILP model
• Non-repetition
• Reachability
h t
tsphstallocspst 1),,,(..
0),,,(..
)(..
tsphstalloctsp
streachablehhst
ILP summary
• Phase constraints are not naturally encoded as linear inequations, so not all constraints handled.
• Solving a relaxed version of the problem is good for detecting infeasibility. Relaxations:
Integer/continuousIgnore phase (A-S or S-A)
• Appropriate for optimising an objective function rather than finding any feasible solution.
Initial results
Table shows #students in largest solved prob.
Prog.
heuristic
CLP ILP for
Relaxed prob.
Prob1 66 69 73
Prob2 71 72 75
Optimal Optimal
Initial results (2)
• Programmed heuristic solution is faster.• CLP approach found solutions for more students.• Prolog and CLP programs, used very similar
heuristics– Prolog a priori ordering of students according to
number reachable hospitals
– CLP program used ‘fail first’ heuristic – dynamically ordering variables to select var with smallest domain – i.e. the smallest choice of <hosp,sp,ph> tuples.
Extra Constraints
• After discussing initial results with ODP course organisers, additional constraints emerged:– Student preferences: Students select 3 hospitals in order
of preference.– Fluctuating capacity (capacity varies over timeslots).– Flexible phase (capacity to be distributed over phases).– Extra specialities (12 instead of 4).– Combined specialities (e.g. gynae & urology).– Even distribution of allocation.– Forced moves.
Delivered system
• Constraint programming:– Variable ordering heuristic: fail-first
– Value ordering heuristic: Student preferences, then random.
– Search algorithm: biased towards revising choices near root of search tree, c.f. Depth-Bounded Discrepency Search.
• User-friendly interface.• Implemented in Mozart/Oz.
Summary & Discussion
• We have tackled an allocation problem arising in a real application.
• A relatively simple constraint model has been adequate for finding feasible solutions.
• This approach has also been flexible enough to adapt to changing user requirememts.
Further Work
• Compare other solution techniques - e.g. evolutionary algorithms.
• Treat as optimisation problem with objective based on student preferences.
• Consider the problem of detecting infeasible sub-problems.
• Improve user interface to make mixed manual / automatic allocation easier.
Leftover slides
phsphtstalloctphsp
streachableh
hst
,,),(...
)(
..
Model Summary
• Capacity
• Reachability
• Non-repetition
• Alternation
),(,,),(:.... sphcapphsphtstallocsttphsph
)(
,,),(..
...
streachableh
phsphtstallocphsp
htst
3,,),(...:. phsphtstallocphhtspst
phsphtstallocsphtphst ,,),(.....
Extra Constraints
• Fluctuating Capacity: The capacity is dependent on time and phase.
• Capacity can be split between phases.
),,,(,,),(:.... tphsphcapphsphptstallocsttphsph
cmxtphasesphcaptphasesphcap ),2,,(),1,,(
Extra Constraints
Forced moves
21
2
1
21 ,,)2,(..
,,)1,(..
...
hh
phsphstallocphsp
phsphstallocphsp
hhst
Goals
• Can we produce an allocation of students to placements which meets all the constraints?– Yes!
• How many more students can be accommodated under the central placements system?– Current capacity of the course is 56 students.
– We can produce schedules for up to 69 students, assuming additional students can travel anywhere.
– There could be solutions up to 73 students.
(Old) Conclusions
• Problem is easy to solve for the number of students currently involved.
• Maximising number of students is more challenging.
• Software can be used for Huddersfield ODP problem, and hopefully also elsewhere.