Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Variables and rows eliminated by presolve

    Posted 03/03/08 07:58 PM

    Originally posted by: SystemAdmin


    [fallorz said:]

    I am using CPLEX 9.0 with concert technology. I am programming in C++ but i need to know which variables and cosntraints were eliminated by presolve. The function  CPXgetprestat does that on the callable library (at least i guss so). Is there any equivalent in Concert Technology? Or how do i get which variables and constrains were eliminated from the original proble.

    Thanks.

    Efraín
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Variables and rows eliminated by presolve

    Posted 03/03/08 10:06 PM

    Originally posted by: SystemAdmin


    [oussedik said:]

    Hi,

    Allmost all Callable library routines have their equivalent in Concert but from Concert you can't get info on removal, bounds for variables and constraints as CPXgetprestat does on the callable library. From Concert a method you can use is IloCplex::basicPresolve to detect redundant constraints and obtain tighter bounds on variables.

    Sofiane
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Variables and rows eliminated by presolve

    Posted 03/14/08 06:25 PM

    Originally posted by: SystemAdmin


    [reichel said:]

    Note that IloCplex::basicPresolve() is broken in CPLEX 11.0 (bug report CPLEX-1404) and will be fixed 11.0.1.
    See also this thread [url=http://forums.ilog.com/optimization/index.php?topic=150.0]http://forums.ilog.com/optimization/index.php?topic=150.0[/url].

    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Variables and rows eliminated by presolve

    Posted 03/15/08 05:25 AM

    Originally posted by: SystemAdmin


    [marcello said:]

    I had the same problem today,
    it seems that I succeded using a presolveCallback

    1) I created a presolve callback

    [color=blue]class myCallbackI : public IloCplex::PresolveCallbackI
    {
    public:
    IloNum NRemCols, NRemRows, NAggrs, NModCoeffs;
    IloCplex::CallbackI* duplicateCallback() const{
    return (new (getEnv()) myCallbackI(*this));
    }

    myCallbackI(IloEnv env) : IloCplex::PresolveCallbackI(env), NAggrs(0), NModCoeffs(0), NRemCols(0), NRemRows(0) {}
    void main();
    };

    IloCplex::Callback preCallback(IloEnv env)
    {
      return (IloCplex::Callback(new (env) myCallbackI(env)));
    }[/color]

    2) then I created the main function. Since the presolveCallback is continuously called during the presolve phase, I built the main function to update the number of aggregations, modified coefficients, removed columns and rows every time it is called.

    [color=blue]void myCallbackI::main()
    {
    this->NAggrs = (this->getNaggregations()>this->NAggrs) ? this->getNaggregations(): this->NAggrs;
    this->NModCoeffs = (this->getNmodifiedCoeffs()>this->NModCoeffs) ? this->getNmodifiedCoeffs(): this->NModCoeffs;
    this->NRemCols = (this->getNremovedCols()>this->NRemCols) ? this->getNremovedCols(): this->NRemCols;
    this->NRemRows = (this->getNremovedRows()>this->NRemRows) ? this->getNremovedRows(): this->NRemRows;
    }[/color]


    3) In the code, I add the callback to the cplex instance and created a pointer to the presolveCallback

    [color=blue]IloCplex::Callback cb = cplex.use(preCallback(env));
    myCallbackI* mcb = (myCallbackI*) cb.getImpl();[/color]

    4) After the model has been solved, through the pointer I can access the last value of the presolve variables in the callback:

    [color=blue]cout << "NAggrs=" << mcb->NAggrs << endl;<br />cout << "NModCoeffs=" << mcb->NModCoeffs << endl;<br />cout << "NRemCols=" << mcb->NRemCols << endl;<br />cout << "NRemRows=" << mcb->NRemRows << endl;[/color]<br />
    Maybe it is not so elegant but it works.
    Please feel free to add any comment to improve it, in particular I don't like the explicit casting too much.

    Marcello
    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Variables and rows eliminated by presolve

    Posted 03/16/08 04:20 PM

    Originally posted by: SystemAdmin


    [marcello said:]

    Ooops, I am sorry,
    in this way I am only able to know how many rows and columns has been eliminated. Not which one.
    Sorry for the misunderstanding.
    #CPLEXOptimizers
    #DecisionOptimization