[Top][All Lists]

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

Re: [Help-glpk] min() & max() functions alternatives to use non numeric

From: Suleyman Demirel
Subject: Re: [Help-glpk] min() & max() functions alternatives to use non numeric parameters
Date: Wed, 27 Apr 2011 15:34:48 -0400

When the objective function is z = maximize minimum of (x,y), this is not a linear program. So, you cannot use min() function. However, you may convert this to an LP by modifying your objective function and adding additional constraints. Depending on your problem structure, you may have to add a binary variable, as well.

Similarly, you cannot use min() function in constraints for the same reasons.

On Wed, Apr 27, 2011 at 2:38 PM, nikel90 <address@hidden> wrote:

Good evining!

I've got a problem with the max() and min() functions...

i need to do something like this:
in my "objective function"

but min() accepts only numeric parameters..

is there any alternatives?

thank you!


the entire model:

/* Trimestri*/
var PrimoStd >=0, integer;
var SecondoStd >=0, integer;
var TerzoStd >=0, integer;
var QuartoStd >=0, integer;
var PrimoStra >=0, integer;
var SecondoStra >=0, integer;
var TerzoStra >=0, integer;
var QuartoStra >=0, integer;
var ScorteIniziali >=0, integer;
/* Objective function */
maximize z:
+ (min(180,ScorteIniziali+PrimoStd+PrimoStra-120 +
+ (min(120,ScorteIniziali+PrimoStd+PrimoStra-120 +
SecondoStd+SecondoStra-310 +
+ SecondoStd+SecondoStra-310 +
- (ScorteIniziali*45 + ScorteIniziali+PrimoStd+PrimoStra-120 +
SecondoStd+SecondoStra-310 + TerzoStd+TerzoStra-180 +

/* Constraints */
s.t. a: ScorteIniziali - ScorteIniziali+PrimoStd+PrimoStra-120 +
SecondoStd+SecondoStra-310 + TerzoStd+TerzoStra-180 +
QuartoStd+QuartoStra-120  <= 0;

View this message in context:
Sent from the Gnu - GLPK - Help mailing list archive at

Help-glpk mailing list

Sent via my good, old desktop.
Suleyman Demirel - Office: (734) 647-3167

PhD Candidate in Operations Management
Stephen M. Ross School of Business
University of Michigan, Ann Arbor

reply via email to

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