Look at qfit.mod in the glpk examples.
When you have your table called Sample with i,j,and x defined
set Sample;
param i {z in Sample};
param j {z in Sample};
param x {z in Sample};
then somthing like:
test{z in Sample}: varcost[i[z],j[z]] * x[i[z],j[z]] >= 0;
> ----- Original Message -----
> From: "Michael Hennebry" <[email protected]>
> To: SpaceRider <[email protected]>
> Cc: [email protected]
> Subject: Re: [Help-glpk] Transport Problem advanced
> Date: Tue, 21 Apr 2009 09:09:10 -0500 (CDT)
>
>
> On Tue, 21 Apr 2009, SpaceRider wrote:
>
> > Now, I insert each combination into a table. If a combination isn't
> > possible, the value ist "-1". All possible combinations get positive values
> > ("0.02","0.04", etc.).
> >
> > Because of that I have to insert a special rule in model:
> > "s.t. positive_result {i in I, j in J}: varcost[i,j] * x[i,j] >= 0;"
> >
> > Is there a easier way to insert only possible combinations into a table and
> > to drop the special rule.
>
> A linear table with generic entry
> i, j, x[i,k]
> That is roughly how GLPK's API fills the constraint matrix.
>
> -- Michael [email protected]
> "Pessimist: The glass is half empty.
> Optimist: The glass is half full.
> Engineer: The glass is twice as big as it needs to be."
>
>
> _______________________________________________
> Help-glpk mailing list
> [email protected]
> http://lists.gnu.org/mailman/listinfo/help-glpk
>
--
_______________________________________________
Surf the Web in a faster, safer and easier way:
Download Opera 9 at http://www.opera.com
Powered by Outblaze
_______________________________________________
Help-glpk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-glpk