ILOG CPLEX 选项中的双层问题工作室

问题描述

如果您能帮助解决此问题,我将不胜感激。在这个双层分配问题 (BAP) 中,我们有 n 个起点和 n 个目的地,领导者必须选择 k 个起点和 k 个目的地,这样典型(最小化)分配问题 (AP) 的解决方案Follower(大小为 k)最大化。即:

Maximize(大小为k的AP的解决方案)[leader's Objective Function (OF)]

s.t 1. leader 选择 k 个起点和 k 个目的地

  1. 大小为 k = minimum(sum(cij * xij) i= 1…k) 的 AP 的解决方案(对于 k 个选定的起点和终点)[Follower's OF]

  2. 圣。典型的 AP 约束。 (xij 布尔值等)

我已经成功地实现了两个目标函数都对齐的情况的代码(例如两个最小化),因为我可以通过编写一次目标函数来做到这一点,因为它对于领导者和追随者来说是完全相同的。当我尝试解决上述公式时,我的问题就出现了,其中我们对领导者有一个最大化的 OF,对跟随者有一个最小的 OF。下面是适用于领导者和追随者都最小化 OF 情况的代码

using CP;
int n=3;
int k= 2;

range origins = 1..n;
range destin = 1..n;
range k_origins =1..k;
range k_destin = 1..k;

int costs[origins][destin]=[[5,5,7],[10,3,6],[4,4,5]
 ];

dvar int x[k_origins] in origins;
dvar int y[k_destin] in destin;
dvar boolean z[k_origins][k_destin];
dvar int k_costs[k_origins][k_destin];

dexpr float totalcost = sum(i in k_origins,j in k_destin)
    k_costs[i][j] * z[i][j];

//The problem is right here,where I should maximize the leader's objective 
//function = solution of the minimization assignment problem of size k
minimize totalcost ;

subject to
{
//Cannot choose one origin/destination twice  
allDifferent(x);
allDifferent(y);

//Values must be ordered,so the indexes are respected in the next ct
forall(i in 1..k - 1) x[i]<= x[i+1];
forall(j in 1..k - 1) y[j]<= y[j+1]; 

//DeFinition of the follower's matrix of costs 
forall(i in k_origins,j in k_destin) k_costs[i][j] == costs[x[i]][y[j]];
 
//Typical AP Constraints applied to the follower 
forall(j in k_destin) sum(i in k_origins)z[i][j] == 1;
forall(i in k_origins) sum(j in k_destin)z[i][j] == 1;
};

对于 leader 的最大化问题和 Follower 的最小化问题(我无法实现),输出解决方案是:选择行(原点)1 和 2 和列(目的地)1 和 3,解决方案值为 11(所选行和列的 AP 的解)。欢迎任何帮助解决此问题:)

非常感谢!

如果需要,这里有分配问题的描述:https://en.wikipedia.org/wiki/Assignment_problem

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)