I have LP task. The problem has appeared suddenly. I use automated code for create the objective function, equations and constrains, from two vectors of nodes and lines, also I use the method for create code of my tas in LPSolve format and write it in file.
For example:
/* Objective function */
max: +y4 +y5 +y6;
/* Constraints */
n1: +x4 -y4 -z4_5_4 -z4_6_5 +z5_4_8 +z6_4_9 = 0;
n2: +x5 -y5 +z4_5_4 -z5_6_6 +z6_5_7 -z5_4_8 +z6_5_10 -z5_6_11 = 0;
n3: +x6 -y6 +z4_6_5 +z5_6_6 -z6_5_7 -z6_4_9 -z6_5_10 +z5_6_11 = 0;
/* Variable bounds */
x4 <= 16210;
x5 <= 16600;
x6 <= 17950;
y4 <= 15000;
y5 <= 15000;
y6 <= 15000;
z4_5_4 <= 2000;
z4_6_5 <= 2000;
z5_6_6 <= 1000;
z6_5_7 <= 1000;
z5_4_8 <= 2000;
z6_4_9 <= 2000;
z6_5_10 <= 1000;
z5_6_11 <= 1000;
After creating and writing equations in file I execute the solver:
int result = solve(lp);
Usualy for tasks with random values, I've got results like this:
Var-s Result
45000
x4 15000
x5 15000
x6 15000
y4 15000
y5 15000
y6 15000
z4_5_4 0
z4_6_5 0
z5_4_8 0
z5_6_11 0
z5_6_6 0
z6_4_9 0
z6_5_10 0
z6_5_7 0
But in the LPSolve IDE I've got results like this (and I think it's rigth results):
Var-s Result
45000
x4 16210
x5 16600
x6 12190
y4 15000
y5 15000
y6 15000
z4_5_4 400
z4_6_5 810
z5_4_8 0
z5_6_11 1000
z5_6_6 1000
z6_4_9 0
z6_5_10 0
z6_5_7 0
On some forum I read that's better to use "1E-5" instead "0" and "1000" instead "1.0" as coefficients in my objective function. I tried to do this and i've got the same results in solver IDE and in my programm but the results was not changed for randome values in the task.
So, I need to get results like in LPSolve IDE (wroten in the end) but use my programm. If it's possible, please help me.
Used versions LPSolve v-5.5.2.3, v-5.5.2.0