help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] Simplex in GLPK and CPLEX in GAMS


From: Andrew Makhorin
Subject: Re: [Help-glpk] Simplex in GLPK and CPLEX in GAMS
Date: Mon, 23 Nov 2015 20:46:53 +0300

On Mon, 2015-11-23 at 17:45 +0100, Yaser Tohidi wrote:
> Hi
> 
> 
> I have the attached GAMS file that I can solve in GAMS.
> But when I try to solve the .lp version (attached) by glpk (the c file
> is attached), I receive "LP has no primal feasible solution".
> Please let me know what I can do for solving this in GLPK.

Glpsol has no problem on solving your instance:

GLPSOL: GLPK LP/MIP Solver, v4.57
Parameter(s) specified in the command line:
 --lp slave12.lp --log log.txt
Reading problem data from 'slave12.lp'...
16537 rows, 12410 columns, 62455 non-zeros
60540 lines were read
GLPK Simplex Optimizer, v4.57
16537 rows, 12410 columns, 62455 non-zeros
Preprocessing...
11682 rows, 7687 columns, 43956 non-zeros
Scaling...
 A: min|aij| =  3.333e-01  max|aij| =  1.000e+07  ratio =  3.000e+07
GM: min|aij| =  1.437e-01  max|aij| =  6.959e+00  ratio =  4.843e+01
EQ: min|aij| =  2.240e-02  max|aij| =  1.000e+00  ratio =  4.465e+01
Constructing initial basis...
Size of triangular part is 11682
      0: obj =  -6.000000000e+01 inf =   2.420e+06 (1854)
    500: obj =  -6.000000000e+01 inf =   6.757e+05 (1388) 3
   1000: obj =  -6.000000000e+01 inf =   2.054e+05 (880) 5
   1500: obj =  -6.000000000e+01 inf =   5.464e+04 (489) 4
   2000: obj =  -6.000000000e+01 inf =   1.952e+04 (319) 5
   2500: obj =  -6.000000000e+01 inf =   1.436e+04 (189) 4
   3000: obj =  -6.000000000e+01 inf =   9.841e+03 (68) 4
   3500: obj =  -6.000000000e+01 inf =   5.309e+02 (29) 3
   3534: obj =  -6.000000000e+01 inf =   1.584e-11 (0)
OPTIMAL LP SOLUTION FOUND
Time used:   6.9 secs
Memory used: 16.2 Mb (16935145 bytes)



>         if (glp_get_status(lps12) > 2){
>                                           printf("slave12 status is %d
>         which means the problem is infeasible.
>         \n",glp_get_status(lps12));
>                                           abort();  
>                                      }

To determine the solution status you should use symbolic constants
GLP_OPT, GLP_INFEAS, etc. defined in the glpk.h header rather than
numeric values. (Your code is wrong because GLP_OPT is defined as 5.)
For more details please see the glpk reference manual (doc/glpk.pdf)
included in the distribution tarball.





reply via email to

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