# The WDM wavelength routing and assignment model with no translation set N; # nodes set E within {N,N}; # links in the network set W; # wavelengths set D within {N,N}; # od pairs set S; # structures set C; # switch set K; # cycles set J {D} within K; # cycles used to satisfy demand (o,d) set P; # paths set Pk {K} within P; # paths in cycle k set H within {P,P}; # set of pairs of paths having a conflict set Es {S} within E default {}; # Es[s] is the set of links in structure s set Pes {E,S} within P default {}; # Pes[i,j,s] is the set of paths using link (i,j) of structure set L {C} within P default {}; # paths that use switch c param r {D}; param a {S,W}; param f {C,W}; param B default sum{s in S} a[s,80] + sum{c in C} f[c,80] + 1; var X {K} >= 0; # Num. wavelengths assigned to cycle k var x {P} integer >= 0; # Num. wavelengths assigned to path p var l {P} integer >= 1; # smallest wavelength assigned to path p var h {P} >= 0, <= 80; # largest wavelength assigned to path p var m {P} >= 0; # midpoint of interval [l[p],h[p]] var b {P, P} binary; # = 0 if h[p] < l[q] and = 1 otherwise var dp{P, P} >= 0; # = m[p] - m[q] if m[p] > m[q] and 0 otherwise var dm{P, P} >= 0; # = m[q] - m[p] if m[q] > m[p] and 0 otherwise var u {D} >= 0; # unsatisfied deamnd for (o,d) var y {S, W} binary; # 1 iff structure s is of size w var z {C, W} binary; # i iff switch c is of size w minimize cost: sum {s in S, w in W} a[s,w] * y[s,w] + sum {c in C, w in W} f[c,w] * z[c,w] + sum {(o,d) in D} B * u[o,d]; subject to demand_satisfaction {(o,d) in D}: sum{k in J[o,d], p in Pk[k]} x[p] + u[o,d] = r[o,d]; subject to assign_wavelengths {p in P}: h[p] = l[p] + x[p] - 1; subject to determine_midpoint {p in P}: m[p] = (l[p] + h[p])/2; subject to determine_distance {(p,q) in H}: m[p] - m[q] = dp[p,q] - dm[p,q]; subject to minimum_distance {(p,q) in H}: dp[p,q] + dm[p,q] >= (x[p] + x[q])/2; subject to distinct_assign1 {(p,q) in H}: dp[p,q] <= 80*b[p,q]; subject to distinct_assign2 {(p,q) in H}: dm[p,q] <= 80*(1- b[p,q]); subject to construct_design1 {s in S, (i,j) in Es[s], p in Pes[i,j,s]}: sum{w in W} w * y[s,w] >= h[p]; subject to construct_design2 {c in C, p in L[c]}: sum{w in W} w * z[c,w] >= h[p]; subject to struct_1_size {s in S}: sum {w in W} y[s,w] <= 1; subject to coupler_1_size {c in C}: sum {w in W} z[c,w] <= 1; subject to X_upper {(o,d) in D, k in J[o,d]}: X[k] <= r[o,d]; subject to x_upper {(o,d) in D, k in J[o,d], p in Pk[k]}: x[p] <= r[o,d];