> I hope this is the right place for this question... > > I am trying to solve the problem in the attached lp file and I get > confusing results. When calling glpsol with "glpsol --cpxlp --interior > --min --cbg -w temp_solved.txt test_prob_100_lp.txt" I get the results > that I am expecting.
The --cbg option affects only the simplex solver. > When I try to use the API I get numeric > instability. I did automatic scaling of the data with > "glp_scale_prob(lp,GLP_SF_AUTO)". Your lp is well scaled, so the automatic scaling is not needed. > What's confusing is the fact that the test_prob_100_lp.txt is produced > by calling glp_write_lp, so the problem is formulated the same way in > both cases. > > The console output of glpsol is > > D:\Phase unwrapping\C_code\putmcf\Debug>glpsol --cpxlp --interior > --min -w temp_solved.txt test_prob_100_lp.txt > glp_read_lp: reading problem data from `test_prob_100_lp.txt'... > glp_read_lp: 7958 rows, 24014 columns, 47748 non-zeros > glp_read_lp: 11009 lines were read > Scaling... > A: min|aij| = 1.000e+000 max|aij| = 1.000e+000 ratio = 1.000e+000 > Problem data seem to be well scaled > glp_interior: original LP problem has 7958 rows and 24014 columns > glp_interior: transformed LP problem has 7958 rows and 24014 columns > lpx_interior: A has 47748 non-zeros > lpx_interior: S has 19825 non-zeros (upper triangle) > lpx_interior: minimal degree ordering... > lpx_interior: computing Cholesky factorization... > lpx_interior: U has 93259 non-zeros > lpx_interior: guessing initial point... > Optimization begins... > 0: obj = 1.887813906e+004; rpi = 1.5e-015; rdi = 2.7e+000; gap = 1.0e+000 > 1: obj = 1.115924070e+004; rpi = 8.0e-016; rdi = 2.7e-001; gap = 1.0e+000 > 2: obj = 2.881199640e+003; rpi = 1.1e-015; rdi = 4.2e-002; gap = 9.8e-001 > 3: obj = 1.001952442e+003; rpi = 1.1e-015; rdi = 2.0e-002; gap = 9.4e-001 > 4: obj = 5.424831020e+002; rpi = 1.8e-015; rdi = 1.1e-002; gap = 8.7e-001 > 5: obj = 2.898292874e+002; rpi = 3.4e-015; rdi = 7.7e-003; gap = 7.4e-001 > 6: obj = 1.503381835e+002; rpi = 1.4e-015; rdi = 4.6e-003; gap = 4.9e-001 > 7: obj = 8.660671850e+001; rpi = 2.1e-015; rdi = 5.6e-004; gap = 9.0e-002 > 8: obj = 7.976196926e+001; rpi = 1.3e-015; rdi = 5.6e-005; gap = 9.8e-003 > 9: obj = 7.907619834e+001; rpi = 1.6e-015; rdi = 5.6e-006; gap = 9.8e-004 > 10: obj = 7.900761984e+001; rpi = 2.1e-015; rdi = 5.6e-007; gap = 9.8e-005 > 11: obj = 7.900076198e+001; rpi = 1.9e-015; rdi = 5.6e-008; gap = 9.8e-006 > 12: obj = 7.900007620e+001; rpi = 2.5e-015; rdi = 5.6e-009; gap = 9.8e-007 > 13: obj = 7.900007572e+001; rpi = 1.5e-009; rdi = 5.6e-009; gap = 9.8e-007 > 14: obj = 7.900000757e+001; rpi = 1.5e-010; rdi = 5.6e-010; gap = 9.8e-008 > 15: obj = 7.900000076e+001; rpi = 1.5e-011; rdi = 5.6e-011; gap = 9.8e-009 > OPTIMAL SOLUTION FOUND > Time used: 0.4 secs > Memory used: 10.2 Mb (10737856 bytes) > glp_write_ipt: writing interior-point solution to `temp_solved.txt'... > > The console output when using the API is: > > Running optimization...glp_write_lp: writing problem data to > `test_prob_100_lp.t > xt'... > Scaling... > A: min|aij| = 1.000e+000 max|aij| = 1.000e+000 ratio = 1.000e+000 > Problem data seem to be well scaled > glp_interior: original LP problem has 7958 rows and 24014 columns > glp_interior: transformed LP problem has 7958 rows and 24014 columns > lpx_interior: A has 47748 non-zeros > lpx_interior: S has 19825 non-zeros (upper triangle) > lpx_interior: minimal degree ordering... > lpx_interior: computing Cholesky factorization... > lpx_interior: U has 93259 non-zeros > lpx_interior: guessing initial point... > Optimization begins... > 0: obj = 1.887812891e+004; rpi = 9.7e-007; rdi = 2.7e+000; gap = 1.0e+000 > 1: obj = 1.115921387e+004; rpi = 8.8e-007; rdi = 2.7e-001; gap = 1.0e+000 > 2: obj = 2.881189941e+003; rpi = 8.4e-007; rdi = 4.2e-002; gap = 9.8e-001 > 3: obj = 1.001948669e+003; rpi = 7.7e-007; rdi = 2.0e-002; gap = 9.4e-001 > 4: obj = 5.424824829e+002; rpi = 1.4e-006; rdi = 1.1e-002; gap = 8.7e-001 > 5: obj = 2.898280334e+002; rpi = 2.7e-006; rdi = 7.7e-003; gap = 7.4e-001 > 6: obj = 1.503356628e+002; rpi = 1.2e-006; rdi = 4.6e-003; gap = 4.9e-001 > 7: obj = 8.660641479e+001; rpi = 2.1e-006; rdi = 5.6e-004; gap = 9.0e-002 > 8: obj = 7.976927185e+001; rpi = 2.0e-006; rdi = 5.6e-005; gap = 9.8e-003 > 9: obj = 7.908045197e+001; rpi = 9.7e-007; rdi = 5.6e-006; gap = 1.0e-003 > 10: obj = 7.899995422e+001; rpi = 5.5e-007; rdi = 5.7e-007; gap = 2.8e-006 > 11: obj = 7.899996948e+001; rpi = 6.6e-007; rdi = 1.2e-007; gap = 9.5e-008 > 12: obj = 7.900000763e+001; rpi = 5.1e-007; rdi = 1.0e-007; gap = 9.5e-008 > 13: obj = 7.900004578e+001; rpi = 5.5e-007; rdi = 1.0e-007; gap = 5.7e-007 > 14: obj = 7.900009155e+001; rpi = 3.3e-006; rdi = 9.9e-008; gap = 1.1e-006 > NUMERIC INSTABILITY; SEARCH TERMINATED > The best point 7.900000763e+001 was reached on iteration 12 > > I used the 4.35 version on a win32 machine. > > I also tried the 4.46 version but I get numeric instability in both cases. Sorry, the glpk interior-point solver is not robust, and sometimes it prematurely terminates the search due to numerical instability on solving a Newtonian system. You might use the simplex solver, which is much more robust. To obtain identical results check options passed to the C compiler that affect the floating-point precision used. For example, on Intel Pentium glpsol might be compiled to use full 64-bit precision (gcc does this by default) while your program may use only 53-bit precision. BTW, I could successfully solved your lp with glpsol 4.46 on my Intel Pentium PC: GLPSOL: GLPK LP/MIP Solver, v4.46 Parameter(s) specified in the command line: --lp test_prob_100_lp.txt --interior Reading problem data from `test_prob_100_lp.txt'... 7958 rows, 24014 columns, 47748 non-zeros 11009 lines were read Scaling... A: min|aij| = 1.000e+00 max|aij| = 1.000e+00 ratio = 1.000e+00 Problem data seem to be well scaled Original LP has 7958 row(s), 24014 column(s), and 47748 non-zero(s) Working LP has 7958 row(s), 24014 column(s), and 47748 non-zero(s) Matrix A has 47748 non-zeros Matrix S = A*A' has 19825 non-zeros (upper triangle) Approximate minimum degree ordering (AMD)... Computing Cholesky factorization S = L*L'... Matrix L has 87343 non-zeros Guessing initial point... Optimization begins... 0: obj = 1.887813906e+04; rpi = 1.2e-15; rdi = 2.7e+00; gap = 1.0e-00 1: obj = 1.115924070e+04; rpi = 8.0e-16; rdi = 2.7e-01; gap = 1.0e-00 2: obj = 2.881199640e+03; rpi = 1.1e-15; rdi = 4.2e-02; gap = 9.8e-01 3: obj = 1.001952442e+03; rpi = 1.5e-15; rdi = 2.0e-02; gap = 9.4e-01 4: obj = 5.424831020e+02; rpi = 2.5e-15; rdi = 1.1e-02; gap = 8.7e-01 5: obj = 2.898292874e+02; rpi = 9.4e-15; rdi = 7.7e-03; gap = 7.4e-01 6: obj = 1.503381835e+02; rpi = 3.5e-15; rdi = 4.6e-03; gap = 4.9e-01 7: obj = 8.660671850e+01; rpi = 2.0e-15; rdi = 5.6e-04; gap = 9.0e-02 8: obj = 7.976196926e+01; rpi = 2.5e-15; rdi = 5.6e-05; gap = 9.8e-03 9: obj = 7.907619834e+01; rpi = 5.7e-15; rdi = 5.6e-06; gap = 9.8e-04 10: obj = 7.900761984e+01; rpi = 5.7e-15; rdi = 5.6e-07; gap = 9.8e-05 11: obj = 7.900076198e+01; rpi = 3.3e-15; rdi = 5.6e-08; gap = 9.8e-06 12: obj = 7.900007620e+01; rpi = 3.0e-15; rdi = 5.6e-09; gap = 9.8e-07 13: obj = 7.900000762e+01; rpi = 2.2e-15; rdi = 5.6e-10; gap = 9.8e-08 14: obj = 7.900000076e+01; rpi = 5.6e-15; rdi = 5.6e-11; gap = 9.8e-09 OPTIMAL SOLUTION FOUND Time used: 1.0 secs Memory used: 14.9 Mb (15593576 bytes) _______________________________________________ Help-glpk mailing list [email protected] https://lists.gnu.org/mailman/listinfo/help-glpk
