Set Covering Problem

Archiver
User
Posts: 7876
Joined: 4 years ago

Set Covering Problem

Hello All,

I need help with the problem below, I think the problem is in the equation â€œAgebtoPtoEnc..â€

Iâ€™ll be very gratefully if someone could help me.

Best Regards

VÃ­ctor OrtÃ­z

* TITLE Set Covering;

Set i / i1*i6 / ;

Set k / k1*k6 / ;

Table d(i,k)

k1 k2 k3 k4 k5 k6

i1 1 1 0 1 0 0

i2 1 1 1 0 0 0

i3 0 1 1 0 0 1

i4 1 0 0 1 1 0

i5 0 0 0 1 1 1

i6 0 0 1 0 1 1 ;

Binary Variable Y(k);

Variables

z "Set Covering"

Equation AgebtoPtoEnc , Def_obj ;

AgebtoPtoEnc..

sum(k, Y(k)*d[i,k)) =g= 1 ;

Def_obj..

z =e= sum(k, Y(k));

Model setcovering / all / ;

Solve setcovering using mip minimizing z;

Display z.l, y.l ;

--
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.

Archiver
User
Posts: 7876
Joined: 4 years ago

Re: Set Covering Problem

Dear Victor,

Your equation AgebtoPtoEnc is not unique and depends on the set i, so you need to declare and define the equation in the following way:

...
Equation AgebtoPtoEnc(i), Def_obj;

AgebtoPtoEnc(i).. sum(k, Y(k)*d(i,k)) =g= 1 ;
...

Cheers,
Pedro

On Sat, Feb 16, 2013 at 10:04 PM, Victor Ortiz wrote:

Hello All,

I need help with the problem below, I think the problem is in the equation â€œAgebtoPtoEnc..â€

Iâ€™ll be very gratefully if someone could help me.

Best Regards

VÃ­ctor OrtÃ­z

* TITLE Set Covering;

Set i / i1*i6 / ;

Set k / k1*k6 / ;

Table d(i,k)

k1 k2 k3 k4 k5 k6

i1 1 1 0 1 0 0

i2 1 1 1 0 0 0

i3 0 1 1 0 0 1

i4 1 0 0 1 1 0

i5 0 0 0 1 1 1

i6 0 0 1 0 1 1 ;

Binary Variable Y(k);

Variables

z "Set Covering"

Equation AgebtoPtoEnc , Def_obj ;

AgebtoPtoEnc..

sum(k, Y(k)*d[i,k)) =g= 1 ;

Def_obj..

z =e= sum(k, Y(k));

Model setcovering / all / ;

Solve setcovering using mip minimizing z;

Display z.l, y.l ;

--
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.

--
PEDRO JAVIER RAMÃREZ TORREALBA
Londres, REINO UNIDO

Celular: +44-(0)75-8069-3119

--
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.

Archiver
User
Posts: 7876
Joined: 4 years ago

Re: Set Covering Problem

The correct model is as following:

* TITLE Set Covering;
Set i / i1*i6 / ;
Set k / k1*k6 / ;
Table d(i,k)
k1 k2 k3 k4 k5 k6
i1 1 1 0 1 0 0
i2 1 1 1 0 0 0
i3 0 1 1 0 0 1
i4 1 0 0 1 1 0
i5 0 0 0 1 1 1
i6 0 0 1 0 1 1 ;
Binary Variable Y(k);
Variables
z "Set Covering"
Equation AgebtoPtoEnc(i) , Def_obj ;
AgebtoPtoEnc(i)..sum(k, Y(k)*d(i,k)) =g= 1 ;
Def_obj..z =e= sum(k, Y(k));
Model setcovering / all / ;
Solve setcovering using mip minimizing z;
Display z.l, y.l ;

