Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Modified Branch and Bound

    Posted 07/28/12 06:22 PM

    Originally posted by: FANS_Nader_Al_Theeb


    Hello everybody - Using CPLEX-Concert

    I have a complicated Vehicle Routing problem need very long time to be solved exactly.

    I'm trying now to solve it using my own Branch and Bound (BAB) with some modifications such as

    1- Branching using my sequence because I know that there are variables have more chance to be in the optimal solution.
    For example if I have a variable with data set of t=15

    X_{opk}^{t}
    


    At specified o, p, k. Can I tell CPLEX to branch the variables with t=5-9 only and skip the others

    2- Can I provide CPLEX with some variables' value. For example can I solve the problem iteratively starting with linear relaxation and add the integer condition to some variable at each iteration.

    It will be appreciated if any one provide me code examples and links to other related threads

    Thanks
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Modified Branch and Bound

    Posted 07/29/12 07:47 PM

    Originally posted by: LeandroCC


    Hello

    1. You can try using branching priorities. You set a high priority for the variables with t=5-9 and low to the others. CPLEX will then branch first on the ones you believe have a higher chance of being in the optimal solution.

    2. you can either use MIPStarts or add new cuts...
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Modified Branch and Bound

    Posted 07/30/12 01:25 AM

    Originally posted by: FANS_Nader_Al_Theeb


    Thank you for replay

    In point 1, I don't understand what you mean exactly, because I can't give some variable more weight. Some of these variables are not in the objective function. Could you please give more delectation

    In point 2, I found some help about MIPstart. Do you have code example

    Any othes help is appreciated
    Thanks
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Modified Branch and Bound

    Posted 07/31/12 04:31 AM

    Originally posted by: SystemAdmin


    The priorities mentioned are just branching priorities. They are only used for branching, not for evaluating the objective function or anything else, see the user manual.

    Code examples for MIP starts can be found in the examples distributed with CPLEX.

    You may also want to consider class IloConversion. This allows you to temporarily change the type of a variable from "integer" to "continuous". So you may first relax all your integer variables and then re-introduce the integrality constraints step by step (what you described in step 2 of your initial post).
    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Modified Branch and Bound

    Posted 08/01/12 12:25 AM

    Originally posted by: FANS_Nader_Al_Theeb


    Thank you Daniel for help, I will try some of these. But I might ask you other question later.
    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: Modified Branch and Bound

    Posted 08/02/12 02:50 AM

    Originally posted by: FANS_Nader_Al_Theeb


    Hello, Daniel

    I'm trying to convert some variables to BOOL type and fix others to be zero like the following
    
    
    
    for( o=0; o<nbNodes; o++)
    { 
    
    for( p=0; p<nbDNodes; p++)
    { 
    
    if (o==nDNodes[p]) 
    {
    
    continue;
    } 
    
    for ( v=0; v<nbVeh; v++)
    { 
    
    for( t=0; t<bound; t++)
    {   model.add(IloConversion(env, X_opkt[o] [nDNodes[p]] [v] [X_perm[t]] , ILOBOOL));
    }
    }
    }
    }       
    
    for( o=0; o<nbNodes; o++)
    { 
    
    for( p=0; p<nbDNodes; p++)
    { 
    
    if (o==nDNodes[p]) 
    {
    
    continue;
    } 
    
    for ( v=0; v<nbVeh; v++)
    { 
    
    for( t=bound; t<nbTimes; t++)
    {     model.add(X_opkt[o] [nDNodes[p]] [v] [X_perm[t]]==0);
    }
    }
    }
    }
    


    But I received the following error

    /home/altheeb/Desktop/CPLEX/test_43.cpp: In function ‘int main(int, char**)’:
    /home/altheeb/Desktop/CPLEX/test_43.cpp:1868: error: invalid conversion from ‘int*’ to ‘IloInt’
    /home/altheeb/Desktop/CPLEX/test_43.cpp:1868: error: initializing argument 1 of ‘IloNumVar& IloNumVarArray::operator[](IloInt)’
    /home/altheeb/Desktop/CPLEX/test_43.cpp:1879: error: invalid conversion from ‘int*’ to ‘IloInt’
    /home/altheeb/Desktop/CPLEX/test_43.cpp:1879: error: initializing argument 1 of ‘IloNumVar& IloNumVarArray::operator[](IloInt)’
    Could you explain me why I got these error

    Thanks
    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: Modified Branch and Bound

    Posted 08/02/12 07:40 AM

    Originally posted by: SystemAdmin


    The error message says that you are trying to index into an array with a value of type 'int*' instead of an integral type. So look at line 43 in your code and make sure that the array indeces you use are integral types and not pointers.
    What are the types of X_opkt, X_perm, nDNodes? I guess the loop variables are all ints?
    #CPLEXOptimizers
    #DecisionOptimization


  • 8.  Re: Modified Branch and Bound

    Posted 08/02/12 01:16 PM

    Originally posted by: FANS_Nader_Al_Theeb


    Ok, I figure out what is the problem

    Thanks a lot
    #CPLEXOptimizers
    #DecisionOptimization