Building a model with more than 2 billion nonzeros: GRBnewmodel vs GRBXaddvars
回答済みI am building an LP model with the C API that I know has more than 2 billion nonzeros, and I am wondering whether the best practice is to (1) initialize all of the variables and bounds with `GRBnewmodel` or to (2) initialize an empty model with `GRBnewmodel` and then add variables with `GRBXaddvars`. Or should upper and lower bounds be added with `GRBXaddrangeconstrs`?
0
-
正式なコメント
This post is more than two 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 try Gurobot, our chatbot interface offering instant, expert-level support. -
You can either
- initialize all variables and bounds at the beginning in GRBnewmodel and then add the constraints using GRBXaddconstrs or
- create an empty model in GRBnewmodel and then add the variables using GRBXaddvars.
I would not expect a massive performance difference between the two approaches.
In any case, I would recommend defining the variable bounds when adding the variables and not as range constraints.
1 -
Thanks!
0
投稿コメントは受け付けていません。
コメント
3件のコメント