Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

primal feasiblility while in IloCplex::solve

  • 1.  primal feasiblility while in IloCplex::solve

    Posted Tue October 18, 2011 08:41 AM

    Originally posted by: bluecoder


    hi,

    how would I determine whether cplex already found a feasible primal solution to a MIP - while it is still solving (so IloCplex::solve is still running) - from a signal handler? The reason is, that I want to abort the solving from within the signal handler only if a primal solution is already found.
    From my tests I concluded that IloCplex::isPrimalFeasible only returns true after IloCplex::solve terminated.

    Best Regards,
    Jörg
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: primal feasiblility while in IloCplex::solve

    Posted Tue October 18, 2011 10:01 AM

    Originally posted by: SystemAdmin


    To make sure I got you right: You are talking about a signal handler, like something that is set via sigaction() or signal() in Linux?
    In general there is no way to get the information you want directly from the CPLEX object.
    What you can do is the following:
    • Register a MIPInfoCallback with the IloCplex instance that performs the solve.
    • Create a flag variable that is shared between the callback and the signal handler.
    • The callback is invoked periodically by CPLEX. Every time it is invoked you can check whether a feasible solution exists. If so then set the flag to true.
    • In the signal handler check the shared flag.

    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: primal feasiblility while in IloCplex::solve

    Posted Tue October 18, 2011 02:34 PM

    Originally posted by: bluecoder


    > dju358 wrote:
    > You are talking about a signal handler, like something that is set via sigaction() or signal() in Linux?
    yep, exactly.

    And thanks for the reply, what you described worked out well.
    #CPLEXOptimizers
    #DecisionOptimization