Hello, I am writing a optmodel procedure, with the following constraint, the optimal solution is infeasible: con unit_con{c in bucket, a in AMOUNTS}: unit[c,a] * Move[c,a] >= 50; However, without the above constraint, solution is more reasonable. What I want to do is to tell the model that if a cell has less than 50 units than don't consider this cell. The full code is here: proc optmodel;
/* Index Sets */
set bucket;
set AMOUNTS=2000..17000 by 1000;
/* Parameters */
number orig_amount {bucket, AMOUNTS} init 0;
number loss_amount {bucket, AMOUNTS} init 0;
number profit {bucket, AMOUNTS} init 0;
number unit {bucket, AMOUNTS} init 0;
/* Binary decision variables--approve (1) or deny (0) an amount per customer */
var Move {bucket, AMOUNTS} binary;
read data GRP1 nomiss
into bucket=[BK_Group]
{a in AMOUNTS} < orig_amount[BK_Group,a]=col("OR"||a)
loss_amount[BK_Group,a]=col("LO"||a)
profit[BK_Group,a]=col("PR"||a)
unit[BK_Group,a]=col("UN"||a)>;
print unit;
print move;
print profit;
print orig_amount;
/* Set up amount max and profit max objectives */
min Total_delta_loss = sum{c in bucket, a in AMOUNTS} loss_amount[c,a] * Move[c,a];
/* Approve at most one loan amount per group */
con One_Amount_con{c in bucket}: sum{a in AMOUNTS} Move[c,a] <= 1;
con worse_con{i in bucket, j in AMOUNTS, k1 in 1..(10-i), k2 in 1000..(17000-j) by 1000}: Move[i,j] + Move[i+k1, j+k2] <= 1;
/*con unit_con{c in bucket}: sum{a in AMOUNTS} unit[c,a] * Move[c,a] >= 20;*/
impvar Total_delta_orig = sum{c in bucket, a in AMOUNTS} orig_amount[c,a] * Move[c,a];
impvar Total_Profit = (Total_delta_orig - Total_delta_loss) * 0.45924 - Total_delta_loss;
/* profit constraint: loss no more than 200,000 of profit */
con profit_con: Total_Profit >= -200000;
con unit_con{c in bucket, a in AMOUNTS}: unit[c,a] * 1 >= 50;
problem Problem1 include
Move
Total_delta_loss
unit_con
One_Amount_con profit_con worse_con
;
use problem Problem1;
solve;
print Move;
create data solution
from [BK_Group LO]
={c in bucket, g in AMOUNTS: Move[c,g]^=0}
amount=Move;
print Total_Profit;
print Total_delta_orig;
quit; Any help is appreciated! Lucas
... View more