On 2/17/13, Victor Ortiz wrote:
> > Hello All,
> >
> >
> >
> > I need help with the problem below, I think the problem is in the equation
> > â€œAgebtoPtoEnc..â€
> >
> >
> >
> > Iâ€™ll be very gratefully if someone could help me.
> >
> >
> >
> > Best Regards
> >
> > VÃ­ctor OrtÃ­z
> >
> >
> >
> >
> >
> >
> >
> > * TITLE Set Covering;
> >
> >
> >
> > Set i / i1*i6 / ;
> >
> > Set k / k1*k6 / ;
> >
> >
> >
> > Table d(i,k)
> >
> >
> >
> > k1 k2 k3 k4 k5 k6
> >
> > i1 1 1 0 1 0 0
> >
> > i2 1 1 1 0 0 0
> >
> > i3 0 1 1 0 0 1
> >
> > i4 1 0 0 1 1 0
> >
> > i5 0 0 0 1 1 1
> >
> > i6 0 0 1 0 1 1 ;
> >
> >
> >
> > Binary Variable Y(k);
> >
> >
> >
> > Variables
> >
> > z "Set Covering"
> >
> >
> >
> > Equation AgebtoPtoEnc , Def_obj ;
> >
> >
> >
> > AgebtoPtoEnc..
> >
> >
> >
> > sum(k, Y(k)*d[i,k)) =g= 1 ;
> >
> >
> >
> > Def_obj..
> >
> >
> >
> > z =e= sum(k, Y(k));
> >
> >
> >
> > Model setcovering / all / ;
> >
> >
> >
> > Solve setcovering using mip minimizing z;
> >
> >
> >
> > Display z.l, y.l ;
> >
> > --
> > "gamsworld" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > 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.
> >
> >
> >

Archiver
User
Posts: 7876
Joined: 4 years ago

RE: Set Covering Problem

Thank you Hossein Karim, Pedro Ramirez and Jose Quezada

The model is working correctly

Best regards
VÃ­ctor OrtÃ­z

-----Mensaje original-----
de hossein karimi
Enviado el: domingo, 17 de febrero de 2013 01:11 a.m.
Asunto: Re: Set Covering Problem

The correct model is as following:

* TITLE Set Covering;
Set i / i1*i6 / ;
Set k / k1*k6 / ;
Table d(i,k)
k1 k2 k3 k4 k5 k6
i1 1 1 0 1 0 0
i2 1 1 1 0 0 0
i3 0 1 1 0 0 1
i4 1 0 0 1 1 0
i5 0 0 0 1 1 1
i6 0 0 1 0 1 1 ;
Binary Variable Y(k);
Variables
z "Set Covering"
Equation AgebtoPtoEnc(i) , Def_obj ;
AgebtoPtoEnc(i)..sum(k, Y(k)*d(i,k)) =g= 1 ; Def_obj..z =e= sum(k, Y(k));
Model setcovering / all / ; Solve setcovering using mip minimizing z;
Display z.l, y.l ;

On 2/17/13, Victor Ortiz wrote:
> > Hello All,
> >
> >
> >
> > I need help with the problem below, I think the problem is in the
> > equation â€œAgebtoPtoEnc..â€
> >
> >
> >
> > Iâ€™ll be very gratefully if someone could help me.
> >
> >
> >
> > Best Regards
> >
> > VÃ­ctor OrtÃ­z
> >
> >
> >
> >
> >
> >
> >
> > * TITLE Set Covering;
> >
> >
> >
> > Set i / i1*i6 / ;
> >
> > Set k / k1*k6 / ;
> >
> >
> >
> > Table d(i,k)
> >
> >
> >
> > k1 k2 k3 k4 k5 k6
> >
> > i1 1 1 0 1 0 0
> >
> > i2 1 1 1 0 0 0
> >
> > i3 0 1 1 0 0 1
> >
> > i4 1 0 0 1 1 0
> >
> > i5 0 0 0 1 1 1
> >
> > i6 0 0 1 0 1 1 ;
> >
> >
> >
> > Binary Variable Y(k);
> >
> >
> >
> > Variables
> >
> > z "Set Covering"
> >
> >
> >
> > Equation AgebtoPtoEnc , Def_obj ;
> >
> >
> >
> > AgebtoPtoEnc..
> >
> >
> >
> > sum(k, Y(k)*d[i,k)) =g= 1 ;
> >
> >
> >
> > Def_obj..
> >
> >
> >
> > z =e= sum(k, Y(k));
> >
> >
> >
> > Model setcovering / all / ;
> >
> >
> >
> > Solve setcovering using mip minimizing z;
> >
> >
> >
> > Display z.l, y.l ;
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "gamsworld" group.
> > 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.
> >
> >
> >

--
"gamsworld" group.
To unsubscribe from this group and stop receiving emails from it, send an
To post to this group, send email to gamsworld@googlegroups.com.