[Top][All Lists]

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

Re: [Help-glpk] Creating variables

From: Andrew Makhorin
Subject: Re: [Help-glpk] Creating variables
Date: Thu, 1 Apr 2010 21:27:01 +0400

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

reply via email to

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