[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-glpk] glp_warm_up
From: |
Andrew Makhorin |
Subject: |
Re: [Bug-glpk] glp_warm_up |
Date: |
Thu, 07 Mar 2013 05:42:17 +0400 |
On Wed, 2013-03-06 at 19:17 -0600, David T. Price wrote:
> I don't understand your argument. Consider the problem:
>
> Maximize 5 * x1
>
> Bounds
> 1 <= x1 <= x2.
>
> The trivial basis will put x1 on the boundary nearer 0, namely x1 = 1.
> This is clearly primal feasible. However, the optimal solution of the
> problem is x1 = 2. So the starting solution can't be dual feasible.
> However, glp_warm_up says that the starting solution is "dual feasible"
> and hence the status reported is "optimal". That is wrong.
>
> Here are MPS and CPLEX forms of the input (I added "subject to -10 <=
> x1" so that the problem would have a row), a fragment of test code, and
> the output.
>
> * Problem:
> * Class: LP
> * Rows: 1
> * Columns: 1
> * Non-zeros: 1
> * Format: Free MPS
> *
> NAME
> ROWS
> N R0000000
> G R0000001
> COLUMNS
> C0000001 R0000000 5 R0000001 1
> RHS
> RHS1 R0000001 -10
> BOUNDS
> LO BND1 C0000001 1
> UP BND1 C0000001 2
> ENDATA
> =====================================
> \* Problem: Unknown *\
>
> Maximize
> obj: + 5 x_1
>
> Subject To
> r_1: + x_1 >= -10
>
> Bounds
> 1 <= x_1 <= 2
>
> End
> =======================================
> glp_warm_up(lpx);
>
> cout << "primal status: " << glp_get_prim_stat(lpx) << endl;
> cout << "dual status: " << glp_get_dual_stat(lpx) << endl;
> cout << "status: " << glp_get_status(lpx) << endl;
> cout << "x1 = " << lpx_get_col_prim(lpx, 1) << endl;
>
> ==========================================
>
> primal status: 2
> dual status: 2
> status: 5
> x1 = 1
>
>
Thank you for your bug report.
In fact, there is a bug in glp_warm_up, sorry. On checking the dual
feasibility it is necessary to check dual values depending on current
statuses of the variables, not on their types.
I will fix this in the next release.
Hope this bug is not crucial; in particular, the glpk simplex routines
ignore the status of starting solution.
Andrew Makhorin