Skip to main content

Constrained Dynamic Programming with Gurobi in R

Answered

Comments

4 comments

  • Official comment
    Simranjit Kaur
    • Gurobi Staff
    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.
  • Riley Clement
    • Gurobi Staff

    Hi George,

    This might be a good use case for gurobi-machinelearning where you approximate Q with surrogate modelling.  If you know the value of Q for each x, and the domain of x is not prohibitively large, then you can train a machine learning model (and you may as well overfit) on a dataset containing all possible values of x (and Q(x)), and then embed this in your model.

    - Riley

    0
  • George Vassos
    • Gurobi-versary
    • First Comment
    • First Question

    Hi Riley, 

    Thanks for your answer. I am using Gurobi in R and below I try to rephrase my question with a little more context.

    Suppose I have a current solution x_k and I let f_k(x)=a_0+a^{T}(x-x_k) with a, x, and x_k being 3-dimensional and b 1-dimensional. I solve min{c^{T}x + Q_k(x) : Ax = b, x > 0} to obtain the next value x_{k+1} and finally I update Q_{k+1}(x)=max{Q_{k}(x), f_k(x)}.

    My point is that Q_k(x) is the max of a sequence of supporting hyperplanes that approximates the true function Q(x). Is there a way to put this approximation Q_k in the objective function of R gurobi so that I can solve this convex optimization problem min{c^{T}x + Q_k(x) : Ax = b, x > 0}?

    Thank you in advance for your help.

    - George

    0
  • Riley Clement
    • Gurobi Staff

    Hi George,

    Sorry about that, at some point after thinking about the problem the fact you were using R got forgotten.  What does Q_0 look like?  I'm thinking you can probably formulate the problem:

    min{c^{T}x + y : Ax = b, y >= f_k(x) \forall k, y >= Q_0, x > 0}

    so you would just keep adding y>= f_k(x) iteratively.

    - Riley

     

    0

Post is closed for comments.