How to write mathematical formulation based on Gurobi Python script?
AnsweredIs there any API or tools in Gurobi to generate the math equation of constraints based on the Python script of that constraint? I want to get the math formula of the following constraint:
model2.addConstrs((gp.quicksum(deploy[s, o, r] for s in Stations)
<= Demand[o, r] for o in OilSpills for r in ResourcesD),
name='C_deploy_demand')
Expected output

0
-
Official comment
This post is more than two 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 try Gurobot, our chatbot interface offering instant, expert-level support. -
Hi Tanmoy,
There is no functionality within Gurobi that can do this. Perhaps there are tools which can convert standardized lp or mps files to latex, and you could leverage that by writing your model to file, but in saying that I'm not aware of any such tools. This does not mean they don't exist though.- Riley
0 -
When I was typing this question, my brain was hinting me in your very same point. funny. I will post here if I found something useful from lp file - Latex direction,
0
Post is closed for comments.
Comments
3 comments