Skip to main content

LP Problem Formulation

Answered

Comments

4 comments

  • Jonasz Staszek
    Community Moderator Community Moderator
    Gurobi-versary
    Thought Leader
    First Question

    Dear Mohamad,

    I believe these resources (here and here) should be of help to you.

    Best regards
    Jonasz

    1
  • Mohamad Abouras
    Gurobi-versary
    Conversationalist
    First Question

    Dear Jonasz,
    thank you for the resources, they helped a lot!

    Would you mind taking a look at a small code snippet just to make sure that I am going in the right direction?

    Structure 

    - Is this the correct way of defining the objective function?

    Some of the constraints:



    - Does the way I am formulating the constraints make sense? I am trying to make constrains redundant in case they should be ignored.

    Best regards

     

     

    0
  • Jonasz Staszek
    Community Moderator Community Moderator
    Gurobi-versary
    Thought Leader
    First Question

    I can't see any obvious red flags from afar. In the future, we will be better able to help you if you paste your code (and format it as such) in the post, rather than pasting a screenshot.

    To assess the constraints, you can also write the model to a file using

    m.write("model.lp")

    and then study the file to check whether the constraints look they way you wish.

    Best regards
    Jonasz

    1
  • Mohamad Abouras
    Gurobi-versary
    Conversationalist
    First Question

    Sorry for the late replay.

    The idea with the .lp file is really amazing, and it helped a lot.

    Thank you very much!

    Best Regards 
    Mohamad

    0

Please sign in to leave a comment.