help-glpk
[Top][All Lists]
Advanced

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

[Help-glpk] [Fwd: Objective function defined with max, min.]


From: Andrew Makhorin
Subject: [Help-glpk] [Fwd: Objective function defined with max, min.]
Date: Thu, 05 Jan 2017 01:17:04 +0300

-------- Forwarded Message --------
From: Alexey Karakulov <address@hidden>
To: address@hidden
Subject: Objective function defined with max, min.
Date: Wed, 4 Jan 2017 23:43:20 +0200

Hi, I have this kind of function in the objective:

> crop(s) = max(0, min(1, s))


I wonder if it's possible (and how) to reformulate the task to be LP
problem. I have read this posting [1], but I'm not sure how to apply it.


> param maxN default 1000;
> param maxJ default 10;
> set N := 1 .. maxN;
> set J := 1 .. maxJ;
> param a{N};
> param w{N};
> var X0;
> var X{J};
> var S{maxJ .. maxN};


> maximize Obj: sum {n in N} w[n] * crop(S[n])

> subject to DefineS {n in maxJ .. maxN}: S[n] = X0 + sum {j in J} a[n-j
+1] * X[j]


[1]: http://lists.gnu.org/archive/html/help-glpk/2007-06/msg00005.html






reply via email to

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