Hi Andrew, The point here is that GLPK has no api routines available to map MathProg variable and index name to the associated column number in the resulting MIP or LP problem. Only this mapping would help Benson to read the values of the objective function and the decision variables without parsing the output file.
Following your declarative approach of MathProg, I guess that Benson has to find another way to extract the solution components from a MathProg model in GLPK. In my previous response to his question I formulated a possible solution with xml files. In this solution you create a xml file as output of the MathProg program with a self made tag and tree structure. For reading xml files Java has many routines available. So, accessing the xml file with the appropriate variable tag will give the required value. I hope this clarifies the discussion. I can remember a previous discussion thread about this subject. Best regards, Ivo van Baren Netherlands ---- Andrew Makhorin <[EMAIL PROTECTED]> schrijft: > > I am writing a university timetabling language and solver in Java and > > I want to use the linear programming approach. I want to use a free > > solver and GLPK seems to be a good candidate. I intend the program to > > translate the timetabling problem into MathProg format and let the > > solver solves it. It seems that readModel in GlpkSolver allows me to > > do this, however it seems to output the result of the calculation in a > > file, is it possible to access parts of the solution without going to > > the file? Can I access the values, e.g. the value of the objective > > function in some ways? > > To obtain solution components you can use glpk api routines > glp_mip_status, glp_mip_obj_val, glp_mip_row_val, and glp_mip_col_val. > For more details see the reference manual, section "Mixed integer > programming routines". > > > > > _______________________________________________ > 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
