[Top][All Lists]

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

Re: [Help-glpk] minimising after maximising

From: Michael Hennebry
Subject: Re: [Help-glpk] minimising after maximising
Date: Mon, 6 Jun 2011 10:16:20 -0500 (CDT)
User-agent: Alpine 1.00 (DEB 882 2007-12-20)

On Mon, 6 Jun 2011, Nick Farrell wrote:

Wouldn't that mean that z[] was always >= 3?

Yes.  That is what you asked for.

I want z[j] to be x[j] if x[j] < 3, 3 otherwise.

Minimizing a minimum is trickier.

z[j] <= x[j]
z[j] <= 3
z[j] >= 3 - M[j] b[j]
z[j] >= x[j] - N[j] (1-b[j])

where the b's are new binary variables and the
M's and N's are new, possibly large, constants.

Selecting their values is left as an exercise for the reader.

On Mon, Jun 6, 2011 at 11:24 AM, Michael Hennebry <
address@hidden> wrote:

On Sun, 5 Jun 2011, Nick Farrell wrote:

 I'm pretty new to linear programming and would like a quick tip.

In the script below, what I *want* to happen is that I first choose the
worst (ie: max) of x[p] and 3, and then solve for the minimum sum of these


 ie: I would like z to look like: {1, 2, 3, 3, 3} and then to minimise on
sum of these.

min SUM z[j]

Michael   address@hidden
"Pessimist: The glass is half empty.
Optimist:   The glass is half full.
Engineer:   The glass is twice as big as it needs to be."

reply via email to

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