General constraints Output
AnsweredHello,
I am verifying my model and my output states "The model has 10 general constraints". I am not sure what constraints is the model counting to get 10 since I wrote a total of 12 constraints on my model. I also added a for loop to print the name of each constraint on the model as seem below and I got a total of 25 constraints since some of the constraints were writing in for loops.
Optimize a model with 25 rows, 28 columns and 65 nonzeros
Model fingerprint: 0xf020d520
Model has 10 general constraints
Variable types: 12 continuous, 16 integer (16 binary)
Coefficient statistics:
Matrix range [9e-01, 4e+00]
Objective range [1e+00, 1e+00]
Bounds range [1e+00, 1e+00]
RHS range [1e+00, 2e+02]
Presolve removed 25 rows and 28 columns
Presolve time: 0.00s
Presolve: All rows and columns removed
Explored 0 nodes (0 simplex iterations) in 0.00 seconds
Thread count was 1 (of 8 available processors)
Solution count 1: 0.99994
No other solutions better than 0.99994
Optimal solution found (tolerance 1.00e-04)
Best objective 9.999400000000e-01, best bound 9.999400000000e-01, gap 0.0000%
1
2
2
2
2
2
2
3
3
3
4
5
6
7
10
10
10
10
10
10
11
11
11
11
12
-
Official comment
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 number of linear constraints is listed as "rows" in the log:
Optimize a model with 25 rows, 28 columns and 65 nonzeros
General constraints are counted separately from linear constraints. Piecewise-linear constraints, indicator constraints, and absolute value constraints are examples of general constraints.
The log suggests you have 25 linear constraints and 10 general constraints. If this doesn't sound right, please post a minimal working example showing how you build the model.
0
Post is closed for comments.
Comments
2 comments