help-glpk
[Top][All Lists]
Advanced

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

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


From: Andrew Makhorin
Subject: Re: [Help-glpk] min() & max() functions alternatives to use non numeric parameters
Date: Thu, 28 Apr 2011 00:46:58 +0400

> I've got a problem with the max() and min() functions...
> 
> i need to do something like this:
> min(120,ScorteIniziali+PrimoStd+PrimoStra)*70
> in my "objective function"
> 
> but min() accepts only numeric parameters..
> 
> is there any alternatives?

A non-linear objective function like this

   maximize z = min(x1, x2) + min(x3, x4) + ...

can be modeled within mip as follows:

   z =  min_x1_x2 + min_x3_x4 + ...

   s.t. min_x1_x2 <= x1
        min_x1_x2 <= x2
        min_x3_x4 <= x3
        min_x3_x4 <= x4
        . . .

Note that max(x, y) = -min(-x, -y) that allows you to model objective
terms -max(x, y) thru min.





reply via email to

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