Branching priority for a sub-set of variables in Gurobipy
回答済みHey
I am using Gurobipy and I would like to use the BranchPriorit attribute to set a branching priority for a specific set of variables.
I have defined the following variables:
for t in T:
for f in F:
for n in CAREGIVERS:
if y_[t, f, n] == 1:
for i in PATIENTS:
if u_[t, f, i, n] == 1:
if S[(t, i)] >= 1:
for s in range(1, (S[(t, i)] + 1)):
for j in PATIENTS:
if u_[t, f, j, n] == 1:
if S[(t, j)] >= 1:
for z in range(1, (S[(t, j)] + 1)):
if i != j or s != z:
Xcc[t, f, i, s, j, z, n] = r.addVar(
vtype=GRB.BINARY,
name="Xcc[%d,%d,%s,%d,%s,%d,%s]"
% (t, f, i, s, j, z, n),
)
I would like to set a branching priority for Xcc only when the parameters H[t,f,i,s] = 1.
0
-
正式なコメント
This post is more than two 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. -
Hi,
You can use the BranchPriority attribute to define a branching priority for the subset of variables you are interested in. The variables with larger branching priority values will take priority over variables with smaller values.
Best regards,
Maliheh
0
投稿コメントは受け付けていません。
コメント
2件のコメント