I have a MILP (Xpress) constraint, which is doing what I want it to, but I'm struggling to translate it into a LaTeX friendly mathematical expression.
The below code enforces that in the matrix $V$, the sum of the row indexed at seat, is less than or equal to the element in vector seat_vars
, indexed at seat
. In plain English, one or zero viewers can be assigned to each seat; put another may, at most one person could be assigned to each seat.
for seat in seat_vars.keys():
constraint = [V[seat, v] for v in range(1, num_viewers+1)]
sum_ = solver.Sum(constraint)
solver.Add(sum_ <= seat_vars[seat])
What is the proper mathematical way to express this in LaTeX?
The best I've got so far is
$$ \sum_{i=1}^{n} V_{\text{seat},i} \leq \text{seatvars}_{\text{seat}} $$
However, I'm unsure how to "for loop" over every seat; eg this constraint holds for each seat.