Hello Simone, There was a typo s.t. c4 : y >=0; # (3,0)-(0,0)
Best regards Xypron xypron wrote: > > Hello Simone, > > if the solution of a linear program is unique, it will always be in a > vertex of the > convex polyeder described by the constraints. > > The objective function gives the optimization direction and hence decides > which > vertex of the polygon is the solution. > > For a two dimensional problem lets think of an polygon given by the > following vertices: > (0,0) (1,1) (2,1) (3,0) > This corresponds to the following inequalities: > s.t. c1 : x - y >= 0; # (0,0)-(1,1) > s.t. c2 : y <= 1; # (1,1)-(2,1) > s.t. c3 : x + y <= 3; # (2,1)-(3,0) > s.t. c4 : x >=0; # (3,0)-(0,0) > > If our optimization direction is (1,1) the objective is > maximize obj : x + y; > The solution is vertex (2,1) > > If our optimization direction is (-1,1) the objective is > maximize obj: -x + y; > The solution is vertex (1,1); > > The complete model is: > > var x; > var y; > > # uncomment the appropriate objective > #maximize obj : x + y; # direction (1,1); > maximize obj : -x + y; # direction (-1,1); > > s.t. c1 : x - y >= 0; # (0,0)-(1,1) > s.t. c2 : y <= 1; # (1,1)-(2,1) > s.t. c3 : x + y <= 3; # (2,1)-(3,0) > s.t. c4 : x >=0; # (3,0)-(0,0) > solve; > printf "x = %6.3f, y = %6.3f\n", x, y; > end; > > Best regards > > Xypron > > > Simone Atzeni wrote: >> >> Hi all, >> >> I'm looking for two functions that could represent simple KPIs. >> >> In other world, I would like two MILP, in this way: >> >> MILP 1: >> >> MAX J = 0.5 * Z1 + 0.5 * Z2 >> >> Z1 = -AX + C >> Z2 = BX + D >> >> and >> >> MILP 2: >> >> MAX J = 0.32 * Z1 + 0.68 * Z2 >> >> Z1 = -AX + C >> Z2 = BX + D >> >> Z1 and Z2 are the values of the KPI and they depend on X. The >> constraints should be equal but the results (the values of Z1 and Z2) >> should be different changing the coefficients fo the objective >> function, in this case (0.5 - 0.5) for the MILP1 and (0.32 - 0.68) for >> the MILP 2. >> >> I can't find a good function. I need just functions where Z1 and Z2 >> depend on X but changing the coefficients in the objective functions >> change the values of Z1, Z2 and X. >> >> MILPs I'm using are the follow: >> >> MAX J = 0.5 Z.1 + 0.5 Z.2 >> >> Z.1 = 5X (0.196116135138184 Z.1 - 0.98058067569092 U.1 <= 0) (the >> equations have been normalized) >> Z.2 = -3X + 4 (0.196116135138184 Z.2 + 0.115384615384615 U.1 <= >> 0.153846153846154) >> >> and >> >> MAX J = 0.32 Z.1 + 0.68 Z.2 >> >> Z.1 = 5X >> Z.2 = -3X + 4 >> >> This is the picture of the two functions: >> >> >> >> Both MILPs have the same solution. >> >> Z.1 = 1 >> Z.2 = 0.666795 >> X = 0.2 >> >> In this case the weights, (0.5 - 0.5) for the MILP1 and (0.32 - 0.68) >> for the MILP 2, don't influence the results of the MILP. I want >> something in a way that the weights influence the results, so that the >> two MILPs have different result but they should being equal. >> >> Can someone help me? >> >> Thanks >> Simone >> >> >> _______________________________________________ >> Help-glpk mailing list >> Help-glpk@gnu.org >> http://lists.gnu.org/mailman/listinfo/help-glpk >> >> > > -- View this message in context: http://www.nabble.com/KPI-simple-function-tp26025826p26030427.html Sent from the Gnu - GLPK - Help mailing list archive at Nabble.com. _______________________________________________ Help-glpk mailing list Help-glpk@gnu.org http://lists.gnu.org/mailman/listinfo/help-glpk