help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] Pseudo boolean constraint


From: Michael Hennebry
Subject: Re: [Help-glpk] Pseudo boolean constraint
Date: Wed, 2 Jun 2004 11:25:58 -0500 (CDT)

On Wed, 2 Jun 2004, Henri Gourvest wrote:

> I have a special constraint:
>
>    x1 + x2 + x3 >=  2
> or
>    x1 + x2 + x3 <= 0
>
> I want the result set to be:
> 0 0 0
> 1 1 0
> 1 0 1
> 0 1 1
> 1 1 1
>
> But the constraints seem to be unsatisfaible because I don't know how to
> write the "OR" constraint.
> I'm not sure it is possible but perhaps someone have an idea ...

This is really a MILP question, not a GLPK question.

I'm assuming that x1, x2, and x3 are binary variables.
There are 3 combinations you want to eliminate:
001, 010, and 100.
Add the following constraints:
  x1 + x2 - x3 >= 0
  x1 - x2 + x3 >= 0
 -x1 + x2 + x3 >= 0

This technique won't always get you the convex hull,
but in this case I think that it does.

-- 
Mike   address@hidden
"Nothing says it like words if you know how to use them."
                    --  the Professional Organization of English Majors





reply via email to

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