help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] Model min() or max() function


From: Patrik Dufresne
Subject: Re: [Help-glpk] Model min() or max() function
Date: Tue, 20 Aug 2013 18:13:07 -0400

Sorry for the previous post, I mistakenly click the button send. My bad.

Let me rephrase my problem. I need to model something similar to :

Maximize
   max(a, b + c + d, e + f, g+ h + i)
   
Subject to
   a+b+c+d+e+f+g+h+i <= ..
   a + b + .. <= d + e+ + ..
   etc.

According to this this post, I need to use the big-M method to achieve the expected behaviour. I understand the concept of big-M, but I can't figure out how to use it.

--
Patrik Dufresne



On Tue, Aug 20, 2013 at 6:02 PM, Patrik Dufresne <address@hidden> wrote:
>
> Minimize
>     (c1 * x1) + (c2 * x2) + (c3 * x3) + (c4 * max(c1*x1, c2*x2, c3*x3))
> subject to
>     #some arbitrary integer constraints:
>     x1 >= ...
>     x1 + 2*x2 <= ...
>     x3 >= ...
>     x1 + x3 == ...
>
>
>
> --
> Patrik Dufresne
>
>
>
> On Mon, Aug 19, 2013 at 2:50 PM, Patrik Dufresne <address@hidden> wrote:
>>
>> Hello,
>>
>> I'm using glpk-java. I need to model a max() function similar to Excel.
>> max(3, 5, 7, 1) = 7
>>
>> e.g.:
>> a,b,c,d,e,f,g,h and i are binary variables
>> m is an integer variable [0..+infinity[
>>
>> m <= max(a, b + c  + d, e + f, g+ h + i)
>>
>> Any suggestion?
>>
>> --
>> Patrik Dufresne
>>
>

reply via email to

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