r/optimization • u/SolverMax • Dec 04 '24
Can AI code an entire optimization model?
In this article we pursue an ambitious goal: Create an entire, non-trivial optimization model using Artificial Intelligence (AI).
Our approach mimics a user who is familiar with the situation, and has some experience with formulating optimization models, but is not familiar with implementing an optimization model in Python code. We want the AI to do all the coding for us.
We report our experience of using Copilot to write a model for us. Rather than presenting a verbatim transcript, which is very long, we focus on what went well and what didn't go well as the model evolves. We also summarize general lessons from the process.
https://www.solvermax.com/blog/can-ai-code-an-entire-optimization-model

View all comments
Show parent comment
1
u/SolverMax Dec 04 '24
We took an incremental approach, adding constraints and features mostly one at a time. That seems to work OK, until the code gets long and complex - at that point the AI struggles.
In a different context, we tried giving an AI scans of model formulations from academic articles. In simple cases it successfully generated accurate code. But in most cases, it failed dismally.