help-glpk
[Top][All Lists]
Advanced

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

[Help-glpk] Double bounded vs. fixed


From: Neill Clift
Subject: [Help-glpk] Double bounded vs. fixed
Date: Sun, 25 Oct 2015 06:34:02 -0700
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

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.



reply via email to

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