Originally posted by: Y17P_Karthikeswar_Ivaturi
Hello all,
I am graduate research student from UMASS. I am working on virtual network Mapping algorithms for my thesis. I had to work on a code that previously existed. I came across a .mod file where the objective function is located. I need to add a small part to it, but I could not figure out how an objective function in mathematical form is written in as a computer code. I am pasting the code below, if anybody can help me understand the syntax and also help me add my part of the equation it would be great and immensely appreciated.
HUB.mod
file
set SN;
/*substrate nodes*/
set VN;
/*virtual nodes*/
set AUG:=SN union VN;
param numHubs;
param distance{i in AUG, j in AUG};
/*distance between i and j*/
param W{i in VN, j in VN};
/*demand between i and j*/
param BW{i in AUG, j in AUG};
/*Augmented graph edges BandWidth*/
param cost{i in AUG, j in AUG};
param beta;
/*unit costs of collection (origin to hub)*/
param alpha;
/*unit costs of transfer (hub to hub)*/
param delta;
/*unit costs of distribution (hub to destination*/
param CPU{i in AUG};
param O{i in VN};
param SEL{i in AUG, j in AUG};
var Z{i in AUG, k in AUG} >=0;
/*flow from origin i to hub k*/
var Y{i in VN, k in SN, l in SN} >=0;
/*flow from hub k to hub l for flow originating at node i*/
var X{i in VN, l in SN, j in VN} >=0;
var H{i in SN} binary;
minimize OBJECTIVE: sum{i in VN} ( sum{k in SN}((CPU[i]/(CPU[k]+1E-06))*cost
i,k*beta*distance
i,k*Z
i,k) + (sum{k in SN} sum{l in SN}(1/(BW
k,l+1E-06)) *(alpha*distance
k,l*Y
i,k,l)) + sum{l in SN} (CPU[i]/(CPU[l]+1E-06)) * sum{j in VN} ( cost
j,ldelta distance
l,j*X
i,l,j));
subject to AllocConstraint: sum{k in SN} H[k] = numHubs;
subject to AllocConstraint1{i in VN}: sum{k in SN} Z
i,k =O[i];
subject to demandConstraint{i in VN, j in VN}: sum{l in SN} X
i,l,j = W
i,j;
subject to FlowConservationConstraint{i in VN, k in SN}: Z
i,k+sum{l in SN} Y
i,l,k = sum{l in SN} Y
i,k,l + sum{j in VN} X
i,k,j ;
subject to CapConstraint{k in SN, l in SN}: sum{i in VN} (Y
i,k,l) <=BW
k,l;
subject to CapConstraint1{k in SN, l in SN}: sum{i in VN} (Y
i,l,k) <=BW
l,k;
subject to lessThanConstraint{i in VN, j in VN, l in SN}: X
i,l,j <= W
i,j * H[l];
subject to lessThanConstraint1{i in VN, k in SN}:Z
i,k <= O[i]*H[k];
end;
I am also attaching the corresponding objective function in mathematical form.
I hope somebody would reply.
Thank you,
Karthik
#DecisionOptimization#OPLusingCPLEXOptimizer