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

How to find remaining capacity in facility location problem

回答済み

コメント

3件のコメント

  • 正式なコメント
    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 try Gurobot, our chatbot interface offering instant, expert-level support.
  • Simon Bowly
    • Gurobi Staff

    You should be able to obtain this from the Slack attribute of the relevant capacity constraints. For inequality constraints, Slack reports the difference between the left- and right-hand sides for the current solution values. For example in Python, for some facility j you might have constraints expressed as:

    capacity_constr[j] = model.addConstr(
    gp.quicksum(x[i,j] for i in demand_locations) <= capacity[j]
    )

    After optimization, you can then use

    capacity_constr[j].Slack

    to report the spare capacity for the given facility.

    0
  • MD MORSHEDUL ALAM
    • Gurobi-versary
    • First Comment
    • First Question

    Thank you so much. I got it.

    0

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