ssriram1992 / EPECsolve

Code to compute mixed-equilibrium in linear EPECs
https://ssriram1992.github.io/EPECsolve/html/index.html
GNU General Public License v3.0
6 stars 2 forks source link

PNE bug #38

Open ssriram1992 opened 4 years ago

ssriram1992 commented 4 years ago

src/Games.cpp Game::EPEC::make_pure_LCP

The PNE constraints are wrong in both the cases - if part as well as else part.

In the if part, it should read this->lcpmodel->addGenConstrIndicator( pure_bin[count], 0, ... as opposed to that argument being 1.

In the else part we need GRB_LESS_EQUAL.

Please check. Let me know, if I am misunderstanding.

ssriram1992 commented 4 years ago

And for consistency, please name the constraint analogously in the if and the else clause. Currently, we have a name for the former, and none for the latter.

gdragotto commented 4 years ago

There is indeed a bug, but I believe in the else part.

In the Indicator Constraint section pure_bin[i] is set to 1 whenever the polyhedron is not part of the support (GRB_EQUAL 0). Then, the sum of pure_bin is maximized, and hence we search for equilibria minimizing their supports.

The else part is a bug, which wasn't debugged since by default indicator constraints are on.

I guess probably it would be more intuitive to have something like:

if (indicators) {
      this->EPECObject->LCPModel->addGenConstrIndicator(
          pure_bin[count], 0,
          ...->LCPModel->getVarByName(
              "x_" + std::to_string(this->getPositionProbab(i, j))),
          GRB_EQUAL, 0, "PNE_" + std::to_string(count));}`

     else {
      ...->addConstr(
          ...->getVarByName(
              "x_" + std::to_string(this->getPositionProbab(i, j))),
          GRB_LESS_EQUAL, pure_bin[count],  "PNE_" + std::to_string(count));
    }

And then setObjective(objectiveTerm, GRB_MINIMIZE);

gdragotto commented 4 years ago

However, we should check if the other side of the clause is enforced for the first part. For instance, if _purebin[count] is set to 1 if "x_something" is not 0

ssriram1992 commented 4 years ago

We need not mind that. We are minimizing the sum of pure_bin[count]. So if it can possibly take a value 0, it will take a value 0.