Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Pass solutions to CPLEX during the search process

    Posted 03/05/14 06:12 AM

    Originally posted by: S8WC_Bruno_Vieira


    I want to hybridize CPLEX with a (meta)heuristic, so that every time the metaheuristic finds a solution that is better than the incumbent of CPLEX, replaces it, and CPLEX can discard some of the unexplored nodes during the tree search. CPLEX would be constantly listening to received information. I have been searching for functions to do so, but so far I couldn't find anything useful.

    I want to use CPLEX and a C program using the Callable Library.

    Would appreciate any help. Thanks :)


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Pass solutions to CPLEX during the search process

    Posted 03/05/14 08:16 AM

    CPXsetheuristiccallbackfunc is your friend. A heuristic callback allows you to inject any solution you find into the CPLEX solution process. See also the admipex2.c and xadmipex2.c examples that are shipped with CPLEX.


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Pass solutions to CPLEX during the search process

    Posted 03/18/14 01:38 PM

    Originally posted by: S8WC_Bruno_Vieira


    Hey !

    Thank you very much for your answer Daniel, in fact that callback allows to supply CPLEX with (potentially) incumbent solutions. However, it does by calling the callback at every viable node of the B&C process. 

    But, I am trying to hybridize CPLEX with a  metaheuristic (MH), so that every time the metaheuristic finds a solution that is better than the incumbent of CPLEX, replaces it. So, I don't want CPLEX to "stop" and execute the functions inside the callback (like check if there is an improved feasible solution from the MH to pass to CPLEX or not) at every node, but instead I want to decide when to stop CPLEX and supply it with an improved solution  found by the MH, so that a relevant computational cost can be saved by avoiding CPLEX to execute useless tasks.

    Any idea on how could I do that ?

    Thanks, Bruno 

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Pass solutions to CPLEX during the search process

    Posted 03/19/14 01:51 AM

    I don't think that overhead of checking for a new solution in a heuristic callback is significant.

    Consider the following framework:

    1. You have a global queue of solutions found by the meta heuristic. This queue is sorted by decreasing objective function value of solutions (assuming a minimization problem).
    2. The meta heuristic posts any solution it finds to that queue.
    3. The heuristic callback just checks whether the queue is non-empty and whether the best (=first) solution in the queue is better than the current incumbent. If so then it extracts the solution from the queue and injects it into CPLEX.

    The overhead of checking the objective value of the first solution in the queue should be negligible. If it is still too much overhead you could implement your heuristic callback so that it only checks for new solutions every N nodes.

    You can also stop CPLEX at any time via CPXXsetterminate(). This allows you to stop at any time and prepare the heuristic callback for injecting a new solution. Alternatively, you can inject the new solution as MIP start and start CPLEX from scratch (set CPX_PARAM_ADVIND to 0). You need to start from scratch here since CPLEX will not look at the MIP start if you don't do that.


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Pass solutions to CPLEX during the search process

    Posted 03/19/14 10:46 AM

    Originally posted by: S8WC_Bruno_Vieira


    Thanks Daniel, I will try to use that framework on my algorithm. According to what I've found so far it seems to me to be the best possibility.

    Hug !


    #CPLEXOptimizers
    #DecisionOptimization