Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  How to read the Engine log and debug the code

    Posted 10/15/11 11:35 AM

    Originally posted by: SystemAdmin


    Hi

    when I don't get the feasible answers for one problem.I checked the Engine log
    it is displayed as below

    Infeasibility row 'id242': 0 >= 1.
    Presolve time = 0.00 sec.
    Infeasibility row 'id242': 0 >= 1.
    Presolve time = 0.00 sec.

    so how do i read row number id242 in my code.
    currently in the screen I can see 96 rows.

    so what is the 242 row.I am bit confused.

    Thanks
    #DecisionOptimization
    #MathematicalProgramming-General


  • 2.  Re: How to read the Engine log and debug the code

    Posted 10/15/11 01:53 PM

    Originally posted by: SystemAdmin


    If you don't assign your own names to variables and constraints,CPLEX assigns”id#” names, and I believe the variable and constraint numbers come from the same sequence (variables first). The easiest way to diagnose this is to assign your own constraint names.

    Paul

    Mathematicians are like Frenchmen: whenever you say something to them, they translate it into their own language, and at once it is something entirely different. (Goethe)
    #DecisionOptimization
    #MathematicalProgramming-General


  • 3.  Re: How to read the Engine log and debug the code

    Posted 10/17/11 06:58 AM

    Originally posted by: SystemAdmin


    Hi Paul,
    I have my own names for the constraints and variables.Please refer to the attached code.
    Thanks
    #DecisionOptimization
    #MathematicalProgramming-General


  • 4.  Re: How to read the Engine log and debug the code

    Posted 10/17/11 05:33 PM

    Originally posted by: SystemAdmin


    Sorry, thought you were using one of the CPLEX APIs. I don't know how to get OPL to attach your model names to the constraints and variables sent to CPLEX. It.s probably in the OPL docs somewhere, or you can ask in the OPL forum.

    Paul

    Mathematicians are like Frenchmen: whenever you say something to them, they translate it into their own language, and at once it is something entirely different. (Goethe)
    #DecisionOptimization
    #MathematicalProgramming-General


  • 5.  Re: How to read the Engine log and debug the code

    Posted 10/17/11 07:28 PM

    Originally posted by: SystemAdmin


    I did not see any constraint names in the code that you had sent. Please see the attached code, it has been appended with constraint names (of the form C<#>). When you run this, you will see that the engine complains about infeasibility in the C6(1) constraint. CPLEX/OPL then goes on to run the conflict refiner algorithm on the model to determine the minimal conflict set (displayed in the 'Conflicts' tab), then performs the minimal relaxation of the model to make it feasible (displayed in the 'Relaxations' tab) and then optimizes that relaxed model populating the 'Solutions' tab.

    The reason for infeasibility in the original model as mentioned before occurs in the C6(1) constraint which looks like the following:

    C6(1): 10 X(1)(1) + 8 X(2)(1) + 7 X(3)(1) >= 5

    Given that X is binary, for this constraint to be feasible, alteast one of the variables must be 1. The other constraints in your model however force these variables to take a value of 0. I will attach the conflict file in the next message which contains the set of minimal constraints that cause the infeasibility.

    CPLEX / OPL only relaxes named constraints and since your model originally did not contain any labelled constraints, it did not run the conflict refiner; but once you name some constraints, the engine will try to see if relaxing any of those constraints helps or not.
    #DecisionOptimization
    #MathematicalProgramming-General


  • 6.  Re: How to read the Engine log and debug the code

    Posted 10/17/11 07:31 PM

    Originally posted by: SystemAdmin


    Attached is the conflict file for your perusal. You can open it with Notepad/wordpad. I obtained it by running the conflict refiner on the exported form of the model using the interactive optimizer in CPLEX and the writing out the corresponding conflict file.

    Hope this helps you fix the cause of the infeasibility.
    #DecisionOptimization
    #MathematicalProgramming-General


  • 7.  Re: How to read the Engine log and debug the code

    Posted 10/19/11 05:05 AM

    Originally posted by: SystemAdmin


    Hi Abishek,
    Normally how do I can get the conflict.clp file form the models.I think that would be easy to compile the code.
    Other than that what is the meaning of these things.Do you have clear document to read stuffs in Engine log.

    Tried aggregator 5 times.
    MIP Presolve eliminated 67 rows and 28 columns.
    MIP Presolve modified 28 coefficients.
    Aggregator did 25 substitutions.
    Reduced MIP has 25 rows, 23 columns, and 65 nonzeros.
    Reduced MIP has 23 binaries, 0 generals, 0 SOSs, and 0 indicators.
    Probing time = 0.00 sec.
    Tried aggregator 1 time.
    Presolve time = 0.08 sec.
    Found feasible solution after 0.12 sec. Objective = 0.0000
    Probing time = 0.00 sec.
    Clique table members: 101.
    MIP emphasis: balance optimality and feasibility.
    MIP search method: dynamic search.
    Parallel mode: deterministic, using up to 4 threads.
    Root relaxation solution time = 0.02 sec.

    Nodes Cuts/
    Node Left Objective IInf Best Integer Best Bound ItCnt Gap

    • 0+ 0 0.0000 14 ---
    • 0+ 0 284.0000 14 ---
    0 0 338.5357 17 284.0000 338.5357 14 19.20%
    • 0+ 0 293.0000 338.5357 14 15.54%
    0 0 cutoff 293.0000 20 0.00%
    Elapsed real time = 1.28 sec. (tree size = 0.00 MB, solutions = 3)

    Clique cuts applied: 35
    Cover cuts applied: 1
    Implied bound cuts applied: 1
    Zero-half cuts applied: 8
    Gomory fractional cuts applied: 1

    Root node processing (before b&c):
    Real time = 1.58
    Parallel b&c, 4 threads:
    Real time = 0.00
    Sync time (average) = 0.00
    Wait time (average) = 0.00

    Total (root+branch&cut) = 1.58 sec.
    #DecisionOptimization
    #MathematicalProgramming-General


  • 8.  Re: How to read the Engine log and debug the code

    Posted 10/18/11 12:59 PM

    Originally posted by: SystemAdmin


    I suppose you can export the model into .lp format using OPL code, then you can Ctrl+F to find id242. This is the most simple way I think.
    #DecisionOptimization
    #MathematicalProgramming-General


  • 9.  Re: How to read the Engine log and debug the code

    Posted 10/19/11 05:09 AM

    Originally posted by: SystemAdmin


    Hi
    How do I can export it.I am using CPLEX Studio.I am not calling any APIs.
    I directly write my code in the CPLEX studio.
    Thanks
    #DecisionOptimization
    #MathematicalProgramming-General


  • 10.  Re: How to read the Engine log and debug the code

    Posted 10/19/11 08:35 PM

    Originally posted by: SystemAdmin


    > How do I can export it.I am using CPLEX Studio.I am not calling any
    > APIs. I directly write my code in the CPLEX studio.
    > Thanks

    To export the model to a human readable form (like LP), add a settings file to the particular run Configuration in the CPLEX Studio IDE (right click on the project/run configuration -> select 'new' -> settings file-> provide it a name, say 'test' -> OK). Then add this settings file to the particular run configuration by dragging and dropping it. Now double click this 'test.ops' file and then click the Language -> Run option in the left hand side pane. Now, select 'LP format' in the 'Export format' option in the right and then run the particular run configuration. This should result in the generation of a file (name being same as the run configuration name) with a .lp extension which is a human readable form of your model in the IDE. Lets say the file so generated is called 'Configuration1.lp'.

    > Normally how do I can get the conflict.clp file form the models.I
    > think that would be easy to compile the code.

    Now copy this model file (Configuration1.lp) into the <CPLEX_Studio123>\cplex\bin\<port> folder. To start the interactive optimizer, double click the cplex.exe file in this folder and then follow the steps as below:

    CPLEX> read Configuration1.lp
    CPLEX> conf
    CPLEX> wr conflict.clp
    CPLEX> dis conf all

    The above commands first read in the model file, then run the conflict refiner on the same, once the conflict refiner completes, then writes it to a conflict.clp file and the last command displays all the conflicts in the screen (it will be the same in content as the conflict.clp file).

    > Other than that what is the meaning of these things.Do you have clear
    > document to read stuffs in Engine log.

    You may want to go through the following doc links to understand more about the engine log and the information that it contains:

    http://publib.boulder.ibm.com/infocenter/cosinfoc/v12r3/index.jsp?topic=%2Filog.odms.cplex.help%2FContent%2FOptimization%2FDocumentation%2FOptimization_Studio%2F_pubskel%2Fps_usrmancplex1853.html

    http://publib.boulder.ibm.com/infocenter/cosinfoc/v12r3/index.jsp?topic=%2Filog.odms.ide.help%2FContent%2FOptimization%2FDocumentation%2FOptimization_Studio%2F_pubskel%2Fps_opl_IDE394.html

    Hope this helps.
    #DecisionOptimization
    #MathematicalProgramming-General