Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Accessing temporal value domains in CP Optimizer objective function

    Posted 02/04/25 01:47 PM

    Hi everyone,

    I am relatively new to CP Optimizer.  I am working on a project related to creating schedules that maximize reassignment flexibility.  As a part of this, I am looking to access temporal value domains for my interval variables in the objective function.  From looking through the documentation, it seems like the domains can only be accessed during the search if you are making a custom search (Search API for scheduling in CP Optimizer). Functions like getEndMax() and getSizeMin() are what I am looking for, but able to be called as a part of the objective function.

    Let me know if you need any further information or if you have any sense of how to do this or if it is at all possible.

    Thanks so much,

    Esme

    Ibm remove preview
    Search API for scheduling in CP Optimizer
    View this on Ibm >

    )



    ------------------------------
    Esme Rubinstien
    ------------------------------


  • 2.  RE: Accessing temporal value domains in CP Optimizer objective function

    Posted 02/05/25 08:25 AM
     
    Hello, 
    a constraint or an objective involve constrained variables or constained expressions. A constraint or objective about the size of an interval must involve the constrained expression:
        public IloIntExprArg IloSizeOf(const IloIntervalVar a, IloInt absVal=0).
    That is probably what you need.
     
    Otherwise, you may want to have access to the bounds of the variables in the constraint model (getSizeMin() in the link you sent), to modify the constaint model. Is it what you want?
     
    Or you may want to access to the low level implementation objects, like the bounds of the domains of a constrained variable during the search, but in this case this is because you have some algorithmic ideas in mind, and that should not interfer with the constraint model. Is it your need?



    ------------------------------
    Olivier Lhomme
    ------------------------------



  • 3.  RE: Accessing temporal value domains in CP Optimizer objective function

    Posted 02/11/25 11:21 PM
    We are trying to use CP optimizer to specify an algorithm for optimizing task assignments when there is uncertainty in resource availability. The basic idea is to prefer resource assignments that leave the most flexibility to reassign tasks as possible. And our approach to modeling this is to maximize the number of feasible solutions that remain for recovering from unexpected unavailability. 
    So the issue we have run into is the following:
    - We would like to define an objective function that maximizes the number of feasible solutions which relates closely to maximizing the amount of remaining slack
    - But CP-optimizer does not allow access to the underlying STN that is being used to produce the solution
    - There are functions smin, smax, emin, emax, dmin, dmax in OPL that seem to only be available in CP Optimizer if one is writing a custom search procedure.
    Is there any way to express an objective function in CP Optimizer that accesses the underlying domains of interval decision variable start and end times that we are missing? If not, is there any way to augment the default search procedures so that STN domain variables can be accessed?


    ------------------------------
    [Esme] [Rubinstein]
    [Research Assistant]
    [Carnegie Mellon University]
    [Pittsburgh] [PA]
    ------------------------------



  • 4.  RE: Accessing temporal value domains in CP Optimizer objective function

    Posted 02/12/25 11:30 AM

    Hello,

    the first approach to investigate is probably to express your problem as constraints and constrained expressions or variables.
    For example, you may have an objective that penalizes the usage of the most uncertain resources, or tries to distribute equally the tasks to the resources, ...
    This will make possible, in case of a late event like a resource is no longer available, to reassign more quickly the tasks while minimizing the changes with the planned schedule, note you can also restart a new search from the current assignment (see https://www.ibm.com/docs/en/icos/22.1.2?topic=c-starting-point-in-cp-optimizer).

    Or, if you have a stochastic problem, one possible way is to define a few scenarios, s1 ... sn, and to link them with the objects that are shared between the scenarios. 
    You can find an example for the stochastic jobshop problem, in OPL (see opl\examples\opl\sched_stochastic_jobshop) or in C++ where you can find some explanations about the example ( cpoptimizer\examples\src\cpp\sched_stochastic_jobshop.cpp).

    Otherwise some more advanced techniques may be possible, for example using blackboxes (see https://www.ibm.com/docs/en/icos/22.1.2?topic=c-cp-optimizer-black-box-optimization-feature), but we do not encourage the users to use the low level API to access the Ilc objects and define their own custom search.



    ------------------------------
    Olivier Lhomme
    ------------------------------