help-glpk
[Top][All Lists]
Advanced

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

[Help-glpk] Different results from gusek and glpk-java API using same da


From: Sana Jawad
Subject: [Help-glpk] Different results from gusek and glpk-java API using same data
Date: Tue, 26 Jan 2010 21:33:49 -0800


Hello,

I am calling my model written in MathProg from java using glpk-java API. In my model I have a variable named "assign"

var assign{w in Weekdays,s in Shifts,p in People,j in Skills},integer,>= 0, <= 1;   /*Indicates a shift assignment*/

When I solve it through gusek I always get a binary solution. But When I call it from java and display the value using these statements:

for(int i=1; i <= n; i++)
            {
             name = GLPK.glp_get_col_name(lp, i);
           
             val=GLPK.glp_get_col_prim(lp, i);
            System.out.print(name);
            System.out.print(" = ");
            System.out.println(val);
           
            }

I see a few non-binary values like :

assign[Mon,1,Abe,cashier] = 4.440892098500571E-17
assign[Mon,1,Charles,cashier] = -1.0362081563168091E-16

Their value is "0" in gusek output
These variables have an effect on the values of other variables as well. Although the value of object function remains unchanged.

The strange thing is that I have display statement after solve statement in my model. Its output on my console does not have any non-binary value. But the result has non-binary values when I access the values using the code.

Can any one please help me.

Best Regards,
Sana 



reply via email to

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