# Problems in Adding New Variables to Constriants

Question asked by scchew@student.unimelb.edu.au on Jan 20, 2016
Latest reply on Jan 25, 2016 by scchew@student.unimelb.edu.au

Hi guys,

I am currently using column generation to solve a scheduling problem, one of the process in column generation is to add new variables to the constraints. However, I couldn't seem to get it right. I have included a simplified version of my problem: trying to add to q := 3 to l := 2 in Cont.

L= 1..5

A = 1..5

N = 1..5

M = 1..5

K: range

B: dynamic array(L, K, A, M) of integer

P: array(L, M) of integer

C: array(N) of integer

z: dynamic array(L, K, N, A) of mpvar

w: dynamic array(L, K, A) of mpvar

forall(l in L, k in 1..2, i in A) Cont(l,k,i) := sum(n in N) z(l,k,n,i)*( sum(m in M) B(l,k,i,m)*P(l,m) - C(n) ) - w(l,k,i) <= 0

!(Now I am attempting to add new variables to z and w, below is one of the many ways I tried)

l := 2

q := 3

forall(n in N, i in A) create(z(l,q,n,i))

forall(n in N, i in A) z(l,q,n,i) is_integer

forall(i in A) create(w(l,q,i))

forall(i in A) w(l,q,i) is_integer

forall(i in A) Cont(l,q,i) += sum(n in N) z(l,q,n,i)*( sum(m in M) B(l,q,i,m)*P(l,m) - C(n) ) - w(l,q,i)

Can anyone point out my mistake(s)?