help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] Conditions for glpsol


From: Michael Hennebry
Subject: Re: [Help-glpk] Conditions for glpsol
Date: Thu, 24 May 2012 12:34:58 -0500 (CDT)
User-agent: Alpine 1.00 (DEB 882 2007-12-20)

On Thu, 24 May 2012, esma mehiaoui wrote:

Could somebody tell me how to express the following condition in a linear 
constraint ?
if A = 1 and B = 1 then C = 1 
if A = 1 and B = 0 then C = 0 if A = 0 and B = 1 then C = 0 if A = 0 and B = 0 then C = 0
Ps: just for precision it is not a logical AND the difference is that in my 
case i should to have the value zero for C if A or B or both are equal to 0.

I'm not sure what distinction you are drawing here.
Supposing (A, B, C) has precisely four allowed values:
The convex hull is a simplex. It has four facets.
C>=0
C<=A
C<=B
C>=A+B-1

A, B integer

All the best Esma

This is where your PS would go.

--
Michael   address@hidden
"On Monday, I'm gonna have to tell my kindergarten class,
whom I teach not to run with scissors,
that my fiance ran me through with a broadsword."  --  Lily

reply via email to

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