Algorithm to determine optimal availability for scheduling appointments with several resources

algorithmsscheduling

I’m working on a system where several resources are scheduled (users, rooms, and equipment). Each appointment is scheduled for a user, and may also take a room and/or equipment. Appointments are scheduled over time, slowly filling up the calendar. It’s thus not a classic scheduling problem where everything can be scheduled at once.

My problem is determining ‘optimal’ availability slots that clients may choose from when booking an appointment.

It’s easy to determine all availability slots: it’s the overlap of the availability for the requested user(s)/room(s)/equipment(s). However, I want to prevent introducing 5/10 minute gaps in the schedule that cannot be filled later.

Relevant properties of the system are:

  • A 5-minute interval is used
  • Different appointment types have different (predefined) lengths (multiples of 5 minutes)
  • Users/rooms/equipments can perform/have several appointments types with different lengths

The system should take this into account when determining availability slots that are offered for appointment bookings.

I think there is no ‘real’ optimal solution for this, since there are many factors and it’s not known in advance which appointments types will be scheduled later on. However, I want to prevent offering availability slots that introduce useless gaps (or other suboptimal situations) in the schedule.

I created a solution that only takes the availability of one resource (users) into account. It first determines the least common multiple (LCM) of the appointments durations the user can perform. It then generates availability slots in the total available time of that user, using the LCM as step size. This seems better than just offering all availability options at each 5-minute step, though it isn’t ideal. (E.g., if the LCM is high, few options will be offered.) Additionally, it doesn’t take the other resources (rooms/equipment) into account.

Are there any known algorithms/methods/best-practices for determining availability slots in such a situation?

Best Answer

Because you are dealing with uncertainty, you will have to resort to forecasting

You are selling something so the key is to reduce the combination of rooms and equipment to profitability

Here is a simple example

  1. Alex wants to book a certain room for 2 hours as soon as possible
  2. Beatrice usually books the same room in the next hour, for 3 hours

Our usual rate is $15 per hour

Analyzing the booking history, we realize that

  • Alex never booked anything
  • There's an 80% chance that Beatrice will book that room

Math is simple,

  • Alex will bring us 1 x $15 x 2h = $30
  • Beatrice 0.8 x $15 x 3h = $36

Not obvious but will work for us in the long term. So here are our options

  1. We can up the price for Alex
  2. We can impose a minimum of 2 hours and 30 minutes to Alex so that he exceeds Beatrice
  3. We can offer a different room, and make this one seem unavailable

I hope this helps

Related Topic