Originally posted by: pnuzyf
Hi,
I want to solve a problem using cplex opl. The problem is expressed as follows:
It is a edge-coloring problem. Suppose that (m,n) denotes the edge starting from node m to node n, and (n,m) denotes the edge starting from node n to node m. Links denotes the set of edges, Channels denotes the set of colors, i denotes the index of color, Interference<m,n> denotes the set of edges which interfere with edge (m,n), note that edge (n,m) should be included in Interference<m,n>. There are two constraints:
1) Each edge can choose only one color.
2) Within a interference range, each color can be chosen at most one time.
My solution to this problem is:
forall((m,n) in Links)
{
//only one color can be assigned to a given edge
sum(i in Channels) x(m,n,i) <= 1;
}
forall((m,n) in Links, i in Channels)
{
//ensure each color can be assigned to a pair of nodes at most one time within a interference range, note that x(m,n,i) = x(n,m,i), and (n,m) belongs to Interference(m,n)
x(m,n,i) + sum((p,q) in Interference(m,n)) x(p,q,i) <= 2
}
However, after I add the second constraint to my model, it takes long time to run and finally "out of memory" message comes out. Is there any better way to express the second constraint? Thanks in advance!
#CPLEXOptimizers#DecisionOptimization