odow / SDDP.jl

A JuMP extension for Stochastic Dual Dynamic Programming
https://sddp.dev
Other
304 stars 62 forks source link

Impact of the number of stages on solving time #698

Closed AngeBlanchard closed 11 months ago

AngeBlanchard commented 11 months ago

Hi Oscar, I used to have a model with 52 stages, which I transformed into a 12-stages one, in order to have a faster convergence. If I get it right, the training phase doesn't need as many iterations as before to converge (approx 5 times less, with the rule of thumb you give).

However, (and I'm surprised) it seems that lowering the number of stages increases the computation time per iteration (which offsets part of the gains from this model simplification)... And I don't really get it: depending on the number of stages involved, either we solve lots of small problems or few big ones (on the forward phase). It's not obvious to me why solving a few big problems should take more time than loads of small ones.

Maybe I coded it wrong ? Or is it a natural result that doesn't surprise you ? Thanks for your insights, Ange

AngeBlanchard commented 11 months ago

I should maybe add that in my case, whatever the number of stages, the state space of decisions variables has the same "size", either one stage represent a week of 168 hours, either it stands for a month of 720 hours. In total, I model a full year of approximately 8760 hours in any case.

The only difference being that fewer stages mean less uncertainty (random variables live in a smaller world)

odow commented 11 months ago

It's not obvious to me why solving a few big problems should take more time than loads of small ones. Or is it a natural result that doesn't surprise you ?

It doesn't surprise me. This is a pretty common occurrence.

In general, the runtime of a particular problem is very dependent on the details. A rule of thumb is just that. It isn't advice that should be treated as fact.

odow commented 11 months ago

Closing because this seems resolved, and I don't know if there is anything actionable.

If you can post a reproducible example of your model on https://discourse.julialang.org/c/domain/opt/13, people may have suggestions for improving the JuMP or Julia parts. You can also re-open this issue if I've mis-understood and I haven't answered the question :smile: