Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

Fixed variables on Branches

  • 1.  Fixed variables on Branches

    Posted Fri June 24, 2016 08:15 AM

    Originally posted by: rseymac


    Dear all,

     

    I am new to cplex and couldnot find a solution to my problem

     

    In my model, I have only binary variables. I want to know which variables have been fixed on branches, is there a way of doing this? I have also checked MipInfoCallBack, but i dont think i can solve it from here.

     

    Thank you in advance,

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Fixed variables on Branches

    Posted Fri June 24, 2016 04:10 PM

    If you want only those variables fixed as part of branching decisions, you can attach a node callback and use the getBranchVar() method (Java name) to get the variable that was fixed when the current node was created. It will be up to you to keep track of the sequence of variables fixed on the route to each node. One possible way is to use a branch callback to attach a list to each node (as "node data"). Another possible way is to use a key-value structure (in Java, I might use a HashMap<Integer, List<IloNumVar>>) to store the list of variables ("value") and the node number ("key", found using the getNodeId() method in Java). I think the latter is easier.

    If you also want the variables fixed by other reductions (inferences) that CPLEX performs, I think you need to check at each node which variables have lower bound = upper bound. For this you need the getLBs() and getUBs() methods (again, Java names), which means you need a control callback of some type (perhaps a heuristic callback). Control callbacks can alter how CPLEX solves the problem, so you may take a performance hit for doing this.


    #CPLEXOptimizers
    #DecisionOptimization