What are some algorithms that can assist with reservation time scheduling

algorithmsoptimizationscheduling

Here's the gist of the problem: There are multiple service providers who each have their own schedules of availability. There are multiple customers who seek their services. Customers need to be able to book a reservation time for the service but they should only be able to book times in which some service provider is available (ie they don't really care which particular provider they get so long as they get a provider). Unfortunately, service providers may change schedules between when the customer registers and when the service is provided, meaning that even with the reservation safeguards in place there could still end up being too many reservations for a given time.

I would like to know what work has already been done on this sort of problem, and additionally:

  1. Should providers actually be "assigned" to customers in a persistent way even though providers are interchangeable?
  2. Depending on the answer to the previous question, how might I determine the provider's "next assignment" based on the current time, other providers' schedules, and scheduled reservations?

I've thought a lot about this problem but I am stumped and left with unsatisfying solutions. As someone with no CS background I would appreciate some insight and/or a better way to think about the problem.

Best Answer

You don't have to bind a reservation to a specific service provider. You already know how to tell if a time slot is fully booked, there is the same number of reservations as service providers scheduled during that slot. So if you're fully booked for a slot and a provider wants to no longer be scheduled during that slot, you either deny the schedule change or cancel one of the reservations.

If that isn't feasible (in which case it's not really a "reservation", is it?), then you just sort the customers by earliest reservation time first, and go down the list.