Originally posted by: BhavnaJha
The following is my .mod file in opl. I'm using IBM ILOG OPTIMIZATION STUDIO 12.7 Version.
And when I run this file I get the ERROR:
MIP starts could not be constructed. CPLEX 1001 : OUT OF MEMORY.
I tried changing the cplex parameters, but even then the result was the same.
Can some one please suggest how to solve this error and make this program work?
Should I change the algorithm or have I coded the program incorrectly? If, yes then how to fix it?
Also, can someone please tell , if I'm changing the parameters correctly in the script?
I'm using a system with 4GB RAM and 878 GB free disk space. According to calculations suggested to estimate the memory required by a model, my model has around 19,000 constraints dividing it by 1000, 19. So it should require around 19 MB for a relaxed LP. But even for the relaxed problem it shows OUT OF MEMORY. Can someone please tell what's happening?
I need a response ASAP.
Thanks, in advance.
execute PARAMS
{
cplex.nodefileind = 3;
cplex.workmem = 500;
}
range locations = 1..612;
range states = 1..34;
range JK = 1..11;
range HP = 12..23;
range P = 24..42;
range U = 43..57;
range H = 58..77;
range Del = 78..84;
range UP = 117..186;
range Bihar = 187..224;
range Sikkim = 225..228;
range ArP = 229..244;
range Naga = 245..255;
range Mani = 256..264;
range Mizo = 265..272;
range TP = 273..276;
range Megh = 277..283;
range Assam = 284..310;
range wb = 311..329;
range raj = 85..116;
range guj = 446..470;
range dnd = 471..472;
range dadar = 473..473;
range maha = 474..507;
range krntka = 531..557;
range goa = 558..559;
range laksh = 560..560;
range kerala = 561..574;
range jhkd = 330..351;
range orr = 352..381;
range chatt = 382..397;
range mp = 398..445;
range ap = 508..530;
range tn = 575..605;
range pondi = 606..609;
range andmn = 610..612;
{string} grains = ...;
{string} hh = ...;
int fp = 300000000;
int ff = 0;
int M[grains] = ...;
float F[grains] = ...;
float PC[locations][grains] = ...; // Govt. Disposable quantity of each grain in each district
float D[locations][grains] = ...; // Demand of each grain in each district;
float W[locations][grains] = ...; // Price of grains to consumer in open market;
float tt[locations][locations] = ...; // Cost of transportation from locations to procurement centres
float b[hh] = ...;
float no_of_hh[locations][hh] = ...;
dvar float+ Z[locations][grains];
dvar float+ Q[locations][grains];
dvar float+ eta[locations][locations][grains] ;
dvar float+ q1[states][grains][hh] ;
dvar float+ T[locations][locations][grains];
dvar float+ Y[locations];
dvar float+ S[locations][locations][grains] ;
dvar float+ de[locations][grains];
//MODEL
minimize
sum(proc in locations, j in grains)
(F[j]*sum(i in locations) eta[i][proc][j]*PC[i][j] + ff*Z[proc][j])
+ sum ( store in locations) fp * Y[store]
+ sum(i in locations, proc in locations, j in grains) (2 * eta[i][proc][j] * PC[i][j] * tt[i][proc] )
+ sum(proc in locations, store in locations, j in grains) T[proc][store][j]
+ sum(store in locations , distri in locations, j in grains) S[store][distri][j]
+ sum(i in locations, proc in locations, j in grains) eta[i][proc][j]*PC[i][j]*M[j]
+ sum(i in locations, j in grains) W[i][j]*de[i][j]
;
subject to {
forall ( i in locations, j in grains)
ct1: sum (proc in locations) eta[i][proc][j] <= 1;
forall (proc in locations, j in grains)
ct2: sum ( i in locations) eta[i][proc][j] <= 612*Z[proc][j];
forall (k in states, h in hh)
ct3: sum(j in grains) q1[k][j][h] == b[h] ;
forall ( distri in JK, j in grains)
ct4: sum(store in locations) S[store][distri][j] == minl ( (sum (h in hh) q1[1][j][h]*no_of_hh[distri][h]) , D[distri][j]) ;
forall ( distri in HP, j in grains)
ct5: sum(store in locations) S[store][distri][j] == minl ( (sum (h in hh) q1[2][j][h]*no_of_hh[distri][h]) , D[distri][j]) ;
forall ( distri in P, j in grains)
ct6: sum(store in locations) S[store][distri][j] == minl ( (sum (h in hh) q1[3][j][h]*no_of_hh[distri][h]) , D[distri][j]) ;
forall ( distri in H, j in grains)
ct7: sum(store in locations) S[store][distri][j] == minl ( (sum (h in hh) q1[4][j][h]*no_of_hh[distri][h]) , D[distri][j]) ;
forall ( distri in U, j in grains)
ct8: sum(store in locations) S[store][distri][j] == minl ( (sum (h in hh) q1[5][j][h]*no_of_hh[distri][h]) , D[distri][j]) ;
forall ( distri in Del, j in grains)
ct9: sum(store in locations) S[store][distri][j] == minl ( (sum (h in hh) q1[6][j][h]*no_of_hh[distri][h]) , D[distri][j]) ;
forall ( distri in UP, j in grains)
ct10: sum(store in locations) S[store][distri][j] == minl ( (sum (h in hh) q1[7][j][h]*no_of_hh[distri][h]) , D[distri][j]) ;
forall ( distri in Bihar, j in grains)
ct11: sum(store in locations) S[store][distri][j] == minl ( (sum (h in hh) q1[8][j][h]*no_of_hh[distri][h]) , D[distri][j]) ;
forall ( distri in Sikkim, j in grains)
ct12: sum(store in locations) S[store][distri][j] == minl ( (sum (h in hh) q1[9][j][h]*no_of_hh[distri][h]) , D[distri][j]) ;
forall ( distri in ArP, j in grains)
ct13: sum(store in locations) S[store][distri][j] == minl ( (sum (h in hh) q1[10][j][h]*no_of_hh[distri][h]) , D[distri][j]) ;
forall ( distri in Naga, j in grains)
ct14: sum(store in locations) S[store][distri][j] == minl ( (sum (h in hh) q1[11][j][h]*no_of_hh[distri][h]) , D[distri][j]) ;
forall ( distri in Mani, j in grains)
ct15: sum(store in locations) S[store][distri][j] == minl ( (sum (h in hh) q1[12][j][h]*no_of_hh[distri][h]) , D[distri][j]) ;
forall ( distri in Mizo, j in grains)
ct16: sum(store in locations) S[store][distri][j] == minl ( (sum (h in hh) q1[13][j][h]*no_of_hh[distri][h]) , D[distri][j]) ;
forall ( distri in TP, j in grains)
ct17: sum(store in locations) S[store][distri][j] == minl ( (sum (h in hh) q1[14][j][h]*no_of_hh[distri][h]) , D[distri][j]) ;
forall ( distri in Megh, j in grains)
ct18: sum(store in locations) S[store][distri][j] == minl ( (sum (h in hh) q1[15][j][h]*no_of_hh[distri][h]) , D[distri][j]) ;
forall ( distri in Assam, j in grains)
ct19: sum(store in locations) S[store][distri][j] == minl ( (sum (h in hh) q1[16][j][h]*no_of_hh[distri][h]) , D[distri][j]) ;
forall ( distri in wb, j in grains)
ct20: sum(store in locations) S[store][distri][j] == minl ( (sum (h in hh) q1[17][j][h]*no_of_hh[distri][h]) , D[distri][j]) ;
forall ( distri in raj, j in grains)
ct21: sum(store in locations) S[store][distri][j] == minl ( (sum (h in hh) q1[18][j][h]*no_of_hh[distri][h]) , D[distri][j]) ;
/*forall ( distri in guj, j in grains)
ct22: sum(store in locations) S[store][distri][j] == minl ( (sum (h in hh) q1[19][j][h]*no_of_hh[distri][h]) , D[distri][j]) ;
forall ( distri in dnd, j in grains)
ct23: sum(store in locations) S[store][distri][j] == minl ( (sum (h in hh) q1[20][j][h]*no_of_hh[distri][h]) , D[distri][j]) ;
forall ( distri in dadar, j in grains)
ct24: sum(store in locations) S[store][distri][j] == minl ( (sum (h in hh) q1[21][j][h]*no_of_hh[distri][h]) , D[distri][j]) ;
forall ( distri in maha, j in grains)
ct25: sum(store in locations) S[store][distri][j] == minl ( (sum (h in hh) q1[22][j][h]*no_of_hh[distri][h]) , D[distri][j]) ;
forall ( distri in krntka, j in grains)
ct26: sum(store in locations) S[store][distri][j] == minl ( (sum (h in hh) q1[23][j][h]*no_of_hh[distri][h]) , D[distri][j]) ;
forall ( distri in goa, j in grains)
ct27: sum(store in locations) S[store][distri][j] == minl ( (sum (h in hh) q1[24][j][h]*no_of_hh[distri][h]) , D[distri][j]) ;
forall ( distri in laksh, j in grains)
ct28: sum(store in locations) S[store][distri][j] == minl ( (sum (h in hh) q1[25][j][h]*no_of_hh[distri][h]) , D[distri][j]) ;
forall ( distri in kerala, j in grains)
ct29: sum(store in locations) S[store][distri][j] == minl ( (sum (h in hh) q1[26][j][h]*no_of_hh[distri][h]) , D[distri][j]) ;
*/
forall ( distri in jhkd, j in grains)
ct30: sum(store in locations) S[store][distri][j] == minl ( (sum (h in hh) q1[27][j][h]*no_of_hh[distri][h]) , D[distri][j]) ;
forall ( distri in orr, j in grains)
ct31: sum(store in locations) S[store][distri][j] == minl ( (sum (h in hh) q1[28][j][h]*no_of_hh[distri][h]) , D[distri][j]) ;
forall ( distri in chatt, j in grains)
ct32: sum(store in locations) S[store][distri][j] == minl ( (sum (h in hh) q1[29][j][h]*no_of_hh[distri][h]) , D[distri][j]) ;
/*forall ( distri in mp, j in grains)
ct33: sum(store in locations) S[store][distri][j] == minl ( (sum (h in hh) q1[30][j][h]*no_of_hh[distri][h]) , D[distri][j]) ;
forall ( distri in ap, j in grains)
ct34: sum(store in locations) S[store][distri][j] == minl ( (sum (h in hh) q1[31][j][h]*no_of_hh[distri][h]) , D[distri][j]) ;
forall ( distri in tn, j in grains)
ct35: sum(store in locations) S[store][distri][j] == minl ( (sum (h in hh) q1[32][j][h]*no_of_hh[distri][h]) , D[distri][j]) ;
forall ( distri in pondi, j in grains)
ct36: sum(store in locations) S[store][distri][j] == minl ( (sum (h in hh) q1[33][j][h]*no_of_hh[distri][h]) , D[distri][j]) ;
forall ( distri in andmn, j in grains)
ct37: sum(store in locations) S[store][distri][j] == minl ( (sum (h in hh) q1[34][j][h]*no_of_hh[distri][h]) , D[distri][j]) ;
*/
forall ( distri in locations , j in grains)
ct38: de[distri][j] == D[distri][j] - sum( store in locations) S[store][distri][j];
forall ( proc in locations, j in grains)
ct39: sum ( store in locations) T[proc][store][j] == sum (i in locations) eta[i][proc][j]*PC[i][j] ;
// Capacity constraint for storage centres
//forall ( store in locations)
// ct40: sum ( proc in locations, j in grains) T[proc][store][j] <= L[store]*Y[store] ;
forall ( store in locations, j in grains)
ct40: sum ( distri in locations) S[store][distri][j] == sum ( proc in locations) T[proc][store][j];
}
#DecisionOptimization#OPLusingCPLEXOptimizer