Python interface and Python matrix interface
Now that the model has been built, the next step is to optimize it:
# Optimize model m.optimize()
This routine performs the optimization and populates several internal model attributes (including the status of the optimization, the solution, etc.).
C interface
Now that the model has been built, the next step is to optimize it:
/* Optimize model */ error = GRBoptimize(model); if (error) goto QUIT;
This routine performs the optimization and populates several internal model attributes, including the status of the optimization, the solution, etc. Once the function returns, we can query the values of these attributes. In particular, we can query the status of the optimization process by retrieving the value of the Status
attribute.
/* Capture solution information */ error = GRBgetintattr(model, GRB_INT_ATTR_STATUS, &optimstatus); if (error) goto QUIT;
The optimization status has many possible values. An optimal solution to the model may have been found, or the model may have been determined to be infeasible or unbounded, or the solution process may have been interrupted. A list of possible statuses can be found in the Gurobi Reference Manual. For our example, we know that the model is feasible, and we haven't modified any parameters that might cause the optimization to stop early (e.g., a time limit), so the status will be GRB_OPTIMAL
.
C++ interface
Now that the model has been built, the next step is to optimize it:
// Optimize model model.optimize();
This routine performs the optimization and populates several internal model attributes (including the status of the optimization, the solution, etc.).
Java interface
Now that the model has been built, the next step is to optimize it:
// Optimize model model.optimize();
This routine performs the optimization and populates several internal model attributes (including the status of the optimization, the solution, etc.).
.NET interface
Now that the model has been built, the next step is to optimize it:
// Optimize model model.Optimize();
This routine performs the optimization and populates several internal model attributes (including the status of the optimization, the solution, etc.).
MATLAB interface
The next statement is where the actual optimization occurs:
result = gurobi(model, params);
We pass the model
and the optional list of parameter changes to the gurobi()
function. It computes an optimal solution to the specified model and returns the computed result.
R interface
The next statement is where the actual optimization occurs:
result <- gurobi(model, params)
We pass the model
and the optional list of parameter changes to the gurobi()
function. It computes an optimal solution to the specified model and returns the computed result.
Comments
0 comments
Please sign in to leave a comment.