When the objective function is z = maximize minimum of (x,y), this is not a linear program. So, you cannot use min() function. However, you may convert this to an LP by modifying your objective function and adding additional constraints. Depending on your problem structure, you may have to add a binary variable, as well.
Similarly, you cannot use min() function in constraints for the same reasons. On Wed, Apr 27, 2011 at 2:38 PM, nikel90 <[email protected]> wrote: > > Good evining! > > I've got a problem with the max() and min() functions... > > i need to do something like this: > min(120,ScorteIniziali+PrimoStd+PrimoStra)*70 > in my "objective function" > > but min() accepts only numeric parameters.. > > is there any alternatives? > > thank you! > > Nikel > > the entire model: > > # > # > /* Trimestri*/ > var PrimoStd >=0, integer; > var SecondoStd >=0, integer; > var TerzoStd >=0, integer; > var QuartoStd >=0, integer; > var PrimoStra >=0, integer; > var SecondoStra >=0, integer; > var TerzoStra >=0, integer; > var QuartoStra >=0, integer; > var ScorteIniziali >=0, integer; > # > /* Objective function */ > maximize z: > > (min(120,ScorteIniziali+PrimoStd+PrimoStra)*70)-(((max(PrimoStd,SecondoStd,TerzoStd)*3*10)+(PrimoStra*3*15))+(max(0,ScorteIniziali+PrimoStd+PrimoStra-120)*6)+((PrimoStd+PrimoStra)*15)) > + > > (min(310,ScorteIniziali+PrimoStd+PrimoStra-120+SecondoStd+SecondoStra)*70)-(((max(PrimoStd,SecondoStd,TerzoStd)*3*10)+(SecondoStra*3*15))+(max(0,ScorteIniziali+PrimoStd+PrimoStra-120+SecondoStd+SecondoStra-310)*6)+((SecondoStd+SecondoStra)*15)) > + (min(180,ScorteIniziali+PrimoStd+PrimoStra-120 + > > SecondoStd+SecondoStra-310+TerzoStd+TerzoStra)*70)-(((max(PrimoStd,SecondoStd,TerzoStd)*3*10)+(TerzoStra*3*15))+(max(0,ScorteIniziali+PrimoStd+PrimoStra-120 > + > > SecondoStd+SecondoStra-310+TerzoStd+TerzoStra-180)*6)+((TerzoStd+TerzoStra)*15)) > + (min(120,ScorteIniziali+PrimoStd+PrimoStra-120 + > SecondoStd+SecondoStra-310 + > > TerzoStd+TerzoStra-180+QuartoStd+QuartoStra)*70)-(((max(PrimoStd,SecondoStd,TerzoStd)*3*10)+(QuartoStra*3*15))+(max(0,ScorteIniziali+PrimoStd+PrimoStra-120 > + SecondoStd+SecondoStra-310 + > > TerzoStd+TerzoStra-180+QuartoStd+QuartoStra-120)*6)+((QuartoStd+QuartoStra)*15)) > - (ScorteIniziali*45 + ScorteIniziali+PrimoStd+PrimoStra-120 + > SecondoStd+SecondoStra-310 + TerzoStd+TerzoStra-180 + > QuartoStd+QuartoStra-120*45); > > /* Constraints */ > # > s.t. a: ScorteIniziali - ScorteIniziali+PrimoStd+PrimoStra-120 + > SecondoStd+SecondoStra-310 + TerzoStd+TerzoStra-180 + > QuartoStd+QuartoStra-120 <= 0; > end; > > -- > View this message in context: > http://old.nabble.com/min%28%29---max%28%29-functions-alternatives-to-use-non-numeric-parameters-tp31489922p31489922.html > Sent from the Gnu - GLPK - Help mailing list archive at Nabble.com. > > > _______________________________________________ > Help-glpk mailing list > [email protected] > https://lists.gnu.org/mailman/listinfo/help-glpk > -- _________________________________________ Sent via my good, old desktop. _________________________________________ Suleyman Demirel - Office: (734) 647-3167 PhD Candidate in Operations Management Stephen M. Ross School of Business University of Michigan, Ann Arbor Web: http://www.umich.edu/~sdemirel _________________________________________
_______________________________________________ Help-glpk mailing list [email protected] https://lists.gnu.org/mailman/listinfo/help-glpk
