Anyone can help me?

Archive of Gamsworld Google Group
Post Reply
Archiver
User
User
Posts: 7876
Joined: 7 years ago

Anyone can help me?

Post by Archiver »



Dear friends

I am a student and recently, I have been working on a small project
and try to solve a problem that I met. I just explain my problem in
very short:

set i /i1*i5/
set j /j1*j7/

bianary variable x(i,j)

after solving using MIP
display x.l

now my problem is: for example, if x(i1,j2),x(i2,j1) are the solution
of the model, and then I would like to use the rest sets i / i3,i4,i5/
and j /j3,j4,j5,j6,j7/ to programm another model, how can I fullfill ?
I ever tried to use abort$(x(i,j)=1) or not x(i,j)=1, but it doesn't
work like what I expect. Could you be kind enough to suggest me what
I'm supposed to do?

Best regards
Sincerely yours
Jens
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---


Archiver
User
User
Posts: 7876
Joined: 7 years ago

Re: Anyone can help me?

Post by Archiver »


Try looking into the use of dynamic sets.
I have not used it before but sounds something similar.

- Yogendra.


On Mon, Apr 27, 2009 at 11:16 AM, Jens wrote:


Dear friends

I am a student and recently, I have been working on a small project
and try to solve a problem that I met. I just explain my problem in
very short:

set i /i1*i5/
set j /j1*j7/

bianary variable x(i,j)

after solving using MIP
display x.l

now my problem is: for example, if x(i1,j2),x(i2,j1) are the solution
of the model, and then I would like to use the rest sets i / i3,i4,i5/
and j /j3,j4,j5,j6,j7/ to programm another model, how can I fullfill ?
I ever tried to use abort$(x(i,j)=1) or not x(i,j)=1, but it doesn't
work like what I expect. Could you be kind enough to suggest me what
I'm supposed to do?

Best regards
Sincerely yours
Jens



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

Archiver
User
User
Posts: 7876
Joined: 7 years ago

Re: Anyone can help me?

Post by Archiver »


Hi... maybe a simple solution is create a parameter that has the same value that the binary variable after solving the problem... something like this:

parameter xpar(i,j)

x.l(i,j)=xpar(i,j); (note that xpar(i,j) can be one or zero)

Then you should define the second model using a general formulation, i.e. all the equations that you have to use independient of the binary variable value, and then multiply the equations by the parameter defined in an appropiate way (by xpar(i,j) or (1-xpar(i,j)). As the parameter only must be one or zero:

if xpar(i,j)=0, then some equations will be like:
0=0 (allways true, "inactive constraints")

and the others will be

f(i,j)=g(i,j) ("active constraints").

hope this helps

Best regards




2009/4/27 Jens


Dear friends

I am a student and recently, I have been working on a small project
and try to solve a problem that I met. I just explain my problem in
very short:

set i /i1*i5/
set j /j1*j7/

bianary variable x(i,j)

after solving using MIP
display x.l

now my problem is: for example, if x(i1,j2),x(i2,j1) are the solution
of the model, and then I would like to use the rest sets i / i3,i4,i5/
and j /j3,j4,j5,j6,j7/ to programm another model, how can I fullfill ?
I ever tried to use abort$(x(i,j)=1) or not x(i,j)=1, but it doesn't
work like what I expect. Could you be kind enough to suggest me what
I'm supposed to do?

Best regards
Sincerely yours
Jens




--
Daniel Andrés Navia López
Ingeniero Civil Químico
Mg.Sc.Ciencias de la Ingeniería, Mención Ingeniería Química
626752875

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

Archiver
User
User
Posts: 7876
Joined: 7 years ago

Re: Anyone can help me?

Post by Archiver »



Hi,all

I tried this way,but it doesn't work,,,honestly,,I really think this
way is reasonable. I think I have to know the way to write the code
for another model after solving one.

Any news,will update.

Thank you very much

Jens

On Apr 28, 9:59 am, daniel navia wrote:
> > Hi... maybe a simple solution is create a parameter that has the same value
> > that the binary variable after solving the problem... something like this:
> >
> > parameter xpar(i,j)
> >
> > x.l(i,j)=xpar(i,j); (note that xpar(i,j) can be one or zero)
> >
> > Then you should define the second model using a general formulation, i.e.
> > all the equations that you have to use independient of the binary variable
> > value, and then multiply the equations by the parameter defined in an
> > appropiate way (by xpar(i,j) or (1-xpar(i,j)). As the parameter only must be
> > one or zero:
> >
> > if xpar(i,j)=0, then some equations will be like:
> > 0=0 (allways true, "inactive constraints")
> >
> > and the others will be
> >
> > f(i,j)=g(i,j) ("active constraints").
> >
> > hope this helps
> >
> > Best regards
> >
> > 2009/4/27 Jens
> >
> >
> >
> >
> >
> >
> >
>> > > Dear friends
> >
>> > > I am a student and recently, I have been working on a small project
>> > > and try to solve a problem that I met. I just explain my problem in
>> > > very short:
> >
>> > > set i /i1*i5/
>> > > set j /j1*j7/
> >
>> > > bianary variable x(i,j)
> >
>> > > after solving using MIP
>> > > display x.l
> >
>> > > now my problem is: for example, if x(i1,j2),x(i2,j1) are the solution
>> > > of the model, and then I would like to use the rest sets i / i3,i4,i5/
>> > > and j /j3,j4,j5,j6,j7/ to programm another model, how can I fullfill ?
>> > > I ever tried to use abort$(x(i,j)=1) or not x(i,j)=1, but it doesn't
>> > > work like what I expect. Could you be kind enough to suggest me what
>> > > I'm supposed to do?
> >
>> > > Best regards
>> > > Sincerely yours
>> > > Jens
> >
> > --
> > Daniel Andrés Navia López
> > Ingeniero Civil Químico
> > Mg.Sc.Ciencias de la Ingeniería, Mención Ingeniería Química
> > 626752875- Hide quoted text -
> >
> > - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---


Post Reply