help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] forall and exists?


From: xypron . glpk
Subject: Re: [Help-glpk] forall and exists?
Date: Tue, 7 May 2013 12:54:10 +0200 (CEST)

Hello Andrew,

GLPK is a linear programming solver. A constraint with an IF would not be 
linear.

In linear programming you might introduce binary variables for your purpose.

Or use a constraint programming solver.

Best regards

Heinrich Schuchardt

http://www.xypron.de

Am 07.05.13 um 07:48 schrieb Jay Hutfles

> Oh, I don't think there's anything wrong with them.  Well, except for how
> 
> I'm trying to use them.
> 
> 
> 
> I see that the examples only use them in computable parameters, though.  I
> 
> was trying to use them in constraints, and was getting errors along the
> 
> lines of "forall function does not exist" (sorry, I don't have the exact
> 
> error with me).  The constraints were of the form:
> 
> 
> 
>    for all a in A, if x[a] =1 then there exists a b in B such that
> 
> (something or another based on a)
> 
> 
> 
> I was having trouble directly implementing constraints of this form, so I
> 
> changed the "if p then q" form to "not p or q" like this:
> 
> 
> 
>    subject to C {a in A} :
> 
>       (1 - x[a]) + (if exists {b in B} (...something or other based on a..)
> 
> then 1 else 0) >= 1;
> 
> 
> 
> I'll have to try again in the morning when I'm more awake.  Thanks for the
> 
> guidance, Andrew.
> 
> 
> 
> 
> 
> 
> 
> On Mon, May 6, 2013 at 11:36 PM, Andrew Makhorin <address@hidden> wrote:
> 
> 
> 
> >
> 
> > > Can you provide a link to an example of each?  Any help would be
> 
> > > appreciated.
> 
> > >
> 
> >
> 
> > Please see glpk/examples/color.mod (for 'exists') and
> 
> > glpk/examples/egypt.mod (for 'forall').
> 
> >
> 
> > What is wrong with these operators?
> 
> >
> 
> >
> 
> >
> 
> _______________________________________________
> 
> Help-glpk mailing list
> 
> address@hidden
> 
> https://lists.gnu.org/mailman/listinfo/help-glpk



reply via email to

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