Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Cplex.Solve() Results

    Posted 03/22/20 09:52 PM

    Originally posted by: Minoo


    I wrote my optimization problem using Cplex OPL. When I use Cplex.Solve() in the main part it does not give any solution. When I don't use Cplex.solve(), in the Engine Log, I get the following Results:

    Version identifier: 12.10.0.0 | 2019-11-26 | 843d4de2ae
    Found incumbent of value -1.420667 after 0.00 sec. (0.00 ticks)
    Tried aggregator 2 times.
    MIP Presolve eliminated 77 rows and 31 columns.
    Aggregator did 5 substitutions.
    All rows and columns eliminated.
    Presolve time = 0.00 sec. (0.07 ticks)

    Root node processing (before b&c):
      Real time             =    0.00 sec. (0.08 ticks)
    Parallel b&c, 8 threads:
      Real time             =    0.00 sec. (0.00 ticks)
      Sync time (average)   =    0.00 sec.
      Wait time (average)   =    0.00 sec.
                              ------------
    Total (root+branch&cut) =    0.00 sec. (0.08 ticks)

     

    How it's possible? If my problem has a solution, why Cplex does not show anything when I am using Cplex.solve()?


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Cplex.Solve() Results

    Posted 03/23/20 02:55 AM

    What exactly do you mean by "it does not show a solution"? What if you call cplex.getObjValue() or attempt to query the solution values for the variables?


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Cplex.Solve() Results

    Posted 03/23/20 09:42 AM

    Originally posted by: Minoo


    At the end of my program in the .mod file, I have this script:

     main
      {
        var mod = thisOplModel.modelDefinition;
        var data = thisOplModel.dataElements;
        var myCplex = new IloCplex();
        var opl = new IloOplModel(mod, myCplex);
        opl.addDataSource(data);
        opl.generate();
        myCplex.solve();
        if (myCplex.getObjValue())
        {
          writeln("Solution Found");
          }
          opl.end();
          myCplex.end();
        }

     

    At the "Problem Browser" window, I get "No solution". When I remove the above script, I get solution in "Problem Browser". Does it mean that the solution is not correct?

     

    Thank you for your help.


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Cplex.Solve() Results

    Posted 03/24/20 04:47 AM

    Originally posted by: FredericDelhoume


    Daniel is right, when the model has a main() then the problem browser is not populated and "No solution"is displayed here.

     

    This is because in scripting you could have any logic not related to solutions the problem browser can understand.

     

    You have to display the solution(if any), depending on the logic of your workflow with scripting.


    #CPLEXOptimizers
    #DecisionOptimization