help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-glpk] Some problem with using glp_iptcp() in Java


From: 周宗毅
Subject: [Help-glpk] Some problem with using glp_iptcp() in Java
Date: Tue, 3 Jul 2012 17:15:10 +0800

Dear all ,

I met some problem with using "glp_iptcp()" method.

Internet has some example code use "glp_smcp()" method.

It looks like this:

            glp_smcp parm;
            // Create problem
            lp = GLPK.glp_create_prob();
            System.out.println("Problem created");
            GLPK.glp_set_prob_name(lp, "Problem 1");
            // Define columns
            // Create constraints
            // Define objective
            // Solve model
            parm = new glp_smcp();
            GLPK.glp_init_smcp(parm);
            ret = GLPK.glp_simplex(lp, parm);

I wanted to change this to glp_iptcp() method , so I made some change with these:

    glp_iptcp parm;
            // Create problem
            // Define columns 
            // Create constraints
            // Define objective 
            // Solve model
            parm = new glp_iptcp();
            GLPK.glp_init_iptcp(parm);
            ret = GLPK.glp_interior(lp, parm);

Those two code with same row and column, but the answers are different. 
IPTCP always return "0.0" and SMCP return true answer.
(But both method's result show "OPTIMAL SOLUTION FOUND")

Did I miss some configure about IPTCP or other stupid mistake?

By the way , where could I find other sample code using different method with GLPK?

Thank you. :)

Best regrads ,

ChungYi.

--
周宗毅 Chung-Yi Chou
SCOPELab, CS Department NTHU
Hsin-Chu, Taiwan, R.O.C
E mail : address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]