我不知道如何在 CPLEX 中编写(我∈ V^a∪ V^s)以下条件?

  • 本文关键字:条件 CPLEX 我不知道 cplex forall
  • 更新时间 :
  • 英文 :


∑((i,j∈A_2))(x_ij)+∑_((i、j,k)∈A_3)(y_ijk)=1,i ∈ V^a∪ V^s

我不知道如何为所有人写V^a和V^s交集,对吗?

{int} Arr_node;
{int} Loco_start;
{int} Exp1= Arr_node inter Loco_start;

Forall(i in Exp1)(sum(<i,j> in A2)x[<i,j>]) + (sum(<i,j,k> in A3)y[<i,j,k>]) == 1;

您可以使用inter或&amp;

参见

{string} cities={"A","B","C"};
{string} departures={"A","B"};
{string} arrivals={"B","C"};
dvar boolean x[cities];
{string} bothdepandarr=departures inter arrivals;
minimize sum(c in cities) x[c];
subject to
{
forall(c in bothdepandarr) x[c]==1;
}

{string} cities={"A","B","C"};
{string} departures={"A","B"};
{string} arrivals={"B","C"};
dvar boolean x[cities];

minimize sum(c in cities) x[c];
subject to
{
forall(c in departures inter arrivals) x[c]==1;
}

{string} cities={"A","B","C"};
{string} departures={"A","B"};
{string} arrivals={"B","C"};
dvar boolean x[cities];

minimize sum(c in cities) x[c];
subject to
{
forall(c in cities : c in departures && c in arrivals) x[c]==1;
}

相关内容

  • 没有找到相关文章

最新更新