Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  ilomodel.add(constraint) method

    Posted 06/25/14 04:53 PM

    Originally posted by: skkim


    I am wondering when we add constraints into an ilomodel whether it is stocked at the bottom or at the top.

    Say, if we have three constraints such as contr1, contr2, and contr3.

    When we use ilomodel.add(constraint) in the order of contr1, contr2, and contr3,

    Will the order for IloRange objects be  contr1, contr2, and contr3 or contr3, contr2, and contr1 or random in the worst case?


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: ilomodel.add(constraint) method

    Posted 06/26/14 04:08 AM

    Constraints are always added at the bottom. However, if you find yourself doing something that depends on the order of constraints then you are probably in for trouble. Why do you need to know about the order of constraints?


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: ilomodel.add(constraint) method

    Posted 06/26/14 09:12 AM

    Originally posted by: skkim


    Thank you. the code does not depend on the order of them. It is just for debugging purpose. We made some mistake on adding constraints, but the result looks same before / after fixing it. I assumed probably CPLEX added them by inserting on the top of it, which takes extra effort, not by putting on the back.

    I thought the order might be based on system configuration, not by cplex.


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: ilomodel.add(constraint) method

    Posted 06/26/14 10:58 AM

    Do you know that you can assign names to your constraints? This way you can find them easily during debugging sessions or when exporting them to a file. Just use the setName() method to assign a name to a constraint.


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: ilomodel.add(constraint) method

    Posted 06/26/14 11:14 AM

    Originally posted by: skkim


    Yes, I know that. And we have the name for it.

    It is just that one of my colleagues made the code to add the constraints by each iteration when columns are added, which is not correct.

    The algorithm was using the dual values from each constraint.

    So, once we fixed the bug, we thought the new columns added after each iteration should be different than before we fixed the bug.

    However, it turned out to be exactly same, which is very weird, so I thought the constraints were inserted at the top, which might be very costly in terms of performance.


    #CPLEXOptimizers
    #DecisionOptimization