I have a real world problem, which is analogous to the below toy problem, which I call 'The Movie Theater Problem' (TMTP.)
In TMTP, movie viewers are assigned seats which principally balances two objectives, weighted equally: 1/ minimize distances to fire exists (F1 and F2) and 2/ maximize distance from other viewers, allocated to seats (S1...S9). For viewers, i (red) and j (blue) the proposed seats are S4 and S9, respectively, as depicted below.
Notes:
- Distance/Angle to theater screen is irrelevant as this is a toy problem analogous to one that is of interest to me.
- The sum of viewers could be any number, less than or equal to the total number of seats, not constrained to 2 viewers.
- In practice, this solution could be called several times iteratively as new viewers purchase tickets. As such, some seats may be allocated in previous iterations, which must be factored in as constraints in the current iteration, and are not eligible for the solver to reallocate.
- I typically use Google's OR-Tools, which interface with various MIP solvers, as well as CP-SAT, a constraint programming solver, which could potentially be more appropriate.
Data structures
The primary data structure of interest is D, a distance matrix, where D[i,j]
represents the distance between locations i->j
.
# F1, S1, ..., S9, F2
D = [[ ], #F1
[ ], #S1
...
[ ], #S9
[ ]] #F2
Objective Function. I cannot directly minimize Eq1 and maximize E2 at the same time, however, scaling Eq1 by -1, should allow for a single objective function to be maximized where the dual of Eq1 is minimized.
Max( -1 * [ Si * D[i,F1]
+ Si * D[i,F2]
+ Sj * D[j,F1]
+ Sj * D[j,F2] ]
+1 * [ Si * Sj * D[i,j] ] )
Constraints
Si in {1,0}
Sj in {1,0}
Si != Sj
SUM(Si: 1->n) = num_viewers
Questions:
- How can I best articulate this as a (mixed) integer programming problem?
- Is my objective function appropriate given the textual write-up above?
- Are my constraints (thus far) valid?
- How can I add constraints for seats that are already allocated from previous iterations, Sz?
- Is constraint programming more suitable than a MIP solution?
A second version of this graphic is provided where S3 is allocated already, so distances from it must be maximized, but unlike Si and Sj, Sz cannot be allocated elsewhere and is a fixed constraint.
Sz=0
and 2/ add to objective function, maximize distance of Si to Sz using something similar to+1 * [ Si * D[i,z] ]
. Yeah? $\endgroup$