Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  FailStatus

    Posted 03/06/12 09:26 AM

    Originally posted by: UdoKrehler


    Hi,
    I use CP Optimizer 2.3 under C# in Microsoft Visual Studio 2010.

    I wonder whether I do understand the concept of CP.IntInfo.FailStatus correctly: I use CP Optimizer under a given time limit and I simply want to check at the end whether CP Optimizer has found an optimal solution or whether it stopped due to the given time limit. My code looks as follows:
    if (cp.Solve())
    {
    int terminationState = cp.GetInfo(CP.IntInfo.FailStatus);

    if (terminationState == CP.ParameterValues.SearchHasNotFailed.Value)
    {
    // possibility 1
    }
    else if (terminationState == CP.ParameterValues.SearchHasFailedNormally.Value)
    {
    // possibility 2
    }
    else if (terminationState == CP.ParameterValues.SearchStoppedByLimit.Value)
    {
    // possibility 3
    }
    }
    else
    {
    // ...
    }
    Now, I would like to ask about the meaning of these three possible cases: In my opinion, we should end up in "possibility 3" if the search was terminated due to the time limit. That works. But I'm not sure about the first two possibilities.

    a) Shouldn't we always end up in possibility 1 because at that time, the search always did not fail (otherwise we would never reach this code fragment)?

    b) According to my knowledge, "SearchHasFailedNormally" means that the entire search space has been seen but NO feasible solution has been found. In other words: It states that the program is infeasible (there does not exist a single feasible solution). Is this correct? Because in my example, CP Optimizer ends up in this part ("possibility 2") of my code, but it found not only a feasible, but even an optimal solution (which CP Optimizer also claims to be optimal)! This would be a contradiction to my interpretation above.

    Thank you very much for your help, Udo.
    #CPOptimizer
    #DecisionOptimization


  • 2.  Re: FailStatus

    Posted 03/07/12 04:21 AM

    Originally posted by: SystemAdmin


    Hello,
    The meaning of the fail status depends on whether you are solving a satisfiability or an optimization problem.

    SearchHasNotFailed:
    Satisfiability problem: a solution was found
    Optimization problem: a solution was found, it is not proved to be optimal but the limit is still not reached (typically this status is returned when using cp.next())

    SearchHasFailedNormally:
    Satisfiability problem: no solution was found, the problem was proved infeasible
    Optimization problem: the problem was either proved infeasible or an optimal solution was found

    SearchStoppedByLimit:
    Satisfiability problem: no solution was found, the search was stopped by limits so infeasibility could not be proved
    Optimization problem: the search was stopped by limit (a solution may have been found or not, no infeasibility or optimality proof is provided)

    Philippe
    #CPOptimizer
    #DecisionOptimization


  • 3.  Re: FailStatus

    Posted 03/12/12 05:06 AM

    Originally posted by: UdoKrehler


    Hello Philippe,

    thanks a lot for your answer, such a definition was exactly what I wanted to see, thank you!
    I'm a bit surprised about your naming conventions (I personally would expect the search to have failed in case of "SearchHasFailedNormally", but apparently this does not have to be true, well...), but at least, I do understand the meaning now.

    Thanks a lot, Udo!
    #CPOptimizer
    #DecisionOptimization