Hi,
if you simplify your model into
int nbnodes = ...; //number of nodes
range nodes = 1..nbnodes;
int totallc = ...; //total number of linecards (LC)
int LC_Cost = ...; // Set of Cost of each LC
int LC_Capacties = ...; // Set of capacties of each LC
range r_lc = 1..totallc;
range rcapacties_lc = 1..LC_Capacties;
range rcost_lc = 1..LC_Cost;
tuple lincard{ // Tuple of LCs
int j_lc[r_lc];
int k_lc[rcapacties_lc]; //store the set of lC with different capacties [40,100,400]
int costtype_lc[rcost_lc]; //store the set of lC with different Cost[1,2,4]
}
{lincard} Lincards = ...; //Take data from outside fo tuples
int totalec = ...; //Total number of encryptoion card EC
int EC_Cost = ...;
int EC_Capacties = ...;
range r_ec = 1..totalec; //store the set of lC with different Cost[1,2,4]
range rcapacties_ec = 1..EC_Capacties;
range rcost_ec = 1..EC_Cost;
tuple eccard{ // Tuple of ECs
int j_ec[r_ec];
int k_ec[rcapacties_ec]; //store the set of EC with different capacties [40,100,400]
int costtype_ec[rcost_ec]; //store the set of EC with different Cost[1,2,4]
}
{eccard} ECcards = ...; // Tuple of ECs
int nmbr_routes = ...; // total number of routes
range routes = 1..nmbr_routes;
int nmberflow = ...; //total number of flows in netwrk
range rflow = 1..nmberflow;
//{string} flowtypes = {"Hi"}; //types of flow e.g., important flows and non important
tuple flow{ //tupel for flows
//key int id;
int flow_bw[rflow];
//string flowtype;
int src[nodes];
int dest[nodes];
}
{flow} flows = ...;
int hope_count[routes][nodes][nodes] = ...; //hope count between nodes
float Duals[nodes] = ...;
int link [nodes][nodes] = ...;
dvar boolean lemda[flows][routes][nodes][nodes]; //the boolean variable that equals 1 if flow ri routed over jth lightpaths
dvar boolean k[nodes][nodes];
flow f=first(flows);
subject to{
forall( u in nodes: u==f.src[u] )
Const1:
sum(v in nodes)(k[u][v]-k[v][u])==1;
forall( u in nodes: u!=f.src[u] && u!=f.dest[u] )
Const3:
sum(v in nodes)(k[u][v]-k[v][u])==0;
}
and generate the lp file you will get an infeasible model but also
Subject To
Const1(2): k(2)(1) - k(1)(2) + k(2)(3) - k(3)(2) + k(2)(4) - k(4)(2) + k(2)(5)
- k(5)(2) + k(2)(6) - k(6)(2) = 1
Const3(1): - k(2)(1) + k(1)(2) + k(1)(3) - k(3)(1) + k(1)(4) - k(4)(1)
+ k(1)(5) - k(5)(1) + k(1)(6) - k(6)(1) = 0
Const3(3): - k(2)(3) + k(3)(2) - k(1)(3) + k(3)(1) + k(3)(4) - k(4)(3)
+ k(3)(5) - k(5)(3) + k(3)(6) - k(6)(3) = 0
Const3(4): - k(2)(4) + k(4)(2) - k(1)(4) + k(4)(1) - k(3)(4) + k(4)(3)
+ k(4)(5) - k(5)(4) + k(4)(6) - k(6)(4) = 0
Const3(5): - k(2)(5) + k(5)(2) - k(1)(5) + k(5)(1) - k(3)(5) + k(5)(3)
- k(4)(5) + k(5)(4) + k(5)(6) - k(6)(5) = 0
Const3(6): - k(2)(6) + k(6)(2) - k(1)(6) + k(6)(1) - k(3)(6) + k(6)(3)
- k(4)(6) + k(6)(4) - k(5)(6) + k(6)(5) = 0
regards
#DecisionOptimization#OPLusingCPLEXOptimizer