one stupid way may be is a+x=b+y u<=x M*u>=x v<=y M*v>=y u+v<=1 c=a+(b-a)v
u,v binary x,y integer >=0 M - large integer On Thu, Nov 18, 2010 at 5:39 PM, dhiguero <[email protected]>wrote: > > Hi everybody, > > I am trying to represent a problem using linear programming and I got > stuck in how to model the minimum function. My problem is being c,a,b > variables of the problem (not params), I would like to declare c as c = > min(a,b). I have tried the approach of introducing a new binary variable B, > such as: > > # c = min (a, b) > (a-b)B >= 0 > (a-b)(1-B) <= 0 > c = aB+b(1-B) > > But the problem is that I receive a "multiplication of linear forms not > allowed". Does anybody have any suggestion or solution on how to model this > type of requirement? In order to clarify the context of the problem, imagine > that a set of machines can be assigned different network cards (type A with > speed 10, type B with speed 100). The assignation of type A and type B > depends on the cost function, let's say A cost 100€ and B cost 200€. In this > scenario I now want to add the cost of transfering data between 2 machines > which is limited by the minimum speed. > > Thanks for your time, any comment is appreciated. > > Best Regards, > > Daniel > > > _______________________________________________ > Help-glpk mailing list > [email protected] > http://lists.gnu.org/mailman/listinfo/help-glpk >
_______________________________________________ Help-glpk mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-glpk
