メインコンテンツへスキップ

Issue with constraints returning "infeasible or unbounded"

回答済み

コメント

2件のコメント

  • 正式なコメント
    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

投稿コメントは受け付けていません。