Try our new documentation site (beta).
Filter Content By
Version
Text Search
${sidebar_list_label} - Back
Filter by Language
Model.cbUseSolution()
cbUseSolution ( )
Once you have imported solution values using
cbSetSolution,
you can optionally call cbUseSolution
to immediately use
these values to try to compute a heuristic solution.
Return value:
The objective value for the solution obtained from your solution values (or GRB.INFINITY if no improved solution is found).
Example usage:
def mycallback(model, where): if where == GRB.Callback.MIPNODE: model.cbSetSolution(vars, newsolution) objval = model.cbUseSolution() model.optimize(mycallback)
![](/wp-content/plugins/hd_documentations/content/images/documentation-ampl-guide.webp)
![](/wp-content/plugins/hd_documentations/content/images/documentation-cloud.webp)
![](/wp-content/plugins/hd_documentations/content/images/documentation-example-tour.webp)
![](/wp-content/plugins/hd_documentations/content/images/documentation-quick-start.webp)
![](/wp-content/plugins/hd_documentations/content/images/documentation-reference-manuals.webp)
![](/wp-content/plugins/hd_documentations/content/images/documentation-remote-services.webp)
![](/wp-content/plugins/hd_documentations/content/images/quickstart-os-linux.webp)
![](/wp-content/plugins/hd_documentations/content/images/quickstart-os-mac-osx.webp)
![](/wp-content/plugins/hd_documentations/content/images/quickstart-os-windows.webp)