The problem case is the branch of the if with the commented out code.
It sets the row bounds to lb = 0.0 and ub = 0.0. The return from glp_get_status is GLB_UNDEF. I didn't notice this till after I sent the mail.
I would have expected this code to work either way.

On 10/25/2015 9:30 AM, Heinrich Schuchardt wrote:
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

[email protected]

https://lists.gnu.org/mailman/listinfo/help-glpk


_______________________________________________
Help-glpk mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-glpk

Reply via email to