Decision Optimization

Decision Optimization

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


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

Got stock in iterations between branch callback and cutcallback

  • 1.  Got stock in iterations between branch callback and cutcallback

    Posted 09/06/10 02:18 PM

    Originally posted by: SystemAdmin


    Dear all,

    I create a branch in branch callback using constraints I pooled before. It is only one single child.
    Then control goes to cutcallback and all those constraints by which I made the new child are added and destoyed from the pool.
    now iterations starts between the cutcallback and branch callback --- nonstop!

    Any comment is highly appreciated.
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Got stock in iterations between branch callback and cutcallback

    Posted 09/06/10 03:37 PM

    Originally posted by: SystemAdmin


    > Shahin G wrote:
    > I create a branch in branch callback using constraints I pooled before. It is only one single child.
    > Then control goes to cutcallback and all those constraints by which I made the new child are added and destoyed from the pool.
    > now iterations starts between the cutcallback and branch callback --- nonstop!

    I'm not sure what you mean by nonstop iterations between the two callbacks. The cut callback is called at every node (repeatedly until it stops adding cuts). The branch callback is called (once) at every node. That's normal. Are you saying that the branch callback keeps cloning the same node over and over (so child A begets identical child B which begets identical child C ...)? Or that the cut callback keeps adding the same cuts?

    What does the branch callback do if the cut pool is empty? What does the cut callback do if the pool is empty?

    /Paul

    Mathematicians are like Frenchmen: whenever you say something to them, they translate it into their own language, and at once it is something entirely different. (Goethe)
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Got stock in iterations between branch callback and cutcallback

    Posted 09/06/10 03:45 PM

    Originally posted by: SystemAdmin


    thanks for reply.

    yeah mathematically that is not true-- not really nonstop but like keeping cloning hundreds of nodes and after like 10 000 nodes it starts stalling without convergence.
    There is not cut any more in the range array. the pool is now empty but still the node is generated and the cut callback is visited.
    The thing is also that nothing is added in the cut callback because the pool is emptied once here.

    branch callback simply returns-- that is all. I check it if the range is empty it immediately returns.
    the code is here:
    ILOBRANCHCALLBACK1(fdhsnd_branch_callback, IloRangeArray, _rng)
    {
            return;
            if(_rng.getSize() == 0) 
                    return;
            IloConstraintArray _temp(getEnv());
            for (int i = 0; i < _rng.getSize(); i++)
            {
                    _temp.add( _rng[i]);
            }
            makeBranch(_temp, getBestObjValue());
            _temp.end();
            return;
    }
    

    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Got stock in iterations between branch callback and cutcallback

    Posted 09/06/10 03:46 PM

    Originally posted by: SystemAdmin


    sorry; this is the correct one:
    ILOBRANCHCALLBACK1(fdhsnd_branch_callback, IloRangeArray, _rng)
    {
            if(_rng.getSize() == 0) 
                    return;
            IloConstraintArray _temp(getEnv());
            for (int i = 0; i < _rng.getSize(); i++)
            {
                    _temp.add( _rng[i]);
            }
            makeBranch(_temp, getBestObjValue());
            _temp.end();
            return;
    }
    

    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Got stock in iterations between branch callback and cutcallback

    Posted 09/07/10 02:25 AM

    Originally posted by: SystemAdmin


    If the constraint pool is empty, do you want to create no child node at all or do you want to create the children CPLEX would create? If you return from a branch callback without having called makeBranch() or prune() CPLEX will create child nodes on its own. If don't want to have any children if the constraint pool is empty then you have to call prune() before you return.
    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: Got stock in iterations between branch callback and cutcallback

    Posted 09/07/10 03:24 AM

    Originally posted by: SystemAdmin


    Daniel,

    Thanks for comment.
    I tested but the results are not not what expected. seems like every thing is pruned. the pool is usually empty and only when heuristic finds a solution after visiting cutcallback it is not empty.

    It terminates with no solution exist warning.
    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: Got stock in iterations between branch callback and cutcallback

    Posted 09/07/10 03:54 AM

    Originally posted by: SystemAdmin


    Maybe I got you wrong. If the pool is empty, do you want to create child nodes or not?
    #CPLEXOptimizers
    #DecisionOptimization


  • 8.  Re: Got stock in iterations between branch callback and cutcallback

    Posted 09/07/10 04:37 AM

    Originally posted by: SystemAdmin


    if the pool is empty I need to let cplex continue on its own way and branchcallback does not do anything for me.
    #CPLEXOptimizers
    #DecisionOptimization


  • 9.  Re: Got stock in iterations between branch callback and cutcallback

    Posted 09/07/10 08:38 AM

    Originally posted by: SystemAdmin


    Then your code was correct. Sorry for the confusion.
    #CPLEXOptimizers
    #DecisionOptimization


  • 10.  Re: Got stock in iterations between branch callback and cutcallback

    Posted 09/07/10 08:44 AM

    Originally posted by: SystemAdmin


    it seems a bit strange; when conrol goes to branch callback even if nothing is done and some command (print, void commands etc) are executed the node is created.
    Another strange thing is that in this case CPLEX ignores the DISPLAY parameters meaning that it does not report any statistics until tens of handreds of nodes are created and due to any reason it has been stopped. Then one sees that surprisingly so many nodes have been created.

    I dont understand what I am doing wrong. To me every thing seems all right.
    #CPLEXOptimizers
    #DecisionOptimization


  • 11.  Re: Got stock in iterations between branch callback and cutcallback

    Posted 09/07/10 09:17 AM

    Originally posted by: SystemAdmin


    > Shahin G wrote:
    > it seems a bit strange; when conrol goes to branch callback even if nothing is done and some command (print, void commands etc) are executed the node is created.
    > Another strange thing is that in this case CPLEX ignores the DISPLAY parameters meaning that it does not report any statistics until tens of handreds of nodes are created and due to any reason it has been stopped. Then one sees that surprisingly so many nodes have been created.

    This could be a bug in the node logger. Which version are you using? To which values did you set MIPINTERVAL and MIPDISPLAY? And what happens if you set MIPDISPLAY = 4 and MIPINTERVAL = 1?

    Tobias
    #CPLEXOptimizers
    #DecisionOptimization


  • 12.  Re: Got stock in iterations between branch callback and cutcallback

    Posted 09/07/10 10:27 AM

    Originally posted by: SystemAdmin


    > Shahin G wrote:
    > it seems a bit strange; when conrol goes to branch callback even if nothing is done and some command (print, void commands etc) are executed the node is created.

    Are you saying that the current node produces a single child that differs from the parent in just the cuts you added (no branching on any of the integer variables)? Are you getting that from the node log?

    /Paul

    Mathematicians are like Frenchmen: whenever you say something to them, they translate it into their own language, and at once it is something entirely different. (Goethe)
    #CPLEXOptimizers
    #DecisionOptimization


  • 13.  Re: Got stock in iterations between branch callback and cutcallback

    Posted 09/07/10 10:31 AM

    Originally posted by: SystemAdmin


    I did not digg into every node info/log but after this 10 000 nodes none of the bounds are changing-- neither primal nor dual.
    #CPLEXOptimizers
    #DecisionOptimization


  • 14.  Re: Got stock in iterations between branch callback and cutcallback

    Posted 09/08/10 08:20 AM

    Originally posted by: SystemAdmin


    Tobias,

    doesnt make any change.
    #CPLEXOptimizers
    #DecisionOptimization


  • 15.  Re: Got stock in iterations between branch callback and cutcallback

    Posted 09/08/10 08:29 AM

    Originally posted by: SystemAdmin


    Could you please upload a log file with MIPDISPLAY=4 and MIPINTERVAL=1, and annotate it at the places where you observed a very long delay and where you hit Ctrl-C?

    Thanks,

    Tobias
    #CPLEXOptimizers
    #DecisionOptimization


  • 16.  Re: Got stock in iterations between branch callback and cutcallback

    Posted 09/08/10 08:38 AM

    Originally posted by: SystemAdmin


    which kind of log file you mean? shall i pipe the output to a file or?
    #CPLEXOptimizers
    #DecisionOptimization


  • 17.  Re: Got stock in iterations between branch callback and cutcallback

    Posted 09/09/10 03:43 AM

    Originally posted by: SystemAdmin


    Yes. I want to see what you see on the screen, together with some annotation of the timing and user interaction. If you like, you can also just enable logging to "cplex.log" and post the resulting log file.

    Tobias
    #CPLEXOptimizers
    #DecisionOptimization


  • 18.  Re: Got stock in iterations between branch callback and cutcallback

    Posted 09/09/10 03:51 AM

    Originally posted by: SystemAdmin


    sure, but since yesterday I got instability in the algorithm and cannot produce previous results. give me sometime to restore the things.
    I get back to you, soon.
    #CPLEXOptimizers
    #DecisionOptimization


  • 19.  Re: Got stock in iterations between branch callback and cutcallback

    Posted 09/06/10 04:56 PM

    Originally posted by: SystemAdmin


    > Shahin G wrote:
    >
    > yeah mathematically that is not true-- not really nonstop but like keeping cloning hundreds of nodes and after like 10 000 nodes it starts stalling without convergence.
    > There is not cut any more in the range array. the pool is now empty but still the node is generated and the cut callback is visited.
    > The thing is also that nothing is added in the cut callback because the pool is emptied once here.
    >
    > branch callback simply returns-- that is all. I check it if the range is empty it immediately returns.

    The code in the next reply (without that first return) looks correct to me. You're saying that if the branch callback is called with _rng empty, it still sometimes creates a single child node (as opposed to the normal two children that CPLEX will create if the callback returns without doing anything)? Have you tried printing out _rng.getSize() to make sure that the pool does indeed look empty at such nodes?

    I still do not understand the significance of "... and the cut callback is visited." The cut callback is visited at every node. What is there about certain visits that bothers you (other than the possibility that the node at which it is visited ought not exist in the first place)?

    /Paul

    Mathematicians are like Frenchmen: whenever you say something to them, they translate it into their own language, and at once it is something entirely different. (Goethe)
    #CPLEXOptimizers
    #DecisionOptimization


  • 20.  Re: Got stock in iterations between branch callback and cutcallback

    Posted 09/06/10 05:13 PM

    Originally posted by: SystemAdmin


    Thanks for comment.

    it is clear that the cutcallback must be called after visit to every node.
    The question is why so many nodes are created.

    Yes, I go though the code line by line in debug mode and pernt out every thing as well. Every thing is as expected--- empty _rng.
    #CPLEXOptimizers
    #DecisionOptimization


  • 21.  Re: Got stock in iterations between branch callback and cutcallback

    Posted 09/06/10 05:48 PM

    Originally posted by: SystemAdmin


    What is the impact of your added cuts on the cloned node? If the same LP solution repeats after adding cuts to the node, clearly you're in for a long day. Since you're not looping indefinitely, I suspect that is not happening. However, it's still possible that you could be adding cuts that lop off the most recent node LP solution without making the node infeasible or significantly altering the objective value (especially if the node LP has multiple optimal solutions), in which case the cloned node may generate more cuts, and you could be spawning clones for a while.

    I'm not sure what the intent of your cuts is (bound strengthening, feasibility cuts, ...) so I can't really speculate further. Have you tested whether the cuts added in the branch callback are having the desired effect (node objective increases, or rejected incumbent found by heuristic does not repeat)?

    /Paul

    Mathematicians are like Frenchmen: whenever you say something to them, they translate it into their own language, and at once it is something entirely different. (Goethe)
    #CPLEXOptimizers
    #DecisionOptimization


  • 22.  Re: Got stock in iterations between branch callback and cutcallback

    Posted 09/06/10 06:02 PM

    Originally posted by: SystemAdmin


    Do you remember you suggested that if an incumbent was found by a heuristic I can put it in a queue and reject incumbent. next time I add the cuts in branch callback without releasing the cuts but in the first cutcallback call I add and release them?! this is exactly that case. The incumbent is repeated over and over again.

    If I simply disable the branchcallback it works and converges but I ma not sure if that results in optimal.
    #CPLEXOptimizers
    #DecisionOptimization


  • 23.  Re: Got stock in iterations between branch callback and cutcallback

    Posted 09/06/10 08:44 PM

    Originally posted by: SystemAdmin


    > Shahin G wrote:
    > Do you remember you suggested that if an incumbent was found by a heuristic I can put it in a queue and reject incumbent. next time I add the cuts in branch callback without releasing the cuts but in the first cutcallback call I add and release them?!

    Yes.

    > this is exactly that case. The incumbent is repeated over and over again.

    The cuts you add are violated by the proposed incumbent, right? (You've checked this?) That's a necessary condition for the method to work. If so, then I don't see how the same incumbent can repeat at the child node -- the added cuts would block it -- unless for some reason the extra cuts are not being implemented in the child node. Either the heuristic solution does not violate the cuts used to create the child, or something is going wrong with the creation of the child.

    /Paul

    Mathematicians are like Frenchmen: whenever you say something to them, they translate it into their own language, and at once it is something entirely different. (Goethe)
    #CPLEXOptimizers
    #DecisionOptimization