help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] Creating variables


From: Seung Mo Gu
Subject: Re: [Help-glpk] Creating variables
Date: Fri, 2 Apr 2010 09:57:52 +0400

So if any variables I generate, that don #39;t exist in any of the constraint 
or objective, will not be stored in memory?

2010/4/1 Andrew Makhorin <address@hidden>
> Hello, I am currently a student working on a scheduling project and
> incorporating the use of GLPK. I am having some trouble due to memory
> constraints and was wondering how I would go about creating certain
> variables (in the case that you know certain values will be zero in
> optimal solution so might as well save memory and not consider them in
> the model). Currently I am using GUSEK to program this. Here is the
> portion where I create the variables as it is now:

>     /* Decision Variable: Binary: Worker i does Job j before Job k */

>     var X{i in W,j in J, k in J},binary;

>     /*Decision Variable: Begnning Times of Each Job*/

>     var Begin{i in W,j in J},integer,>=0;



> Because I #39;m doing this on a large scale problem, many X
> variables are generated but I don #39;t need all of them because most
> will be zero. Is there a way I can only create certain X and Begin
> variables given conditions for each one?



Only those variables are generated which are actually referenced in
constraints or objective.

If you know or can predict which variables will be zero in optimal
solution, you can explictly fix them; for example:

  s.t. foo{i in W,j in J, k in J: condition} x[i,j,k] = 0;

Then the mip preprocessor will remove such variables and corresponding
equality constraints.










-- 
Seung Mo Gu

Undergraduate Student
Georgia Institute of Technology
ISyE Operations Research and Statistics
 
So if any variables I generate, that don't exist in any of the constraint or objective, will not be stored in memory?

2010/4/1 Andrew Makhorin <address@hidden>
> Hello, I am currently a student working on a scheduling project and
> incorporating the use of GLPK. I am having some trouble due to memory
> constraints and was wondering how I would go about creating certain
> variables (in the case that you know certain values will be zero in
> optimal solution so might as well save memory and not consider them in
> the model). Currently I am using GUSEK to program this. Here is the
> portion where I create the variables as it is now:

>     /* Decision Variable: Binary: Worker i does Job j before Job k */

>     var X{i in W,j in J, k in J},binary;

>     /*Decision Variable: Begnning Times of Each Job*/

>     var Begin{i in W,j in J},integer,>=0;

> Because I #39;m doing this on a large scale problem, many X
> variables are generated but I don #39;t need all of them because most
> will be zero. Is there a way I can only create certain X and Begin
> variables given conditions for each one?

Only those variables are generated which are actually referenced in
constraints or objective.

If you know or can predict which variables will be zero in optimal
solution, you can explictly fix them; for example:

  s.t. foo{i in W,j in J, k in J: condition} x[i,j,k] = 0;

Then the mip preprocessor will remove such variables and corresponding
equality constraints.






--
Seung Mo Gu

Undergraduate Student
Georgia Institute of Technology
ISyE Operations Research and Statistics

reply via email to

[Prev in Thread] Current Thread [Next in Thread]