Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  ForbiddenAssignments not working as expected.

    Posted 07/08/22 09:30 AM
    Hi all,

    I have been working on a CP optimizer model and noticed that forbiddenassignments was not implemented as it should. Anyone else ran into this issue before? Is IBM aware of this and providing a fix?

    Below is a clear example illustrating the issue. The optimal solution should not use <120, 160>, yet it does. It seems to work for |forbidden| = 1, |forbidden| = 2, but not for |forbidden| = 3



    I hope someone can help.

    Cheers,

    Charles


    ------------------------------
    Charles Jolin-Landry
    ------------------------------

    #DecisionOptimization


  • 2.  RE: ForbiddenAssignments not working as expected.

    Posted 07/11/22 01:59 AM
    Hi,

    that looks strange.

    As a workaround you can write

    forall(f in forbidden) (x!=f.a) || (y!=f.b);​

    and then you will get

    // solution with objective 478.5
    x = 120;
    y = 159;


    ------------------------------
    [Alex] [Fleischer]
    [Data and AI Technical Sales]
    [IBM]
    ------------------------------



  • 3.  RE: ForbiddenAssignments not working as expected.

    Posted 07/12/22 01:50 PM
    Hi Alex,

    Thank you for the reply. This indeed may work for this simple example, but I only created this small example to illustrate a bigger issue. I cannot use forbiddenassignments with confidence that it will actually perform as intended. When problems grow in size, i.e. when the arity of forbidden is very large, the performance of the workaround you have suggested may not be great. I may be wrong about this since I am unsure how IBM implements forbiddenassignments, but my understanding is that there should be some advantage to use it as opposed to a series of != and || statements. 

    In any case, is there a way to create a ticket for the IBM development team to provide a fix to this issue in the next release of CPLEX/CP OPTIMIZER?

    Cheers,

    Charles

    ------------------------------
    Charles Jolin-Landry
    ------------------------------



  • 4.  RE: ForbiddenAssignments not working as expected.

    Posted 07/12/22 02:02 PM
    Hi,

    I logged a support request.

    Next time , do not hesitate to log a request at https://www.ibm.com/mysupport/s/?language=en_US

    regards

    PS:

    I shared other useful links at https://www.linkedin.com/pulse/low-barrier-entry-optimization-through-cplex-alex-fleischer/

    ------------------------------
    [Alex] [Fleischer]
    [Data and AI Technical Sales]
    [IBM]
    ------------------------------



  • 5.  RE: ForbiddenAssignments not working as expected.

    Posted 07/12/22 02:32 PM
    That's great. Thank you very much. I was unaware how to submit a request. I will for sure use that next time.

    Cheers,

    ------------------------------
    Charles Jolin-Landry
    ------------------------------



  • 6.  RE: ForbiddenAssignments not working as expected.

    Posted 07/13/22 08:48 AM
    Hello,
    You found a bug in the forbidden assignment constraint, which may, in some cases, lead to missing domain reductions, and, even worse as in your case, to a wrong solution.

    Two remarks about the workaround proposed by Alex (adding a constraint for each forbidden tuple):
    - As you suspect, adding a huge number of constraints, one for each tuple, or handling large arities may be significantly more costly than a single forbidden assignment constraint, but it may as well have little impact on the efficiency, it really depends on the problem.
    - you can keep the forbidden assignment constraint in addition to the constraints per tuple, it can infer additional domain reductions.

    Another workaround would be to use an allowed assignment constraint instead of the forbidden assignment:
    let X be the variables in the constraint, D be the Cartesian product of the domains of X, and F be the set of forbidden tuples, you can introduce a new set of tuples A that is the complement of F in D, and then use A in the allowed assignment constraint.
    This workaround may be unrealistic if the number of tuples in A is too large.

    If none of these workarounds are satisfactory, the C++ API may give access to some other workarounds, but would need some coding.

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