Pulp add constraint that at least one LpAffineExpression is equal to one
问题 Say I have a PuLP model defined as thus: model = pulp.LpProblem('',pulp.LpMaximize) And I have added an objective function (it does not matter) Now I have a list of LpAffineExpression objects: lps = [l1, l2, l3, ...] I want to add to the model the constraint that one of these LpAffineExpression evaluates to 1. How would I do so? Essentially what I'm looking for is the syntactically correct way to do the following: model += (l1 == 1 OR l2 == 1 OR l3 == 1 OR ...) Note that I do not know how