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

Memory Error occurs during setting objective function

ユーザーの入力を待っています。

コメント

2件のコメント

  • 正式なコメント
    Simranjit Kaur
    • Gurobi Staff 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?.
  • Jaromił Najman
    • Gurobi Staff Gurobi Staff

    Hi Jinwoo,

    What are the dimensions of the sets \(\texttt{parts, nodes, s_nodes, r_nodes}\)?

    You could try reducing the number of \(\texttt{for}\)-loops by using

    obj = LinExpr(0)
    for p in parts:
    for n in nodes:
    obj.add(Excess_stock[(n,p)], unit_value_dict[p])
    obj.add(Deficit_stock[(n, p)], unit_value_dict[p])
    for s in s_nodes:
    for r in r_nodes:
    obj.add(k*routes_dict[(s, r)], X[(s,r,p)])

    You could also consider using the addTerms method.

    Best regards,
    Jaromił

    0

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