In [1,2] a Python-based conference scheduler is presented. The problem is as follows:
- There are events (i.e. talks) denoted by i and slots denoted by j
- Some restrictions include:
- Do not schedule talks by the same speaker at the same slot
- Assign events to slots such that one of the following objectives is optimized:
- Minimize total room overflow (that is: demand exceeds capacity)
- Minimize maximum room overflow
- Minimize changes from previous schedule
In [2] the model is stated as follows:
min∑i,j(di−cj)xi,jSum of room overflow∑jxi,j=1∀i∑ixi,j≤1∀jxi,j=0∀i,j∈CSUnavailabilityxi,j+xi′,j′≤1∀i,j,i′,j′∈CENot at same dayxi,j∈{0,1} |
You can choose any single one from the objectives:
1.∑i,j(di−cj)xi,jSum of room overflow2.maxi,j(di−cj)xi,jMax of room overflow3.∑i,j[(1−x0i,j)xi,j+x0i,j(1−xi,j)]Difference from a previous solution x0 |
The model can be solved with a MIP solver (via the PULP Python package) or using a simulated annealing code.
This is a nice, clean model. Of course there are always things I probably would do differently, largely based on taste.
- When I did something like this I used a variable xe,r,t with r,t indicating the room and the time period. In this package j captures both (r,t). As the package supports events and slots of different length (e.g. 30, 60, 90 minutes) that makes sense.
- Objective 1 seems to prefer assignments with di≪cj. This can be fixed by using: ∑i,jmax(di−cj,0)xi,j. Of course we can do even better by also penalizing assignments of small events to big rooms, as shown in the rightmost picture:
- It is not always easy to choose between the sum vs the max (objectives 1 and 2). Actually often a combination works very well.
- Similar for the last objective. In general I combine this with the other objectives, so that we can deviate from an existing schedule if it pays off for another objective.
- Instead of fixing variables x to zero if assignments are forbidden (and leave it to the presolver to get rid of these variables) I like to not even generate these variables. I guess I am old-fashioned.
- I probably would make the model very elastic: make sure we can always produce a feasible schedule (at the cost of renting very expensive “emergency” rooms). This way we can at least see a solution instead of just a message “infeasible”.
- The input data in the tutorial seems to repeat much data. E.g. the room capacity is entered for each time slot. It is usually a good idea to “normalize” data: enter the “elementary” data only once.
- I often prefer to present results in spreadsheet tables, in hopefully a meaningful layout. That seems to work better as a communication tool than a text file:
OK, enough of the nitpicking. In any case, interesting stuff.
References
- A Python tool to assist the task of scheduling a conference, https://github.com/PyconUK/ConferenceScheduler
- Documentation, http://conference-scheduler.readthedocs.io/en/latest/index.html
No comments:
Post a Comment