Subsets of variables

Hello everyone! I have a problem with sets and subsets definitions in a MIP formulation. I have 2 025; the firsts 225 are continue variables and the rest are binary variables.

Because of this I write:

k variables of the instance /k1k2025/
l(k) binary variables(0 <= x <= 1) /k226
k2025/

And then I write:

VARIABLES
z objetive
x(k) variables;

BINARY VARIABLES
x(l) variables binarias;

But gams give me: Error 184 - Domain list redefined

How I can fix this?

the complete code that I used is the following:

$CALL GDXXRW 10teams.xlsx @teams.txt
$Title 10teams_ca

SETS
i filas matriz A /i1i95/
j filas matriz M /j1
j135/
k variables de la instania /k1k2025/
l(k) subconjunto de variables binarys (0 <= x <= 1) /k226
k2025/
m1(k) subconjunto de variables continuas FX=1 /k1, k51, k105, k165, k225/
m2(k) subconjunto de variables continuas FX=0;

m2(k) = (not l(k)) - m1(k);

PARAMETERS
A(i,k) matriz A
M(j,k) matriz M
b(i) vector b
g(j) vector g
c(k) vector de costos;

$GDXIN 10teams.gdx
$load A
$load M
$load b
$load g
$load c
$GDXIN

VARIABLES
z funcion objetivo
x(k) variables;

BINARY VARIABLES
x(l) variables binarias;


EQUATIONS
fobj funcion objetivo z
res1 restriccion 1
res2 restriccion 2;

fobj… z =e= sum(k,c(k)*x(k));
res1(i)… sum(k,A(i,k)*x(k)) =l= b(i);
res2(j)… sum(k,M(j,k)*x(k)) =e= g(j);
x.fx(m1) = 1;
x.fx(m2) = 0;

Model Centro /all/;

option mip=coincbc,rmip=coincbc;
solve Centro USING MIP MINIMIZING z;


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Fabián
Where are x(l) on your model?
You can substitute x(l) for another name: xx(l).
Why do you want the binaries a subset of the continuous variables?

Regards

Fabián Mancilla escreveu:

Hello everyone! I have a problem with sets and subsets definitions in a MIP formulation. I have 2 025; the firsts 225 are continue variables and the rest are binary variables.
Because of this I write:
k variables of the instance /k1*k2025/
l(k) binary variables(0
And then I write:

VARIABLES z objetive
x(k) variables;

BINARY VARIABLES
x(l) variables binarias;

But gams give me: Error 184 - Domain list redefined

How I can fix this?

the complete code that I used is the following:
$CALL GDXXRW 10teams.xlsx @teams.txt
$Title 10teams_ca

SETS
i filas matriz A /i1i95/
j filas matriz M /j1
j135/
k variables de la instania /k1*k2025/
l(k) subconjunto de variables binarys (0 m1(k) subconjunto de variables continuas FX=1 /k1, k51, k105, k165, k225/
m2(k) subconjunto de variables continuas FX=0;

m2(k) = (not l(k)) - m1(k);

PARAMETERS
A(i,k) matriz A
M(j,k) matriz M
b(i) vector b
g(j) vector g
c(k) vector de costos;

$GDXIN 10teams.gdx
$load A
$load M
$load b
$load g
$load c
$GDXIN

VARIABLES
z funcion objetivo
x(k) variables;

BINARY VARIABLES
x(l) variables binarias;

EQUATIONS
fobj funcion objetivo z
res1 restriccion 1
res2 restriccion 2;

fobj… z =e= sum(k,c(k)*x(k));
res1(i)… sum(k,A(i,k)*x(k)) =l= b(i);
res2(j)… sum(k,M(j,k)*x(k)) =e= g(j);
x.fx(m1) = 1;
x.fx(m2) = 0;

Model Centro /all/;

option mip=coincbc,rmip=coincbc;
solve Centro USING MIP MINIMIZING z;

To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

\

Hi
I think the easiest way is to seperate the variables :

k1 continious variables /1225/
k2 binary variables /225
2025/
;
Variables
x1(k1)
x2(k2)
;
BinaryVariables
x2
;

2010/12/22 Fabián Mancilla

Hello everyone! I have a problem with sets and subsets definitions in a MIP formulation. I have 2 025; the firsts 225 are continue variables and the rest are binary variables.

Because of this I write:

k variables of the instance /k1k2025/
l(k) binary variables(0 <= x <= 1) /k226
k2025/

And then I write:

VARIABLES
z objetive
x(k) variables;

BINARY VARIABLES
x(l) variables binarias;

But gams give me: Error 184 - Domain list redefined

How I can fix this?

the complete code that I used is the following:

$CALL GDXXRW 10teams.xlsx @teams.txt
$Title 10teams_ca

SETS
i filas matriz A /i1i95/
j filas matriz M /j1
j135/
k variables de la instania /k1k2025/
l(k) subconjunto de variables binarys (0 <= x <= 1) /k226
k2025/
m1(k) subconjunto de variables continuas FX=1 /k1, k51, k105, k165, k225/
m2(k) subconjunto de variables continuas FX=0;

m2(k) = (not l(k)) - m1(k);

PARAMETERS
A(i,k) matriz A
M(j,k) matriz M
b(i) vector b
g(j) vector g
c(k) vector de costos;

$GDXIN 10teams.gdx
$load A
$load M
$load b
$load g
$load c
$GDXIN

VARIABLES
z funcion objetivo
x(k) variables;

BINARY VARIABLES
x(l) variables binarias;


EQUATIONS
fobj funcion objetivo z
res1 restriccion 1
res2 restriccion 2;

fobj… z =e= sum(k,c(k)*x(k));
res1(i)… sum(k,A(i,k)*x(k)) =l= b(i);
res2(j)… sum(k,M(j,k)*x(k)) =e= g(j);
x.fx(m1) = 1;
x.fx(m2) = 0;

Model Centro /all/;

option mip=coincbc,rmip=coincbc;
solve Centro USING MIP MINIMIZING z;


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.



\

Babak Saleck Pay
Group of Industrial Engineering
M.Sc
Operations Research
University of Tehran
Tehran,Iran


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Edson and Babak:

Well, I have a lot data of a LP problem in a GDX file. But I need consider some like binary and since the coeficients of the matrix “A” & “M” depend of the index “k” (System of the form Ax<=b; Mx=g), I define the subset “I” of “k” and I try to declaring “x(I)” binary variables. Thus the formulation of the equations is more easy (I think). However this seem not possible.

Regars and thanks


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Fabian,

Did you manage to solve this problem, without defining a separate set of variables? I have encountered a similar issue and it will be quite a pain to have to split my ‘x’ vector into continuous, integer and binary components!

Jonathan

On Thursday, December 30, 2010 4:11:02 PM UTC+13, Fabián Mancilla wrote:

Edson and Babak:

Well, I have a lot data of a LP problem in a GDX file. But I need consider some like binary and since the coeficients of the matrix “A” & “M” depend of the index “k” (System of the form Ax<=b; Mx=g), I define the subset “I” of “k” and I try to declaring “x(I)” binary variables. Thus the formulation of the equations is more easy (I think). However this seem not possible.

Regars and thanks


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

\