CSE505/Assignment2/C/cut.mod
2024-03-09 23:16:18 +08:00

21 lines
396 B
Modula-2

set WIDTHS;
param orders {WIDTHS} > 0;
param nPAT integer >= 0;
param nbr {WIDTHS, 1..nPAT} integer >= 0;
var Cut {1..nPAT} integer >= 0;
minimize Number:
sum {j in 1..nPAT} Cut[j];
subject to Fulfill {i in WIDTHS}:
sum {j in 1..nPAT} nbr[i,j] * Cut[j] >= orders[i];
data cut.dat;
option solver cplex;
solve;
option omit_zero_rows 1;
option display_1col 0;
display Cut;
display Number;