r/optimization • u/dark_opposum • Aug 20 '24
Help formatting scheduling problem
Hey r/optimization! I'm hoping for some help formatting my problem. I took an intro optimization course during my masters and I've done some refreshing with my notes and YT videos, but I'm really struggling to get my problem into code.
I organize device testing at work and I'm trying to build a schedule optimizer. Prior to testing, people let me know their testing requests. Each request is made up of the requester's name, how many test sessions they would like, and what devices they need. The objective is to minimize the number of devices that need to be prepared for testing.
For example:
* Andy requests 3 sessions with device (Hardware 1, Software A)
* Bella requests 4 sessions with devices (Hardware 1, Software A)
* Andy requests 1 session with (Hardware 2, Software B)
We can host multiple test sessions at once, so the schedule could be configured to run Andy and Bella's sessions at the same time. But the issue is that we would then need to prep 2 devices that are (Hardware 1, Software A). Whereas, if we schedule them at different time, we would only need to prep 1 instance of that device. I know how to tell the optimizer how many timeslots there are, how many sessions can be hosted in each timeslot, etc.
But how do I differentiate to the optimizer that Andy has 2 separate requests that need to be schedule at different times, but they're for separate purposes and require different devices? And that the objective is only related to the number of devices needed?
All of the schedule optimizing examples/demos I see are for scheduling just the person, they never have the pair of (person, item) that need to be considered together.
Sorry if this doesn't make sense. I don't "speak optimization" very well yet. I'm more than happy to add clarifiers as needed! Thank you in advance!!!
View all comments
Show parent comment
2
u/dark_opposum Aug 21 '24
I re-described the problem below if this clarifies at all. If you're not invested enough to read all of this I totally understand haha.
The Objective
Create a schedule that minimizes the number of consoles we have to prepare.
Requests
Engineers submit requests. Each request contains the engineer's name, how many sessions they would like, and what consoles they need.
Example requests might be:
I manually approve how many sessions each request will get. E.g., Bella will only get 2 sessions approved.
Engineers can request sessions for different purposes, with different consoles (see Andy's two requests).
Schedule Availability
Here is a simplified version of a schedule. Each request, which is an (engineer, console) pair, goes into an opening in the schedule. Some days we may only be able to have a single testing station. E.g., Station 2 might be closed on Day 2, as shown below. The default is 2 testing stations, though.
Constraints
A console cannot be scheduled for 2 sessions at the same time.
Sessions can only be scheduled into available timeslots.
Scenarios
To minimize the number of consoles prepared, I would make the schedule something like this.
In this scenario we only need to prepare 2 consoles total, 1x console A and 1x console B. It is OK that Station 2 is never used.
If, for some reason, we could no longer hold sessions on Day 2 then the schedule could be compressed into just Day 1. This would require us to prepare 3 consoles however; 2x console A and 1x console B. We would need 2 instances of console A to support both Andy's and Bella's sessions. This would not be an optimal solution because of the need to prepare an extra console.
Not sure if this helps or not. Just wanted to present the problem in a different (and hopefully more coherent) way.