I have another question, I did what you told me about the glp_write_lp and I find 1 difference between the file i got and the model Im trying to make, its that in the first one almost at the end of the file theres a line that says Binaries and it follows the variables that are binaries. But in mine instead of saying binaries it says generals. How can I change that?
I already have glp_set_col_kind setting the columns as Binaries with GLP_BV. On Sat, Aug 30, 2008 at 12:50 AM, Andrew Makhorin <[EMAIL PROTECTED]> wrote: > > How do I tell GLPK by API to not use a few variables, lets say that > > I dont want that the variables Y appear at the Minimize at the top of > > the problem file. like this. > > > *** OBJECTIVE FUNCTION *** > > > Minimize: OBJF > > 7 x[0,1] > > 12 x[0,2] > > 17 x[0,3] > > 7 x[0,4] > > 5 x[1,1] > > 9 x[1,2] > > 14 x[1,3] > > 7 x[1,4] > > 3 x[2,1] > > 7 x[2,2] > > 12 x[2,3] > > 8 x[2,4] > > 2 x[3,1] > > 5 x[3,2] > > 10 x[3,3] > > 9 x[3,4] > > 1 Y1 > > -1 Y2 > > 1 Y3 > > -1 Y4 > > *** ROWS (CONSTRAINTS) *** > > Row 1: APPLE1 = 1 > > 7 x[0,4] > > 17 x[0,3] > > 12 x[0,2] > > 7 x[0,1] > > > > This is part of the output fo glpk when I use the function > > lpx_print_prob(lp); > > > And the variables Y that appear at Minimize I do not want them to > > appear there. Is there a way? > > Y's appear in the objective function because you specified non-zero > objective coefficients for them. To change objective coefficients use > the api routine glp_set_obj_coef. For more details please see the > reference manual. > > BTW, you could use glp_write_lp(lp, NULL, "filename") rather than > lpx_print_prob; its output is more readable. > > -- José I. Monreal Bailey
_______________________________________________ Help-glpk mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-glpk
