Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  incrementality

    Posted 11/12/09 07:30 PM

    Originally posted by: SystemAdmin


    [polochon said:]

    Hi,
    I have a question on the incrementality of the model, for example I have a model M :

    subject to {
    constraint1;
    constraint2;
    }

    I would like to lunch (M and C1) and after ( M and C2) ... (M and Ci) and so on. (C1,...Cn are constraints)
    So my question is: is there a method to lunch M (we have in the store: constraint1; constraint2) and after we add to the store C1, if there is no solution, remove C1 and submit C2 and so on.



    #DecisionOptimization
    #OPLusingCPOptimizer


  • 2.  Re: incrementality

    Posted 11/12/09 08:51 PM

    Originally posted by: SystemAdmin


    [jfk said:]

    hello there,
    basically there are 2 solutions:
    A.
    as far as I know you can't add and then remove constraint in OPL. I've done something similar but long time ago so I don't have any code, I will just outline what I think would work:
    1. you can ignore or respect constraint with the "if dataj==1 then constraintj" kind of statement
    2. you have to design a script flow control, where you read a constraintDataArray which indicates which constraints should be respected or ignored.
    3. And after each run you can manipulate this array and then you can rerun the runconfig with a completely new data set or just you modify 1 data element in the data set - as you put it if it fails you ignore it in the next run and you try with a new one, if the run produces solution then you keep it and you add the next constraint in the array

    well, this based on your own way of exploring the constraints which can be respected. Say, you have 10 constraints and adding the first one produces solution but contradict all the rest, meanwhile all the 9 later constraint resolve into a solution. So if you start with the "bad" one you end up adding just 1 constraint, meanwhile if you start with the "good" ones you add up 9 with solution.
    so B below maybe better:

    B.
    the other solution is that you use the constraint relaxation facility (only for LP/MIP problems) where you define priorities for each constraint (this tells the relaxation algorithm in which order you want them relaxed) and then run and wait and you will
    1. get a solution
    2. with the necessary constraints relaxed


    cheers 
    #DecisionOptimization
    #OPLusingCPOptimizer


  • 3.  Re: incrementality

    Posted 11/12/09 09:08 PM

    Originally posted by: SystemAdmin


    [polochon said:]

    Thanks for your answer jfk,

    [quote author=jfk link=topic=1461.msg4139#msg4139 date=1258048275]
    3. And after each run you can manipulate this array and then you can rerun the runconfig with a completely new data set or just you modify 1 data element in the data set - as you put it if it fails you ignore it in the next run and you try with a new one, if the run produces solution then you keep it and you add the next constraint in the array


    I want to avoid relaunching the resolution, but launching a single resolution which will keep the state of M (imagine that we have a lot of contraint in M) then adds a constraint C1, if there is no solution it adds the other one and so on.
    It's just for a good performance instead of running (M and C1) then running (M and C2)...
    [quote author=jfk link=topic=1461.msg4139#msg4139 date=1258048275]
    B.
    the other solution is that you use the constraint relaxation facility (only for LP/MIP problems) where you define priorities for each constraint (this tells the relaxation algorithm in which order you want them relaxed) and then run and wait and you will
    1. get a solution
    2. with the necessary constraints relaxed

    I'm not in LP/MIP problems

    cheers
    #DecisionOptimization
    #OPLusingCPOptimizer


  • 4.  Re: incrementality

    Posted 11/16/09 04:06 PM

    Originally posted by: SystemAdmin


    [ol said:]

    Hello,

    Could you tell us a little bit more on the problem? You should try to find some "good" properties on the constraints C_i.

    For example, if the C_i constraints are "simple" constraints, that is to say are not global constraints like alldifferent, it is possible to link them to boolean variables which represent the truth value of the constraints.
    Let v_i be the truth value of constraint C_i, your problem can be expressed as minimizing i such that v_i is true (use an element constraint to link i with v_i).

    Another possible useful property would be if C_i constraints are (or can be made) relaxations of C_i-1 (i.e. C_i + M  implies C_i+1): in that case a possible way is, instead of searching the first solvable M + C_i starting with i=0,1,2,..., to perform a binary search. You will only need log n iterations instead of n in the worst case.

    Best wishes

    Olivier




    #DecisionOptimization
    #OPLusingCPOptimizer