help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] Uniqueness of a solution


From: Michael Hennebry
Subject: Re: [Help-glpk] Uniqueness of a solution
Date: Tue, 26 Oct 2004 09:35:01 -0500 (CDT)

On Tue, 26 Oct 2004, Marcel Luethi wrote:

> The problem arises when I want to determine whether the obtained
> solution is unique. I implemented it as follows:
>
> lpx_simplex(_pPrimal);
> // check optimality, ...
> ...
> // uniqueness
> bool unique = true;
> for (int j = 2; j <= lpx_get_num_cols(_pPrimal); j++) {
>     if (lpx_get_col_stat(_pPrimal, j) != LPX_BS) {
>       // 0 is the rhs of the corresponding constraint in the dual
>       if (abs(0 - lpx_get_col_dual(_pPrimal, j)) < Constants::eps) {
>       unique = false;
>       }
>     }
> }
> (A similar check is also performed for the first column. )
>
> I thought that this would give me the reduced costs of the nonbasic
> variables, and that the solution is unique if all this values are
> strictly positive.
> However, I have some problem instances, where I know that the
> solution is not unique, but above code still tells me that it is!

You're not checking the row variables.

-- 
Mike   address@hidden
"Pilot, does Moya know where we are?"  --   Zhaan
"Yes, of course.  We're someplace else.
I'll get back to you on the specifics."  --  Pilot





reply via email to

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