Decision Optimization

 View Only
Expand all | Collapse all

Getting all/large number of feasible solutions in docplex.cp python

  • 1.  Getting all/large number of feasible solutions in docplex.cp python

    Posted Mon April 06, 2020 02:21 PM

    Originally posted by: KeerthivasanC


    Hey everyone
    I was trying to get a large number of feasible solutions for my constraint programming model in docplex.cp. I have seen this link, which does the same in OPL:

    https://www.ibm.com/developerworks/community/forums/html/topic?id=fad149da-5bf8-4624-a88a-4444ad3702f8&ps=25

    Unfortunately, I am unable to figure out how to get the set of all possible/large number of feasible solutions in python. It would be great if someone could right a barebones code snippet, which I can leverage for my model in python(docplex.cp).

     

    Thanks and Regards.


    #CPOptimizer
    #DecisionOptimization


  • 2.  Re: Getting all/large number of feasible solutions in docplex.cp python

    Posted Tue April 07, 2020 04:29 AM

    Originally posted by: Olivier OUDOT


    Hello Keerthivasan

    I have attached a file that does exactly what you want.
    In a first step, the solver is called to know the minimum size of a Golomb Ruler, and solver is then called again to list all possible solutions with this optimal length.

    Hope this helps.


    #CPOptimizer
    #DecisionOptimization


  • 3.  Re: Getting all/large number of feasible solutions in docplex.cp python

    Posted Tue April 07, 2020 04:33 AM

    Originally posted by: KeerthivasanC


    Thanks a lot for your help, Olivier! This is exactly what I wanted. Thank you.


    #CPOptimizer
    #DecisionOptimization