How to solve the optimization problem incrementally in GAMS

Dear all:

I have a question regarding coding in GAMS.

How could I code in GAMS in order to solve the optimization problem incrementally?

For example, I have a optimization problem with both the equality and inequality constraints.
What I would like to do is that I first solve the optimization problem with just equality constraints.
After that, I test the solution for the inequality constraints, if no inequality constraints is violated, exit and get the solution.
However, if any of the inequality constraints is violated. I may add the violated inequality constraints to the problem and
solve the problem again, the starting point would be the solution from the last problem. This process will repeat until no inequality
constraints is violated.

The reason that I would like to do this implementation is that the number of inequality in my problem is large but the number of binding
inequality is very small.

Thank you very much for your suggestions.

regards,
Xiaohu


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.
For more options, visit https://groups.google.com/groups/opt_out.

Hi Xiaohu



You could define several models and solve one after another.

  • Complete model

Model opt /eq1,……,eq100,ineq1…ineq100/; (or model opt /ALL/:wink:

  • Drop one of the inequality constraints

Model opt_ineq1 / eq1,……,eq100,ineq2…ineq100/;



Solve opt1_ineq1 …

Solve opt…;



Cheers



Renger




\


Modelworks

Gewerbestrasse 15

3600 Thun – Switzerland

+41 79 818 53 73

Info@modelworks.ch

blog.modelworks.ch





From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of Xiaohu Zhang
Sent: Freitag, 21. Februar 2014 22:19
To: gamsworld@googlegroups.com
Subject: How to solve the optimization problem incrementally in GAMS



Dear all:



I have a question regarding coding in GAMS.



How could I code in GAMS in order to solve the optimization problem incrementally?



For example, I have a optimization problem with both the equality and inequality constraints.

What I would like to do is that I first solve the optimization problem with just equality constraints.

After that, I test the solution for the inequality constraints, if no inequality constraints is violated, exit and get the solution.

However, if any of the inequality constraints is violated. I may add the violated inequality constraints to the problem and

solve the problem again, the starting point would be the solution from the last problem. This process will repeat until no inequality

constraints is violated.



The reason that I would like to do this implementation is that the number of inequality in my problem is large but the number of binding

inequality is very small.



Thank you very much for your suggestions.



regards,

Xiaohu


\

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.
For more options, visit https://groups.google.com/groups/opt_out.


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.
For more options, visit https://groups.google.com/groups/opt_out.

Hi,

I believe that you want to add or delete the constraint dynamically.

Hence, my strategy is to define the total constraints set and its two sub set , including all inequalities and equalities. Then you can define which one is truly used.

The rough code is as below:

Set Constraint;
Set Inequality_Constraint(Constraint);
Set Equality_Constraint(Constraint);

Equality_Constraint(Constraint)=yes; * Since you want to solve the equality first.
Inequality_Constraint(Constraint)=no;

Then you can define the constraints:

Inequality_Cut(Constraint)(Inequality_Constraint(Constraint)).. "your formulation" ; Equality_Cut(Constraint)(Equality_Constraint(Constraint))… “your formulation”;

In you iteration loop, you can simply specify the “yes” or “no” of Inequality_Constraint(Constraint) to active or de-active the inequality constraints in your model.

Hope this would be helpful.

Best,


On Friday, February 21, 2014 4:19:22 PM UTC-5, Xiaohu Zhang wrote:

Dear all:

I have a question regarding coding in GAMS.

How could I code in GAMS in order to solve the optimization problem incrementally?

For example, I have a optimization problem with both the equality and inequality constraints.
What I would like to do is that I first solve the optimization problem with just equality constraints.
After that, I test the solution for the inequality constraints, if no inequality constraints is violated, exit and get the solution.
However, if any of the inequality constraints is violated. I may add the violated inequality constraints to the problem and
solve the problem again, the starting point would be the solution from the last problem. This process will repeat until no inequality
constraints is violated.

The reason that I would like to do this implementation is that the number of inequality in my problem is large but the number of binding
inequality is very small.

Thank you very much for your suggestions.

regards,
Xiaohu


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.
For more options, visit https://groups.google.com/groups/opt_out.

Hi~
Thank you very much for your suggestions and time. I will try this method!

regards,
Xiaohu

On Saturday, February 22, 2014 10:44:32 AM UTC-5, yya…@ualberta.ca wrote:

Hi,

I believe that you want to add or delete the constraint dynamically.

Hence, my strategy is to define the total constraints set and its two sub set , including all inequalities and equalities. Then you can define which one is truly used.

The rough code is as below:

Set Constraint;
Set Inequality_Constraint(Constraint);
Set Equality_Constraint(Constraint);

Equality_Constraint(Constraint)=yes; * Since you want to solve the equality first.
Inequality_Constraint(Constraint)=no;

Then you can define the constraints:

Inequality_Cut(Constraint)(Inequality_Constraint(Constraint)).. "your formulation" ; Equality_Cut(Constraint)(Equality_Constraint(Constraint))… “your formulation”;

In you iteration loop, you can simply specify the “yes” or “no” of Inequality_Constraint(Constraint) to active or de-active the inequality constraints in your model.

Hope this would be helpful.

Best,


On Friday, February 21, 2014 4:19:22 PM UTC-5, Xiaohu Zhang wrote:

Dear all:

I have a question regarding coding in GAMS.

How could I code in GAMS in order to solve the optimization problem incrementally?

For example, I have a optimization problem with both the equality and inequality constraints.
What I would like to do is that I first solve the optimization problem with just equality constraints.
After that, I test the solution for the inequality constraints, if no inequality constraints is violated, exit and get the solution.
However, if any of the inequality constraints is violated. I may add the violated inequality constraints to the problem and
solve the problem again, the starting point would be the solution from the last problem. This process will repeat until no inequality
constraints is violated.

The reason that I would like to do this implementation is that the number of inequality in my problem is large but the number of binding
inequality is very small.

Thank you very much for your suggestions.

regards,
Xiaohu


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.
For more options, visit https://groups.google.com/groups/opt_out.