It sounds like you want to associate a binary variable with each arc to indicate whether Flow is positive along that arc. You can do that by first modifying the variable declarations as follows:
/* var Flow {ARCS} >= 0;*/
/* var rdcBINS {RDC, DDU} binary;*/
/* var adcBINS {ADC, DDU} binary;*/
/* var dduASSIGNRDC {DDU, RDC} binary;*/
var Flow {ARCS} >= 0 <= sum {i in DDU} demand[i];
set RDC_DDU_ARCS = {i in RDC, j in DDU: <i,j> in ARCS};
set ADC_DDU_ARCS = {i in ADC, j in DDU: <i,j> in ARCS};
set DDU_RDC_ARCS = {i in DDU, j in RDC: <i,j> in ARCS};
var rdcBINS {RDC_DDU_ARCS} binary;
var adcBINS {ADC_DDU_ARCS} binary;
var dduASSIGNRDC {DDU_RDC_ARCS} binary;
And then declaring the constraints as follows:
/* Assign separations to DDUs based on assigned FLOWS */
* con rdc_assign_ddu_con {i in RDC, j in DDU}:
rdcBINS[i,j] = Flow[i,j];
con rdc_assign_ddu_con {<i,j> in RDC_DDU_ARCS}:
Flow[i,j] <= Flow[i,j].ub * rdcBINS[i,j];
The idea is that Flow[i,j] > 0 implies rdcBINS[i,j] = 1. This is called a "big-M" constraint, and the examples book you referenced uses it in several places. If you know a smaller upper bound than the sum of all demands, I recommend that you use it (in the VAR statement for Flow).
The rdc_bin_con constraint then changes as follows:
/* Constrain separations in RDC and ADC*/
/* con rdc_bin_con {i in RDC}:*/
/* sum {j in DDU} rdcBINS[i,j] <= &BinCap;*/
con rdc_bin_con {i in RDC}:
sum {<(i),j> in RDC_DDU_ARCS} rdcBINS[i,j] <= &BinCap;
These changes alone do not enforce "A DDU can only be serviced by either an RDC or an ADC, not both." Before I recommend a constraint to do that, can you please clarify whether a DDU can be serviced by more than one RDC or more than one ADC, or must it be exactly one RDC or ADC?
... View more