The difference between standard C compiled GLPK and the Javascript version seems to be a factor 10. As one could expect the solution path is slightly different.
C based glpsol.exe | GLPK Simplex Optimizer, v4.47 2726 rows, 6569 columns, 39488 non-zeros Preprocessing... 2463 rows, 5594 columns, 33424 non-zeros Scaling... A: min|aij| = 4.104e-004 max|aij| = 1.389e+004 ratio = 3.384e+007 GM: min|aij| = 9.610e-002 max|aij| = 1.041e+001 ratio = 1.083e+002 EQ: min|aij| = 9.235e-003 max|aij| = 1.000e+000 ratio = 1.083e+002 Constructing initial basis... Size of triangular part = 2463 0: obj = -2.893228867e+010 infeas = 4.389e+005 (0) 500: obj = 4.288287651e+009 infeas = 1.013e+005 (0) 1000: obj = -2.415760147e+009 infeas = 9.499e+002 (0) * 1496: obj = -2.117757487e+009 infeas = 1.461e-013 (0) * 1500: obj = -2.049813931e+009 infeas = 1.461e-013 (0) * 2000: obj = -2.582182378e+007 infeas = 2.005e-012 (0) * 2500: obj = -5.675534925e+006 infeas = 1.362e-013 (0) * 3000: obj = 5.134369324e+004 infeas = 1.049e-013 (0) * 3500: obj = 8.575779704e+004 infeas = 3.918e-014 (0) * 4000: obj = 1.034583169e+005 infeas = 7.290e-014 (0) * 4500: obj = 1.148573480e+005 infeas = 4.027e-014 (0) * 4527: obj = 1.148736555e+005 infeas = 3.876e-014 (0) OPTIMAL SOLUTION FOUND Time used: 1.2 secs |
javascript | GLPK Simplex Optimizer, v4.47 2726 rows, 6569 columns, 39488 non-zeros Preprocessing... 2463 rows, 5594 columns, 33424 non-zeros Scaling... A: min|aij| = 0.000410398983226989 max|aij| = 13886.775 ratio = 33837254.88500861 GM: min|aij| = 0.09609772925154227 max|aij| = 10.406073148538535 ratio = 108.2863583727347 EQ: min|aij| = 0.009234773567302722 max|aij| = 1.0000000000000002 ratio = 108.2863583727347 Constructing initial basis... Size of triangular part = 2463 0: obj = -28932288674.902164 infeas = 438884.18813663867 (0) 500: obj = 2417695413.8613462 infeas = 91877.35020040894 (0) 1000: obj = -3476603174.5055895 infeas = 712.4076522292974 (0) 1500: obj = -3524070971.30494 infeas = 42.2144600534787 (0) *1509: obj = -3523600633.5120773 infeas = 1.8645671302407697e-13 (0) *2000: obj = -35554643.69264513 infeas = 2.521881663037279e-12 (0) *2500: obj = -4067298.103876429 infeas = 1.475546792196709e-13 (0) *3000: obj = 52841.771320373286 infeas = 8.990385481854632e-14 (0) *3500: obj = 84846.60326744069 infeas = 1.5219189175881605e-14 (0) *4000: obj = 99082.72629055602 infeas = 1.5758436355355321e-13 (0) *4475: obj = 114873.65551217867 infeas = 3.595886618335783e-14 (0) OPTIMAL SOLUTION FOUND Elapsed time: 14.672 seconds |
I don't think that's so bad, I would actually have expected a bit higher.
ReplyDeleteThe new version is a bit faster, It now use typed js arrays.
ReplyDeleteNew JS version:
ReplyDeleteGLPK Simplex Optimizer, v4.48
...
Elapsed time: 11.503 seconds