[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] [Fwd: [Fwd: Re: Initializing a few decision variables]]
From: |
Andrew Makhorin |
Subject: |
Re: [Help-glpk] [Fwd: [Fwd: Re: Initializing a few decision variables]] |
Date: |
Mon, 01 Aug 2011 21:50:32 +0400 |
> I added two arrays of equal dimensions to the set, FT and FS, and
> initialized them in the data section
> They hold the paired values for the initial assignments.
> set FT := D1 B2 D2 B3 B1;
> set FS := 1 2 4 5 7;
>
> I added the following statement to the model
>
> s.t. init{f in FT,}: x[f,FS[f]] = 1;
>
> the error is that FS cannot be subscripted.
>
> Basic question remains on how to specify the initial assignment constraint
> in the model section
> and how to specify the pairs of initial assigments in the data section.
In the model section:
set F, dimen 2;
s.t. init{(i,j) in F}: x[i,j] = 1;
In the data section:
set F := D1 1, B2 2, D2 4, B3 5, B1 7;
Please see also examples included in glpk distribution.