Skip to main content

MILP: Expressing $\{0,11\}$ assignment across a matrix in MILP?

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$V$, the sum of the row indexed at seat, is less than or equal to the element in vector seat_varsseat_vars, indexed at seatseat.

In 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:

$$ \Sigma_{i=1}^{n} V_{seat,i} \leq seatvars_{seat}$$$$ \sum_{i=1}^{n} V_{\text{seat},i} \leq \text{seatvars}_{\text{seat}} $$

howeverHowever, I'm unsure how to "for loop" over every seat; eg this constraint holds for each seat.

MILP: Expressing {0,1} assignment across a matrix?

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:

$$ \Sigma_{i=1}^{n} V_{seat,i} \leq seatvars_{seat}$$

however, I'm unsure how to "for loop" over every seat; eg this constraint holds for each seat.

Expressing $\{0,1\}$ assignment across a matrix in MILP?

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.

Became Hot Network Question
Source Link
jbuddy_13
  • 559
  • 2
  • 8

MILP: Expressing {0,1} assignment across a matrix?

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:

$$ \Sigma_{i=1}^{n} V_{seat,i} \leq seatvars_{seat}$$

however, I'm unsure how to "for loop" over every seat; eg this constraint holds for each seat.