Skip to main content

Issue with constraints returning "infeasible or unbounded"

Answered

Comments

2 comments

  • Official comment
    Simranjit Kaur
    • Gurobi Staff
    This post is more than three 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 why not try our AI Gurobot?.
  • Lili Cai
    • Gurobi-versary
    • First Comment
    • First Question

    Nevermind, someone offline solved the problem

    The correct format should be: 

    G = np.concatenate((-prices, prices, np.eye(N_products),-1.*np.eye(N_products)),axis=0)
    h = np.concatenate((np.asarray([-min_budget]),np.asarray([budget]),np.ones([N_products]),np.zeros([N_products])),axis=0)

    Then delete j variable 

    And use this for problem definition:

    prob = cp.Problem(objective,[G @ x <= h, P @ x == q])
    0

Post is closed for comments.