Performance gains from using ParametricOptInterface.jl vs variables

I have a model coded in JuMP which needs to be solved multiple times in a loop. It is an inter-temporal / rolling horizon problem where the model is solved for one time period at a time, then various “parameters” need to be updated.

I wasn’t aware of the ParametricOptInterface.jl, so I implemented the parameters as variables, whose values are fixed and updated between each model solve (rather than re-build the model in full each time).

I’m wondering if I should update my code to use the ParametricOptInterface.jl rather than variables, so my question is: is this likely to offer performance gains relative to using variables?

Not sure if the answer depends on the structure or size of my problem (it is an MCP solved with PATH solver, and it is relatively large).

1 Like

Hi @nealhughes, welcome to the forum :smile:

The answer is: it depends.

Have you profiled how much time model building takes relative to how long the problem takes to solve?

1 Like

Thanks @odow, the problem is expensive to build and quick to solve (and it has to be solved many times) so modifying in place is definitely the go.

What I have done is modify in place using variables as a hack for parameters, but was wondering if this ParametricOptInterface might have some advantages.

1 Like

Is it a linear or a nonlinear MCP? ParametricOptInterface won’t help if it is nonlinear.

We should probably look at adding native support for parameters to PATHSolver.jl.

Yep, I see that now. No my problem is non-linear.

Variables as parameters approach works OK. I ran into the upper limit of variables for the “free” version of PATH solver, but downloading the PATH licence file fixed that.

Can you post the code? If you’re using only the free version of PATH and having performance problems, there’s likely things we can improve.

Sorry, I’m a government employee so can’t share code yet.

I’m using the free version of PATH solver, just downloading the licence file from this page to get around the size constraints

The PATH Solver

If you cant share the exact code, share a similar example that demonstrates what you are trying to do.