I am trying to adapt the already solved problem of programming restrictions by Hakan Kjellerstrand (@hakankless) and could help with some help.
Original problem solved: There are 6 public speakers and 6 rooms. Each loudspeaker should be assigned to a room, while not a single room will remain empty, and each speaker in one room.
Solutions here: Google OR-Tools and MiniZinc
Help with this adaptation: There are 3 public speakers and 6 time slots (i.e. one room). Each speaker should be assigned to one time interval in order to minimize the duration from the initial slot (it is assumed that it starts from slot 1 or everyone is busy starting from the next available slot).
+---+------+------+------+ | | A | B | C | +---+------+------+------+ | 1 | | Busy | | | 2 | Busy | Busy | Busy | | 3 | Busy | Busy | | | 4 | | | | | 5 | | | Busy | | 6 | Busy | Busy | | +---+------+------+------+
The solution would be (A, 1), (C, 3), (B, 4). If we started with (C, 1), it would end with (A, 5) or (B, 5). Since 4 <5, the first solution is correct. How can i solve this?
Visual solution:
+---+----------+----------+----------+ | | A | B | C | +---+----------+----------+----------+ | 1 | SELECTED | Busy | | | 2 | Busy | Busy | Busy | | 3 | Busy | Busy | SELECTED | | 4 | | SELECTED | | | 5 | | | Busy | | 6 | Busy | Busy | | +---+----------+----------+----------+
algorithm constraint-programming mathematical-optimization solver
Marcus
source share