Hai
When using column generation in models, there is possibility to constraint coefficients (e.g., s_vals) be sparse. It's efficient to identify only those constraints where the new variable y has a nonzero contribution. By updating only these relevant constraints with the corresponding terms, the column addition process becomes significantly faster. You can try like
for i in range(num_B):
if abs(s_vals[i]) > 0:
demand_exprs[(k, i)] += s_vals[i] * y
------------------------------
Athira Babu
------------------------------