34
A Hospital Placements Allocation Problem Stephen Cresswell and Lee McCluskey (paper to be presented at PlanSIG 2005)

A Hospital Placements Allocation Problem Stephen Cresswell and Lee McCluskey (paper to be presented at PlanSIG 2005)

  • View
    230

  • Download
    0

Embed Size (px)

Citation preview

Page 1: A Hospital Placements Allocation Problem Stephen Cresswell and Lee McCluskey (paper to be presented at PlanSIG 2005)

A Hospital Placements Allocation Problem

Stephen Cresswell

and

Lee McCluskey

(paper to be presented at PlanSIG 2005)

Page 2: 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.

Page 3: A Hospital Placements Allocation Problem Stephen Cresswell and Lee McCluskey (paper to be presented at PlanSIG 2005)

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.

Page 4: A Hospital Placements Allocation Problem Stephen Cresswell and Lee McCluskey (paper to be presented at PlanSIG 2005)

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.

Page 5: A Hospital Placements Allocation Problem Stephen Cresswell and Lee McCluskey (paper to be presented at PlanSIG 2005)

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.

Page 6: A Hospital Placements Allocation Problem Stephen Cresswell and Lee McCluskey (paper to be presented at PlanSIG 2005)

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 …

Page 7: A Hospital Placements Allocation Problem Stephen Cresswell and Lee McCluskey (paper to be presented at PlanSIG 2005)

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.

Page 8: A Hospital Placements Allocation Problem Stephen Cresswell and Lee McCluskey (paper to be presented at PlanSIG 2005)

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.

Page 9: A Hospital Placements Allocation Problem Stephen Cresswell and Lee McCluskey (paper to be presented at PlanSIG 2005)

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>

Page 10: A Hospital Placements Allocation Problem Stephen Cresswell and Lee McCluskey (paper to be presented at PlanSIG 2005)

Model: Capacity

• Number of students allocated to a particular hospital, speciality and phase is within available capacity.

),(,,),(:.... sphcapphsphtstallocsttphsph

Page 11: A Hospital Placements Allocation Problem Stephen Cresswell and Lee McCluskey (paper to be presented at PlanSIG 2005)

Model: Reachability of hospitals

• Student can only be allocated to reachable hospitals

)(

,,),(..

...

streachableh

phsphtstallocphsp

htst

Page 12: A Hospital Placements Allocation Problem Stephen Cresswell and Lee McCluskey (paper to be presented at PlanSIG 2005)

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

Page 13: A Hospital Placements Allocation Problem Stephen Cresswell and Lee McCluskey (paper to be presented at PlanSIG 2005)

Model: Alternation

• Phase for student matches allocation for student in all timeslots:

phsphtstallocsphtphst ,,),(.....

Page 14: A Hospital Placements Allocation Problem Stephen Cresswell and Lee McCluskey (paper to be presented at PlanSIG 2005)

Related Problems

• Scheduling

• Timetabling

• Hospitals residents problem

Page 15: A Hospital Placements Allocation Problem Stephen Cresswell and Lee McCluskey (paper to be presented at PlanSIG 2005)

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.

Page 16: A Hospital Placements Allocation Problem Stephen Cresswell and Lee McCluskey (paper to be presented at PlanSIG 2005)

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.

Page 17: A Hospital Placements Allocation Problem Stephen Cresswell and Lee McCluskey (paper to be presented at PlanSIG 2005)

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.

Page 18: A Hospital Placements Allocation Problem Stephen Cresswell and Lee McCluskey (paper to be presented at PlanSIG 2005)

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).

Page 19: A Hospital Placements Allocation Problem Stephen Cresswell and Lee McCluskey (paper to be presented at PlanSIG 2005)

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.

Page 20: A Hospital Placements Allocation Problem Stephen Cresswell and Lee McCluskey (paper to be presented at PlanSIG 2005)

ILP model

• An allocation for each student in each timeslot

• Capacity

st

sphcaptsphstalloctsph ),(),,,(...

1),,,(.. h sp

tsphstalloctst

Page 21: A Hospital Placements Allocation Problem Stephen Cresswell and Lee McCluskey (paper to be presented at PlanSIG 2005)

ILP model

• Non-repetition

• Reachability

h t

tsphstallocspst 1),,,(..

0),,,(..

)(..

tsphstalloctsp

streachablehhst

Page 22: A Hospital Placements Allocation Problem Stephen Cresswell and Lee McCluskey (paper to be presented at PlanSIG 2005)

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.

Page 23: A Hospital Placements Allocation Problem Stephen Cresswell and Lee McCluskey (paper to be presented at PlanSIG 2005)

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

Page 24: A Hospital Placements Allocation Problem Stephen Cresswell and Lee McCluskey (paper to be presented at PlanSIG 2005)

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.

Page 25: A Hospital Placements Allocation Problem Stephen Cresswell and Lee McCluskey (paper to be presented at PlanSIG 2005)

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.

Page 26: A Hospital Placements Allocation Problem Stephen Cresswell and Lee McCluskey (paper to be presented at PlanSIG 2005)

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.

Page 27: A Hospital Placements Allocation Problem Stephen Cresswell and Lee McCluskey (paper to be presented at PlanSIG 2005)

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.

Page 28: A Hospital Placements Allocation Problem Stephen Cresswell and Lee McCluskey (paper to be presented at PlanSIG 2005)

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.

Page 29: A Hospital Placements Allocation Problem Stephen Cresswell and Lee McCluskey (paper to be presented at PlanSIG 2005)

Leftover slides

phsphtstalloctphsp

streachableh

hst

,,),(...

)(

..

Page 30: A Hospital Placements Allocation Problem Stephen Cresswell and Lee McCluskey (paper to be presented at PlanSIG 2005)

Model Summary

• Capacity

• Reachability

• Non-repetition

• Alternation

),(,,),(:.... sphcapphsphtstallocsttphsph

)(

,,),(..

...

streachableh

phsphtstallocphsp

htst

3,,),(...:. phsphtstallocphhtspst

phsphtstallocsphtphst ,,),(.....

Page 31: A Hospital Placements Allocation Problem Stephen Cresswell and Lee McCluskey (paper to be presented at PlanSIG 2005)

Extra Constraints

• Fluctuating Capacity: The capacity is dependent on time and phase.

• Capacity can be split between phases.

),,,(,,),(:.... tphsphcapphsphptstallocsttphsph

cmxtphasesphcaptphasesphcap ),2,,(),1,,(

Page 32: A Hospital Placements Allocation Problem Stephen Cresswell and Lee McCluskey (paper to be presented at PlanSIG 2005)

Extra Constraints

Forced moves

21

2

1

21 ,,)2,(..

,,)1,(..

...

hh

phsphstallocphsp

phsphstallocphsp

hhst

Page 33: A Hospital Placements Allocation Problem Stephen Cresswell and Lee McCluskey (paper to be presented at PlanSIG 2005)

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.

Page 34: A Hospital Placements Allocation Problem Stephen Cresswell and Lee McCluskey (paper to be presented at PlanSIG 2005)

(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.