[FlopCpp] Flopc++ and Cgl

Tim Hultberg Tim.Hultberg at eumetsat.int
Mon Jul 28 11:23:41 EDT 2008


Looks like a Cgl problem to me?

Does this work ?

OsiSolverInterface* m1solver = new OsiCbcSolverInterface;

<populate without flopc++>

  probGen.generateCuts(*m1solver, cuts);

   m1solver->applyCuts(cuts);
   cout <<cuts.sizeCuts() <<" cuts were generated" <<endl;


You might need to cast to OsiCbcSolverInterface ?

Tim




>>> "Marco Caserta" <marcocaserta at gmail.com> 19/07/2008 22:57 >>>
I am trying to add one cut from the Cgl collection, e.g., CglProbing. The
model is correctly defined but it seems that no cuts are ever added to it.
Could anyone please help. Thanks,

Marco Caserta

This is the code I have:

  MP_model m1(new OsiCbcSolverInterface);

             <here the model is properly defined>

  // add cut
   OsiCuts cuts;
   CglProbing probGen;
   probGen.setMaxProbe(10);

   probGen.generateCuts(*m1.Solver, cuts);

   m1.Solver->applyCuts(cuts);
   cout <<cuts.sizeCuts() <<" cuts were generated" <<endl;

            <here I get that 0 cuts have been added>

   m1.minimize();




> OsiCuts cuts;
>    CglProbing probGen;
>    probGen.setUsingObjective(true);
>    probGen.setMaxPass(1);
>    probGen.setMaxPassRoot(5);
>    // Number of unsatisfied variables to look at
>    probGen.setMaxProbe(10);
>    probGen.setMaxProbeRoot(1000);
>    // How far to follow the consequences
>    probGen.setMaxLook(50);
>    probGen.setMaxLookRoot(500);
>    // Only look at rows with fewer than this number of elements
>    probGen.setMaxElements(200);
>    probGen.setRowCuts(30);
>
>    probGen.generateCuts(*m1.Solver, cuts);
>
>    m1.Solver->applyCuts(cuts);
>    cout <<cuts.sizeCuts() <<" cuts were generated" <<endl;
>
>    m1.attach();
>    //m1.minimize(sum(F, fixed(F)*y(F)) + sum(F, sum(C, cost(F,C)*x(F,C))));
>    m1.minimize();
>
I am trying to add one cut from the Cgl collection, e.g., CglProbing. This
is the code I have:




More information about the FlopCpp mailing list