help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] Decision var


From: Kasper Tordrup
Subject: Re: [Help-glpk] Decision var
Date: Mon, 21 Nov 2011 13:30:47 +0100

Hi
Sorry but I can figure this out.
What would I do if I have:

set S := s1 s2 s3 s4;
set R := r1 r2 ;
param fr := r1 42
r2 42 ;

var x {s in S, r in R, i in 1..fr[r]}, binary;

and I want to, lets say force x[s1,r2,10] to be 1?

Best regards,
Kasper

On Thu, Nov 10, 2011 at 5:30 PM, Andrew Makhorin <address@hidden> wrote:
> I got a question regarding a decision var.
> My problem is that I got this decision var, that is kinda half
> decision var and half a constant.
> So my question is, is it possible so define some of the values of a
> decision var in the data file and let GLPK decide the rest?
>
> I know that one way to solve this is just to "subtract" the ones that
> is set from the problem and then solve the rest, but it would be nice
> to know if I could do it like that also.

You may fix some decision variables at certain constant values by
introducing appropriate equality constraints, for example,

var x{j in J};

set C, within J;

s.t. foo{j in C}: x[j] = 3.14159;



reply via email to

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