help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] Division


From: glpk xypron
Subject: Re: [Help-glpk] Division
Date: Wed, 19 Oct 2011 22:16:55 +0200

Hello Kasper,

in your original formulation I remarked:
o[s,u] cannot be 0, or you have a division by 0.

If the size of sets S, U and the maximum expected value of o is small,
you could use a binary y for each possible value of o[s,u]:

set O :=  {1 .. o_max};

s.t. phase{u in U, j in 1..3}:
  sum{s in S, o in O} ps[s] * y[s,j,u,o] / o = d[j,u];

s.t. c{u in U, j in 1..3, s in S}: sum{o in O} y[s,j,u,o] = 1;

Best regards

Xypron

-------- Original-Nachricht --------
> Datum: Wed, 19 Oct 2011 12:47:03 +0200
> Betreff: [Help-glpk] Division

> Hi Guys
> I find myself in need of a constraint that should look like this:
> 
> s.t. phase{u in U, j in 1..3}: sum{s in S} ((ps[s] * y[s,j,u]) / o[s,u]) =
> d[j,u];
> 
> But since division with o[s,u] is not linear I can't do that.
> So can anyone explain how one could make the constraint linear?
> 
> set S;
> set U;
> param ps {s in S}, integer, > 0;
> var y {s in S, j in 1..3, u in U}, binary;
> var o {s in S, u in U}, integer, >= 0;
> var d {j in 1..3, u in U}, integer, >= 0;
> 
> Regards,
> Kasper

-- 
Follow me at http://twitter.com/#!/xypron

Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de



reply via email to

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