Topic
3 replies Latest Post - ‏2013-01-30T06:27:18Z by SystemAdmin
SystemAdmin
SystemAdmin
623 Posts
ACCEPTED ANSWER

Pinned topic How to detect proven solution in cp

‏2013-01-27T19:23:50Z |
Hi,
I'm trying to combine MIP and CP using opl. I have an algorithm and I want to stop it when CP found a proven optimal rather than terminated by fail limit or stg else.
CP shows if it is proven solution, but how can I represent it with opl?
E.g.
if(cp.param.provenoptimal(true)){

bla...
bla....
}
Does anyone know an opl parameter something like above?
Updated on 2013-01-30T06:27:18Z at 2013-01-30T06:27:18Z by SystemAdmin
  • rdumeur
    rdumeur
    52 Posts
    ACCEPTED ANSWER

    Re: How to detect proven solution in cp

    ‏2013-01-28T16:29:39Z  in response to SystemAdmin
    Dear RQT0_burcu_caglar_gencosman,

    You can use
    
    cp.info.FailStatus
    


    to access the search status obtained after solve. It returns an integer value
    whose semantic is provided in the C++ documentation:

    This web page may help you:

    http://pic.dhe.ibm.com/infocenter/cosinfoc/v12r5/index.jsp

    searching in the C++ refman yelds

    
    ...   This information represents the number of constraints generated from the constraints aggregated by presolve. FailStatus = 11   This information gives the fail status of the invoking IloCP instance. After a call to IloCP::solve or IloCP::next, you can interrogate the fail status, which can be one of the following values:   IloCP::SearchHasNotFailed indicates that the search has not failed. IloCP::SearchHasFailedNormally indicates that the search has failed because it has searched the entire search space. IloCP::SearchStoppedByLimit indicates that the search was stopped by a limit, such as a time limit (see IloCP::TimeLimit) or a fail limit (see IloCP::FailLimit). IloCP::SearchStoppedByLabel indicates that the search was stopped via a fail label which did not exist on any choice point (advanced use). IloCP::SearchStoppedByExit indicates that the search was exited using IloCP::exitSearch. IloCP::SearchStoppedByAbort indicates that the search was stopped by calling IloCP::abortSearch IloCP::UnknownFailureStatus indicates that the search failed 
    
    for some other reason.   ...
    
    • rdumeur
      rdumeur
      52 Posts
      ACCEPTED ANSWER

      Re: How to detect proven solution in cp

      ‏2013-01-28T16:37:51Z  in response to rdumeur
      Dear RQT0_burcu_caglar_gencosman,

      The
      
      cp.info.FailStatus
      
      property is an integer whose value can be found by looking at definition of the C++ IloCP::ParameterValue enum:
      
      .. SearchHasNotFailed        = 12 SearchHasFailedNormally    = 13 SearchStoppedByLimit       = 14 SearchStoppedByLabel       = 15 SearchStoppedByExit        = 16 SearchStoppedByAbort       = 17 SearchStoppedByException = 18 UnknownFailureStatus         = 19 ...
      


      Cheers,
  • SystemAdmin
    SystemAdmin
    623 Posts
    ACCEPTED ANSWER

    Re: How to detect proven solution in cp

    ‏2013-01-30T06:27:18Z  in response to SystemAdmin
    Thank you for your help, I'll try it.