I want to solve a multi-stage optimization problem using SDDP.jl in which I am having hard time using constraints on state variables at the termination.


1 Answer 1


You cannot add a hard constraint to the terminal state variable. The model must have relatively complete recourse, so there must be a feasible solution for any incoming value of the state variable in the last stage.

You can instead add a soft constraint that penalizes the violation in the objective.

  • $\begingroup$ but i am using terminal constraint as an ethical constraint, it is essential to my research objective, can i use some other mechanism such as duality handlers... $\endgroup$ Commented Sep 30, 2023 at 21:08
  • $\begingroup$ No. There are no alternatives or workarounds. You must use a penalized soft-constraint. $\endgroup$ Commented Sep 30, 2023 at 21:52
  • $\begingroup$ Right, that's fine, thanks $\endgroup$ Commented Sep 30, 2023 at 22:39
  • $\begingroup$ Then, if I can not use hard constraint on terminal state variable, will it be the best approach to use hyperparameter optimization over the weight of the corresponding soft constraint such that the hyperparameter optimization will minimize the sum of real objective (in our original multi-stage optimization) and the term which is zero if the state variable is less then a threshold and some large number if that state variable is greater then a threshold. $\endgroup$ Commented Oct 1, 2023 at 0:13
  • $\begingroup$ Yes, you will likely need to tune the weight parameter by trying out different values to see what works. $\endgroup$ Commented Oct 5, 2023 at 14:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.