0

i was trying to solve this transportation problem in cplex enter image description here

here is my OPL code

int p=...;

int q=...;

range i=1..p;

float a[i];

range j=1..q;

float b[j];

float c[i][j];

dvar boolean x[i][j];

minimize sum(l in i,m in j)x[l][m]*c[l][m];

subject to {

forall (l in i) sum(m in j) x[l][m] <= a[l];

forall (m in j) sum(l in i) x[l][m] >= b[m];

}

enter image description here this is my .dat

I keep getting this error " Data element "a" is already set".

sudarsan vs
  • 113
  • 1
  • 8

1 Answers1

1

since you declare a in the .dat you should replace

float a[i];

by

float a[i]=...;
Alex Fleischer
  • 9,276
  • 2
  • 12
  • 15