How to write constraint such the sum of the binary variable is 1.
回答済みI am trying to implement the algorithm in the paper
As per equation 16 I need to put a constraint that sum of O^k is 1. The question is how can I implement that constraint?
If I just do self.m.addConstr(sum(O)==1)
I get the error TypeError: 'Var' object is not iterable
0
-
正式なコメント
This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?. -
The object was not iterable and hence the error. Problem is resolved.
0
投稿コメントは受け付けていません。
コメント
2件のコメント