Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  CPLEX_MATLAB_Differenet answers for the same model

    Posted 03/13/13 03:35 PM

    Originally posted by: M8Y7_Masood_fathi


    Dear Friends,
    In fact, I have solved a model by CPLEX 12.4 and CPLEX 12.5 and I found different solutions for the same model. I really could not understand the point!!! I ran the same model (*.m file)in both CPLEX "12.4" and "12.5" and I got different solutions. How is it possible? As far as I know the obtain solution from CPLEX should be the optimum solution!!!!
    Attached is the *.m file.
    It would be very nice of you if you can provide me with your opinion.

    Note: In the discussed model I had two objectives: Minimizing the "N_Tours" and "Inventory". The achieved result for the second objective by CPLEX 12.5 is better as compare to the CPLEX "12.4".
    %%%%%%%%%%%%%%
    Answer from CPLEX 12.4
    %%%%%%%%%%%%%%%
    N_Tours
    8

    Inventory
    0.4688

    %%%%%%%%%%%%%
    Answer from CPLEX 12.5
    %%%%%%%%%%%%%%%
    N_Tours
    8

    Inventory
    0.3438
    Regards,
    Masood
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: CPLEX_MATLAB_Differenet answers for the same model

    Posted 03/14/13 02:32 AM

    Originally posted by: SystemAdmin


    What is the objective function value (cplex.Solution.objval) in the two cases? Is it the same or is it different?
    If the objective function value is the same then your model may have multiple optimal solutions (optimal solutions need not be unique) and the different versions of CPLEX may well find different ones.
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: CPLEX_MATLAB_Differenet answers for the same model

    Posted 03/14/13 05:27 AM

    Originally posted by: M8Y7_Masood_fathi


    Dear Daniel Junglas;
    Really thanks for replying me. In fact the objectives are different. Here you have the objective functions from CPLEX 12.4 and 12.5 for the same model (*.m file) respectively.

    CPLEX 12.4
    Objective function
    8001875
    %%%%%%%%%%%%%%%%%
    CPLEX 12.5
    Objective function
    8001375

    Note: I found an interesting point, at the moment the coefficients of the variables in the objective function are 1000000 and 50 (I assigned a higher coefficient to the first objective as it has a very high importance). In such, I got different solutions for the second objective from CPLEX 12.4 and 12.5 (the solution from 12.5 is better, CPLEX 12.5 -->"0.3438" and CPLEX 12.4 --> "0.4688"). In CPLEX 12.4, I reduced the coefficient of the first objective from 1000000 to 100000 and I got the same solution as CPLEX 12.5 (with the mentioned change in the coefficient in CPLEX 12.4, the value of the objective function is "801375"). As you can see "1375" (which is the value of the second objective) is the same with the value that I got from CPLEX 12.5 --> "8001375". By doing this change, the first and second objectives are also same as CPLEX 12.5 (See the objectives in the following).

    N_Tours
    8

    Inventory
    0.3438

    It seems that the problem can be caused by a large difference between the coefficient of the objectives (in CPLEX 12.4). However, I still couldn't understand the point to apply it in other similar cases.
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: CPLEX_MATLAB_Differenet answers for the same model

    Posted 03/14/13 06:10 AM

    Originally posted by: SystemAdmin


    I suspect that CPLEX is aborting prematurely because it reached the default MIP gap of 0.01%.

    Try setting the MIPGAP parameter to 0 and see if the two versions then agree on the optimal objective value.
    Tobias
    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: CPLEX_MATLAB_Differenet answers for the same model

    Posted 03/14/13 08:00 AM

    Originally posted by: M8Y7_Masood_fathi


    Dear Tobias Achterberg,
    I believe that there should be another problem. I solved some other samples and I got completely different solutions. For instance, for the attached *.m file the solution from CPLEX 12.5 is totally different from CPLEX 12.4. You can see the difference for the solved sample as it has been reported below.(You also can check the difference by running the attached "test.m" file in both CPLEX 12.5 and 12.4)
    By the way, It would be very nice of you it you can let me know how I can change the MIPGAP parameter in CPLEX_MATLAB interface.
    %%%%%%%%%%%%%%%%
    CPLEX 12.5
    %%%%%%%%%%%%%%%%%%
    Objective function
    17091200

    N_Tours
    17

    Inventory
    1.3217

    %%%%%%%%%%%%
    CPLEX 12.4
    %%%%%%%%%%%%%%
    Objective function
    2.2048e+07

    N_Tours
    22

    Inventory
    0.6913

    Thanks in advance,
    Masood
    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: CPLEX_MATLAB_Differenet answers for the same model

    Posted 03/14/13 09:20 AM

    Originally posted by: M8Y7_Masood_fathi


    Dear Tobias Achterberg,
    I mad a mistake in my last comment. In fact I set the "timelimit" to 60 sec. (mistakenly) and it was the reason for having a large difference. However, the first problem to have an optimum solution is still available.
    I added this line "options.mip.tolerances.mipgap=0;" . I don't know if it is a correct way to set the MIPGAP parameter to 0 but, there is still the same difference in the first solved sample ( which we discussed).

    Masood
    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: CPLEX_MATLAB_Differenet answers for the same model

    Posted 03/14/13 09:45 AM

    Originally posted by: SystemAdmin


    Can you please post the two CPLEX logs that yield the two different "optimal" objective values? Please enclose them in {code} tags so that they are readable in this forum.

    Tobias
    #CPLEXOptimizers
    #DecisionOptimization


  • 8.  Re: CPLEX_MATLAB_Differenet answers for the same model

    Posted 03/14/13 09:56 AM

    Originally posted by: M8Y7_Masood_fathi


    %%%%%%%%%%CPLEX 12.5%%%%%%%%%%%%%
    
    Tried aggregator 2 times. MIP Presolve eliminated 90 rows and 98 columns. MIP Presolve modified 10 coefficients. Aggregator did 10 substitutions. Reduced MIP has 88 rows, 150 columns, and 370 nonzeros. Reduced MIP has 0 binaries, 80 generals, 0 SOSs, and 0 indicators. Presolve time = 0.01 sec. (0.40 ticks) Found incumbent of value 8006425.000000 after 0.01 sec. (0.76 ticks) Probing time = 0.00 sec. (0.00 ticks) Tried aggregator 2 times. MIP Presolve eliminated 1 rows and 3 columns. Aggregator did 9 substitutions. Reduced MIP has 78 rows, 138 columns, and 337 nonzeros. Reduced MIP has 1 binaries, 76 generals, 0 SOSs, and 0 indicators. Presolve time = 0.00 sec. (0.18 ticks) Probing time = 0.00 sec. (0.00 ticks) MIP emphasis: balance optimality and feasibility. MIP search method: dynamic search. Parallel mode: deterministic, using up to 4 threads. Root relaxation solution time = 0.00 sec. (0.14 ticks)   Nodes                                         Cuts/  Node  Left     Objective  IInf  Best Integer    Best Bound    ItCnt     Gap   *     0+    0                      8006325.0000  8001375.0000        0    0.06% *     0+    0                      8004575.0000  8001375.0000        0    0.04% *     0     0      integral     0  8001375.0000  8001375.0000        0    0.00% Elapsed time = 0.01 sec. (1.21 ticks, tree = 0.00 MB, solutions = 3)   Root node processing (before b&c): Real time             =    0.00 sec. (0.26 ticks) Parallel b&c, 4 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.26 ticks)   Time =   0.1878   Objective function 8001375   N_Tours 8   Inventory 0.3438
    


    
    Tried aggregator 2 times. MIP Presolve eliminated 90 rows and 98 columns. MIP Presolve modified 10 coefficients. Aggregator did 10 substitutions. Reduced MIP has 88 rows, 150 columns, and 370 nonzeros. Reduced MIP has 0 binaries, 80 generals, 0 SOSs, and 0 indicators. Probing fixed 0 vars, tightened 2 bounds. Probing time =    0.00 sec. Tried aggregator 2 times. MIP Presolve eliminated 1 rows and 3 columns. Aggregator did 9 substitutions. Reduced MIP has 78 rows, 138 columns, and 337 nonzeros. Reduced MIP has 1 binaries, 76 generals, 0 SOSs, and 0 indicators. Presolve time =    0.00 sec. Probing time =    0.00 sec. MIP emphasis: balance optimality and feasibility. MIP search method: dynamic search. Parallel mode: none, using 1 thread. Root relaxation solution time =    0.00 sec.   Nodes                                         Cuts/  Node  Left     Objective  IInf  Best Integer    Best Bound    ItCnt     Gap   0     0  8000256.2500    59                8000256.2500        0 *     0+    0                      8002275.0000  8000256.2500        0    0.03% 0     0  8000844.3974    33  8002275.0000     Cuts: 119       47    0.02% *     0+    0                      8001875.0000  8000844.3974       47    0.01% 0     0  8001126.1200    22  8001875.0000     Cuts: 110       73    0.01% Mixed integer rounding cuts applied:  91 Zero-half cuts applied:  1 Gomory fractional cuts applied:  49   Root node processing (before b&c): Real time             =    0.02 Sequential b&c: Real time             =    0.00 ------- Total (root+branch&cut) =    0.02 sec.   Time =   0.1744   Objective function 8001875     N_Tours 8   Inventory 0.4688
    

    #CPLEXOptimizers
    #DecisionOptimization