Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
Expand all | Collapse all

which variable selected in C++ concert

  • 1.  which variable selected in C++ concert

    Posted 04/08/19 12:25 AM

    Originally posted by: srvh


    I wrote a code in C++ concert. Now I want to get some information about variable selection. For example, I want to know that at each node which variable is selected among 10 variables. how can i write this and add it to my code?


    #DecisionOptimization
    #MathematicalProgramming-General


  • 2.  Re: which variable selected in C++ concert

    Posted 04/08/19 01:23 AM

    This information is only available if dynamic search is switched off (see parameter MIPSearch). If you disable dynamic search and set the node display interval (MIPInterval) to 1 then you should see this information at the right of the node log.

    You can also display CPLEX's branching decision by adding a branch callback that queries and displays them.


    #DecisionOptimization
    #MathematicalProgramming-General


  • 3.  Re: which variable selected in C++ concert

    Posted 04/09/19 02:10 PM

    Originally posted by: srvh


    Thank you dear Daniel.

    Can i see this information in IBM ILOG(CPLEX) if i set  MIP dynamic search switch to "apply traditional branch and cut;disable dynamic search" and MIP node log interval to "1" in ops?

    I set the ops as i want but it didn't give me any information about variable selection. 

    in C++ concert:

    I saw the iloadmipex3 and iloadmipex1 in IBM ILOG resource. They make new branching rule(for example:largest objective coefficient) but i want to know which variable select in  CPLEX  when i set strong branching rule for branching.  


    #DecisionOptimization
    #MathematicalProgramming-General


  • 4.  Re: which variable selected in C++ concert

    Posted 04/10/19 04:17 PM

    With the suggested settings in .ops I get for example this log:

    Root relaxation solution time = 0.00 sec. (0.00 ticks)

            Nodes                                         Cuts/
       Node  Left     Objective  IInf  Best Integer    Best Bound    ItCnt     Gap         Variable B NodeID Parent  Depth

          0     0        0.0000     2                      0.0000        0         
          0     0        0.0000     2                     Cuts: 5        3         
          0     0        0.0000     4                  MIRcuts: 3        6         
          0     2        0.0000     3                      0.0000        6                                 0             0
    Elapsed time = 0.11 sec. (0.63 ticks, tree = 0.02 MB, solutions = 0)
          1     2        0.0000     2                      0.0000        9                       x4 N      8      0      1
          2     3        0.0000     2                      0.0000       11                       x2 N     16      8      2
          3     2    infeasible                            0.0000       11                       x2 D     24     16      3
          4     2        0.0000     2                      0.0000        8                       x4 U      7      0      1
          5     3        0.0000     2                      0.0000        8                       x1 U     15      7      2

    If you look to the columns at the right then you can see the variable that CPLEX branch on, which direction it branched etc.

     


    #DecisionOptimization
    #MathematicalProgramming-General


  • 5.  Re: which variable selected in C++ concert

    Posted 04/10/19 05:07 PM

    Originally posted by: srvh


    Thank you very much dear Daniel.

    I wrote a code in CPLEX. I switched off all cuts and preprocessing setting but when i checked the log i saw that CPLEX find the best solution at the root node.

    The type of variables (25 variables )are binary and i know the lp solution is not integer answer. so How can i set up ops to find the best solution at the down levels?


    #DecisionOptimization
    #MathematicalProgramming-General


  • 6.  Re: which variable selected in C++ concert

    Posted 04/12/19 02:42 AM

    You can try switching of heuristics as well and also set the thread count to 1.

    However, it would probably be much better to use a model that is not so easy that it solves at the root. If you want to see/trace branching decisions then you should use a model for which branching is actually reasonable. Otherwise I am not sure how these branching decisions will tell you.


    #DecisionOptimization
    #MathematicalProgramming-General


  • 7.  Re: which variable selected in C++ concert

    Posted 04/12/19 08:41 AM

    Originally posted by: srvh


    Thank you very much for your efficient help.

    I was wondering how to obtain the highlighted information using callbacks more specifically is there any callback available to retrieve such information ?

    if so, which method of that callback?

     

     


     


    #DecisionOptimization
    #MathematicalProgramming-General


  • 8.  Re: which variable selected in C++ concert

    Posted 04/15/19 03:56 AM

    The closest you can get is using the getDownPseudoCost() and getUpPseudoCost() of the BranchCallback.

    May I ask what you are trying to do? It seems you need a lot of detail about the internal CPLEX branching process. I am not sure you can get everything you are looking for.


    #DecisionOptimization
    #MathematicalProgramming-General


  • 9.  Re: which variable selected in C++ concert

    Posted 04/15/19 09:13 AM

    Originally posted by: srvh


    Thank you very very much for your answer dear Daniel.

    At each node, I want to know which variable is selected for branching and what the score of strong branching for that variable is. Can I get these information?

    For example, at the picture the highlighted leaf (node1-node8-node32-node33), I expect CPLEX show me x25-x41-x44-x43 are selected for branching then compute and print the score of strong branching for those variables.

    On that leaf, there isn't best

    The best solution isn't on that leaf. The log CPLEX shows the leaf that the best solution is on it. But can I have these information (variable selected and the score of strong branching) for the other leaves?


    #DecisionOptimization
    #MathematicalProgramming-General


  • 10.  Re: which variable selected in C++ concert

    Posted 04/21/19 03:05 PM

    No, that information is not available.

    You can use getUpPseudoCost() and getDownPseudoCost() from the branch callback and if you use full strong branching then these values should be close. But there is no guarantee that CPLEX will not factor other things into the psuedo costs.


    #DecisionOptimization
    #MathematicalProgramming-General


  • 11.  Re: which variable selected in C++ concert

    Posted 04/23/19 02:23 PM

    Originally posted by: srvh


    Thank you very much dear Daniel.I appreciate your reply.

    I want to use learning in branch and bound.Now i need all the fields in your picture or all information in CPLEX log file like parent Node,Variable B,Node ID and etc. How can i get this information in CPLEX?

    Now i copy this information in notepad then import them into Excel. But when the log file(Node information) get more it is very difficult.


    #DecisionOptimization
    #MathematicalProgramming-General


  • 12.  Re: which variable selected in C++ concert

    Posted 04/29/19 12:47 AM

    If you want to trace all this information then you have to track the tree using a branch callback. This has been discussed several times on this forums and you should be able to find code snippets for this on the forum.

    However, if the tree gets bigger then also the information you will have will grow. And it will grow exponentially. So I am not sure how far you can take that. I am also not sure how much you will learn about branching by doing this. I feel like it would be better to check the literature about the various branching methods and understand those. Trying to understand what CPLEX does is difficult since CPLEX uses a mix of different branching strategies and lots of this are trade secrets.


    #DecisionOptimization
    #MathematicalProgramming-General