help-glpk
[Top][All Lists]
Advanced

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

RE: [Help-glpk] Glpsol IF-THEN-ELSE expression problem


From: Meketon, Marc
Subject: RE: [Help-glpk] Glpsol IF-THEN-ELSE expression problem
Date: Wed, 14 Feb 2007 22:41:57 -0500

A lousy way of doing it is to define a binary variable  y  (so y = 0 or 1) and
 
minimize   y
 
s.t. sum sum T[i,j,k] < M*y
 
where M is some suitable large value.  If the sum sum T[i,j,k] <= 0, then y is 0.  Otherwise, y is 1.
 
I'm sure that other users will have better ways of modeling this.
 
-Marc


From: address@hidden on behalf of Bill
Sent: Wed 2/14/2007 5:47 PM
To: address@hidden
Subject: [Help-glpk] Glpsol IF-THEN-ELSE _expression_ problem

Hi everyone,

I'm new to Glpk. I'm trying to model an optimazation problem for university
timetabling. In the objective function, I need to minimize the following
function,

g(sum sum T[i,j,k])

g() returns 1 if (sum sum T[i,j,k]) > 0 else 0

The problem is T[i,j,k] is a variable, IF-THEN-ELSE cannot handle variables in
the logical _expression_. Is there a way around it?

Can anyone help?

Thank you very much
B. Song



_______________________________________________
Help-glpk mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/help-glpk

----------------------------------------------------------------------------
This e-mail and any attachments may be confidential or legally privileged. If you received this message in error or are not the intended recipient, you should destroy the e-mail message and any attachments or copies, and you are prohibited from retaining, distributing, disclosing or using any information contained herein. Please inform us of the erroneous delivery by return e-mail.

Thank you for your cooperation.
----------------------------------------------------------------------------

reply via email to

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