That is a good start. GLPK can use this as a biasis for integer optimisation. The output from simplex is a solution based on a continuous number system. You want a discreet solution. It would be nice if just rounding the continuous solution to the nearest integer produced the answer. Usually it doesn't.
You must next call glp_intopt using your simplex produced basis as the parameter. To obtain the answer you must then use glp_mip_col_val for individual columns, or glp_print_mip for the entire solution. You might like to also call glp_print_sol and compare how close the actual values in glp_print_mip are to the values in glp_print_sol if you just rounded them. -- Nigel Galloway [1][email protected] On Sep 5 ’11, "name name" <[email protected]> wrote: I solve it with glp_simplex(lp, parm) routine On Mon, Sep 5, 2011 at 2:54 PM, Nigel Galloway <[2][email protected]> wrote: The question is how do you solve the problem, and how do you obtain the solution. When you make all these columns binary you have a Diophantine Equation. GLPK can solve these, though there are other ways which may be better. GLPK will first solve it as a linear problem. It is then necessary to perform Integer Optimization. Having done this there are different routines to obtain the integer optimal solution as opposed to the linear solution. -- Nigel Galloway [3][email protected] On Mon, 05 Sep 2011 14:26 +0200, "name name" <[4][email protected]> wrote: On Mon, Sep 5, 2011 at 1:18 PM, Nigel Galloway <[5][email protected]> wrote: Do you obtain this value with GLPK.glp_get_mip_col_val ? no with .glp_set_col_kind Even if the type of variable is binary Lp give non integer value -- Nigel Galloway [6][email protected] On Mon, 05 Sep 2011 09:52 +0200, "name name" <[7][email protected]> wrote: Hello, I have a very strange problem I solve un Lp problem but the and the value of my variables are not ineger I got x(0,1)=0.2... even thaught when I print the type of my variables I got 3 coresponding to type binary( I got type to binary for all variables with GLPK.glp_set_col_kind(lp, i, GLPKConstants.GLP_BV)). Can you tell my where the problem could be? Thank you Onor _______________________________________________ Help-glpk mailing list [8][email protected] [9]https://lists.gnu.org/mailman/listinfo/help-glpk -- [10]http://www.fastmail.fm - Email service worth paying for. Try it for fr ee _______________________________________________ Help-glpk mailing list [11][email protected] [12]https://lists.gnu.org/mailman/listinfo/help-glpk -- [13]http://www.fastmail.fm - Does exactly what it says on the tin References 1. mailto:[email protected] 2. mailto:[email protected] 3. mailto:[email protected] 4. mailto:[email protected] 5. mailto:[email protected] 6. mailto:[email protected] 7. mailto:[email protected] 8. mailto:[email protected] 9. https://lists.gnu.org/mailman/listinfo/help-glpk 10. http://www.fastmail.fm/ 11. mailto:[email protected] 12. https://lists.gnu.org/mailman/listinfo/help-glpk 13. http://www.fastmail.fm/ -- http://www.fastmail.fm - mmm... Fastmail...
_______________________________________________ Help-glpk mailing list [email protected] https://lists.gnu.org/mailman/listinfo/help-glpk
