Optimizing black-box functions
AnsweredHello,
Can Gurobi optimize a model where the objective function is not available in closed form but is calculated by Python code (possibly providing gradient information)?
I saw an answer here: https://support.gurobi.com/hc/en-us/articles/14713795855505-Is-it-possible-to-feed-black-box-functions-to-Gurobi
but since you are constantly improving the solvers, I have to ask for the current state.
Thank you,
Miroslav
-
Hi Miroslav,
Gurobi does not currently support direct optimization of black-box functions. If relevant, you can use the Gurobi Machine Learning Package to embed a trained regression model within a gurobipy model.
Alternatively, you can approximate your black-box function with a piecewise-linear model. See the “Piecewise-Linear Objective” section of the documentation for details.
Best regards,
Maliheh
0 -
Thank you, Maliheh!
0
Please sign in to leave a comment.
Comments
2 comments