How to find remaining capacity in facility location problem
回答済みLet say I have 5 demand and 3 facility locations (Actually I have lot of locations). After solving the model, I got optimal assignment. After assigning demand to facility, there will be some left-over capacity in some facilities. How can I find which facility has how much capacity left-over?
Here is the sample problem.

-
正式なコメント
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. -
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 -
Thank you so much. I got it.
0
投稿コメントは受け付けていません。
コメント
3件のコメント