help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] Double bounded vs. fixed


From: Heinrich Schuchardt
Subject: Re: [Help-glpk] Double bounded vs. fixed
Date: Sun, 25 Oct 2015 17:30:56 +0100

A double bounded row with upper bound -1 and lower bound 0 created a 
infeasability.

A fixed row with value 0 is not by itself infeasable.

So where do you see an issue?

Best regards

Heinrich Schuchardt

http://www.xypron.de

Am 25.10.15 um 14:34 schrieb Neill Clift

> Hi,
> 
> 
> 
> I have the following fragment of code in my program:
> 
> 
> 
>          ia[iai] = irow;
> 
>          ja[iai] = EdgeStartIndex(d) + (i - 1) * 2 + 1;
> 
>          ar[iai] = 1.0;
> 
>          iai++;
> 
>          ia[iai] = irow;
> 
>          ja[iai] = VertexStartIndex() + Val[i].k;
> 
>          ar[iai] = -1.0;
> 
>          if (Val[i].j == Val[i].k /* && Val[i].k == i - 1 */) {
> 
>              int Lower = 1 - Val[Val[i].k].maxv;
> 
> #if defined(PRINT)
> 
>              std::cout << irow << ")" << Lower << " <= e[" << ja[iai-1] 
> 
> << "] - v[" << ja[iai] << "] <= -1" << std::endl;;
> 
> #endif
> 
>              glp_set_row_bnds(lp, irow, GLP_DB, Lower, -1.0);
> 
>          } else {
> 
>              int Lower = 0 - Val[Val[i].k].maxv;
> 
> #if defined(PRINT)
> 
>              std::cout << irow << ")" << Lower << " <= e[" << ja[iai-1] 
> 
> << "] - v[" << ja[iai] << "] <= 0" << std::endl;;
> 
> #endif
> 
> //            if (Lower == 0) {
> 
> //                glp_set_row_bnds(lp, irow, GLP_FX, Lower, 0.0);
> 
> //            } else {
> 
>                     glp_set_row_bnds(lp, irow, GLP_DB, Lower, 0.0);
> 
> //            }
> 
>          }
> 
>          iai++;
> 
>          irow++;
> 
> 
> 
> Note the code that's commented out at the bottom. The code as it is as 
> 
> shown says the overall linear system is infeasible (in the reals).
> 
> The row causing the infeasibility generated by the code above when Lower 
> 
> == 0.
> 
> So the code is generating a double bounded row with ub = lb = 0. 
> 
> Uncommenting those 4 lines generates a system that glpk finds feasible.
> 
> Is this expected behavior?
> 
> Thanks.
> 
> Neill.
> 
> 
> 
> _______________________________________________
> 
> Help-glpk mailing list
> 
> address@hidden
> 
> https://lists.gnu.org/mailman/listinfo/help-glpk



reply via email to

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