Topic
  • 5 replies
  • Latest Post - ‏2013-06-05T23:16:59Z by HWFN_Hossein_Hojabri
HWFN_Hossein_Hojabri
25 Posts

Pinned topic setPossibleValues()

‏2013-05-28T13:54:49Z |

Hi,

 

I'm using CP as constructor in my LNS algorithm. At every iteration, I need to have a particular domain for any of the decision variables. So at each iteration, I have an integer array of values (IloIntArray) that I should assign to every single variable. This is done through setPossibleValues(domain:IloIntArray). The algorithm seems to work, and improves the initial solution. However, the final solution after some minutes is far away from the optimal solution. So I just need to make sure if I'm using the correct function to manipulate the domains whenever I need, or it's because of another problem. Is setPossibleValues() the thing that I should use for this purpose?

 

Any comment is appreciated.

Thanks,

Hossein

  • rdumeur
    rdumeur
    109 Posts

    Re: setPossibleValues()

    ‏2013-05-28T15:54:09Z  

    Dear Hossein,

    Could you please describe your model, or better provide a simplified version of it?

    Depending on how it is modeled, the time taken by the solver to produce a good solution may vary a lot.

    Also, could you please give more information on the number of variables and domain sizes?

    Cheers,

     

                    Renaud

  • HWFN_Hossein_Hojabri
    25 Posts

    Re: setPossibleValues()

    ‏2013-05-28T21:36:20Z  
    • rdumeur
    • ‏2013-05-28T15:54:09Z

    Dear Hossein,

    Could you please describe your model, or better provide a simplified version of it?

    Depending on how it is modeled, the time taken by the solver to produce a good solution may vary a lot.

    Also, could you please give more information on the number of variables and domain sizes?

    Cheers,

     

                    Renaud

    Thanks,

     

    The problem is a VRPTW. Starting with a feasible initial solution, the LNS un-fixes a number of variables at every iteration (convert some of the fixed values in the current solution to variables again), and then this partially destructed solution is re-optimized through CP. The removed customers should be able to insert at every position in the routing plan. So the domains of successor variables are updated this way: 

    removed customer i: new domain(i)={0,1,...,nbCustomers}

    non-removed customer i: new domain(i): {successor(i) and {removed customers}}

     

    As you see, at every iteration I have to introduce a new domain set to every successor variable.

     

    I have 170 successor variables, and the original domain size of any successor variable is 170 as well. It seems to me that I should use specific variable and value selection heuristics. However, I should make sure if setPossibleValues() is the proper thing as well.

     

    Thanks

  • rdumeur
    rdumeur
    109 Posts

    Re: setPossibleValues()

    ‏2013-05-29T01:36:12Z  

    Thanks,

     

    The problem is a VRPTW. Starting with a feasible initial solution, the LNS un-fixes a number of variables at every iteration (convert some of the fixed values in the current solution to variables again), and then this partially destructed solution is re-optimized through CP. The removed customers should be able to insert at every position in the routing plan. So the domains of successor variables are updated this way: 

    removed customer i: new domain(i)={0,1,...,nbCustomers}

    non-removed customer i: new domain(i): {successor(i) and {removed customers}}

     

    As you see, at every iteration I have to introduce a new domain set to every successor variable.

     

    I have 170 successor variables, and the original domain size of any successor variable is 170 as well. It seems to me that I should use specific variable and value selection heuristics. However, I should make sure if setPossibleValues() is the proper thing as well.

     

    Thanks

    Dear Hossein,

    setPossibleValue is a valid way to set the domain of a variable.

    Now, as you are working on sequences of visits ordered temporally, maybe your model could take advantage of interval variables and associated constraints.

    Also, I don't know what global constraints you are using, but it might be useful to have a look the CPO parametres that controls the level of propagation of these constraints.

    http://pic.dhe.ibm.com/infocenter/cosinfoc/v12r5/index.jsp?topic=%2Filog.odms.cpo.help%2FCP_Optimizer%2FUser_manual%2Ftopics%2Fpropagate_special_inference.html

    I hope it helps.

    Cheers,

  • rdumeur
    rdumeur
    109 Posts

    Re: setPossibleValues()

    ‏2013-05-29T01:44:11Z  

    Thanks,

     

    The problem is a VRPTW. Starting with a feasible initial solution, the LNS un-fixes a number of variables at every iteration (convert some of the fixed values in the current solution to variables again), and then this partially destructed solution is re-optimized through CP. The removed customers should be able to insert at every position in the routing plan. So the domains of successor variables are updated this way: 

    removed customer i: new domain(i)={0,1,...,nbCustomers}

    non-removed customer i: new domain(i): {successor(i) and {removed customers}}

     

    As you see, at every iteration I have to introduce a new domain set to every successor variable.

     

    I have 170 successor variables, and the original domain size of any successor variable is 170 as well. It seems to me that I should use specific variable and value selection heuristics. However, I should make sure if setPossibleValues() is the proper thing as well.

     

    Thanks

    Hi again,

    This topic may help you,

    https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014930922

    In the thread you should find a capacited VRP with time windows modeled in OPL using interval variables.

    I hope this helps,

    Cheers,

  • HWFN_Hossein_Hojabri
    25 Posts

    Re: setPossibleValues()

    ‏2013-06-05T23:16:59Z  
    • rdumeur
    • ‏2013-05-29T01:44:11Z

    Hi again,

    This topic may help you,

    https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014930922

    In the thread you should find a capacited VRP with time windows modeled in OPL using interval variables.

    I hope this helps,

    Cheers,

    Thanks for the replies.

     

    Hossein