Skip to main content

I Want to solve a MIP Mathematical Program without some of the constraints by  use GMP::Row::Deactivate, but the Program Status return Integer infeasible. However, when I Replace 

GMP::Row::Deactivate with GMP::Row::Delete, the Program can be solved. I could’t understand the difference between GMP::Row::Deactivate and GMP::Row::Delete. 

My code is as follows:

SCUC_Instance := GMP::Instance::generate(MarketDA_MP);
GMP::Solution::DeleteAll(SCUC_Instance);
SCUC_InstancePre := GMP::Instance::CreatePresolved(SCUC_Instance,"SCUC");
GMP::Solution::DeleteAll(SCUC_InstancePre);
NFGConstraintsSetRowNum := GMP::Instance::GetRowNumbers(SCUC_InstancePre, NFGConstraintsSet);
!NFGConstraintsSetRowNum is a Subset of Integer with index as nk
   for nk do
        GMP::Row::Deactivate(SCUC_InstancePre,nk);
    endfor;
endif;
NFGVariablesSetColumnNum := GMP::Instance::GetColumnNumbers(SCUC_InstancePre, NFGVariablesSet);
!NFGVariablesSetColumnNum is a Subset of Integer with index as nv
    for nv do
        GMP::Column::Freeze(SCUC_InstancePre,nv,0);
    endfor;
endif;
UCSolver := GMP::Instance::CreateSolverSession(SCUC_InstancePre , "UCSolver" , 'CPLEX 12.3');
GMP::SolverSession::Execute(UCSolver);

Do you know how can I solve a  Mathematical Program when the constraints do not  take effect but remains in the instance?

Hi ​@denghaiying. GMP::Row::Deactivate basically changes a constraint into a constraint with type <= and a right-hand-side value of 1e20. So the constraint

  x + y >= 20

would become

  x + y <= 1e20

after deactivating it.

Deactivated constraints are not printed in the constraint listing but they will be printed in the LP file by CPLEX if the CPLEX option 'LP file’ is set. You could print the LP file once while you use GMP::Row::Deactivate, and once when you comment out GMP::Row::Deactivate, and then compare the LP files using, e.g., WinDiff or WinMerge.

Normally the right-hand-side value of 1e20 should be high enough but I can create an (extreme) example for which deactivating a constraint will make the model infeasible:

  x + 1e10 * y >= 1000

  y >= 1e11

  x >= 0

Deactivating the first constraint will turn it into

  x + 1e10 * y <= 1e20

And because y >= 1e11 and x >= 0, the left-hand-side must be at least 1e21 and therefore cannot satisfy <= 1e20. Note that this example has severe scaling issues.

Note that one can rewrite the first constraint to

  - x - 1e10 * y <= -1000

and then deactivating it works fine. So, if the constraint that you are deactivating is a >= constraint then you could reformulate it as a <= constraint to see whether that resolves the issue. (And if this works then it is a strong indication that your model has scaling issues.)


Reply


Didn't find what you were looking for? Try searching on our documentation pages:

AIMMS Developer & PRO | AIMMS How-To | AIMMS SC Navigator