[Top][All Lists]

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

Re: [Help-glpk] forall and exists?

From: Jay Hutfles
Subject: Re: [Help-glpk] forall and exists?
Date: Tue, 7 May 2013 00:48:32 -0500

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?

reply via email to

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