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
-
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
サインインしてコメントを残してください。
コメント
2件のコメント