Did I reach the optimal solution?

152 views
Skip to first unread message

Mohamed Kareem

unread,
Sep 21, 2016, 2:07:17 PM9/21/16
to Gurobi Optimization

I run an optimization problem on matlab, which is solved by Gurobi, and I get results and draw plost with these results. However, I receive the following message in the command window of Matlab:

" Exiting: One or more of the residuals, duality gap, or total relative error has stalled:
         the primal appears to be infeasible and the dual unbounded since
         the dual objective > 1e+10
         and the primal objective > -1e+6.  "

Also, I receive the following message when I do some changes in the problem:

"Exiting: One or more of the residuals, duality gap, or total relative error
 has stalled:
         both the primal and the dual appear to be infeasible. "



What does this mean?
Did I reach the optimal solution?
If No, what should I do to reach the optimal solution?


 

Sonja Mars

unread,
Sep 22, 2016, 2:11:06 AM9/22/16
to gur...@googlegroups.com
Hi,

Can you please post the full Gurobi log files/Gurobi output in the command window of Matlab? That would really be helpful to figure out what is going on.

Thanks and best regards,
Sonja


----
Dr. Sonja Mars
Gurobi Optimization - Technical Support



Mohamed Kareem

unread,
Sep 22, 2016, 9:25:40 AM9/22/16
to Gurobi Optimization
Thanks for your reply!

The following is what I get in the command window of Matlab. The Optimization problem is solved 24 times, for 24 hours. ans =1 1 means first hour, and so on.



Matlab command window:

WPP_SOSDC_3rd

ans =

     1     1


Exiting: One or more of the residuals, duality gap, or total relative error
 has stalled:
         the primal appears to be infeasible and the dual unbounded since
         the dual objective > 1e+10
         and the primal objective > -1e+6.
Warning: Ignoring extra legend entries.
> In legend>set_children_and_strings (line 629)
  In legend>make_legend (line 321)
  In legend (line 247)
  In WPP_SOSDC_3rd (line 255)

ans =

     1     2


Exiting: One or more of the residuals, duality gap, or total relative error
 has stalled:
         the primal appears to be infeasible and the dual unbounded since
         the dual objective > 1e+10
         and the primal objective > -1e+6.
Warning: Ignoring extra legend entries.
> In legend>set_children_and_strings (line 629)
  In legend>make_legend (line 321)
  In legend (line 247)
  In WPP_SOSDC_3rd (line 255)

ans =

     1     3


Exiting: One or more of the residuals, duality gap, or total relative error
 has stalled:
         the primal appears to be infeasible and the dual unbounded since
         the dual objective > 1e+10
         and the primal objective > -1e+6.
Warning: Ignoring extra legend entries.
> In legend>set_children_and_strings (line 629)
  In legend>make_legend (line 321)
  In legend (line 247)
  In WPP_SOSDC_3rd (line 255)

ans =

     1     4


Exiting: One or more of the residuals, duality gap, or total relative error
 has stalled:
         both the primal and the dual appear to be infeasible.

Warning: Ignoring extra legend entries.
> In legend>set_children_and_strings (line 629)
  In legend>make_legend (line 321)
  In legend (line 247)
  In WPP_SOSDC_3rd (line 255)

ans =

     1     5


Exiting: One or more of the residuals, duality gap, or total relative error
 has stalled:
         both the primal and the dual appear to be infeasible.

Warning: Ignoring extra legend entries.
> In legend>set_children_and_strings (line 629)
  In legend>make_legend (line 321)
  In legend (line 247)
  In WPP_SOSDC_3rd (line 255)

ans =

     1     6


Exiting: One or more of the residuals, duality gap, or total relative error
 has stalled:
         the primal appears to be infeasible and the dual unbounded since
         the dual objective > 1e+10
         and the primal objective > -1e+6.

ans =

     1     7


Exiting: One or more of the residuals, duality gap, or total relative error
 has stalled:
         both the primal and the dual appear to be infeasible.


ans =

     1     8


Exiting: One or more of the residuals, duality gap, or total relative error
 has stalled:
         both the primal and the dual appear to be infeasible.


ans =

     1     9


Exiting: One or more of the residuals, duality gap, or total relative error
 has stalled:
         the primal appears to be infeasible and the dual unbounded since
         the dual objective > 1e+10
         and the primal objective > -1e+6.

ans =

     1    10


Exiting: One or more of the residuals, duality gap, or total relative error
 has stalled:
         the primal appears to be infeasible and the dual unbounded since
         the dual objective > 1e+10
         and the primal objective > -1e+6.

ans =

     1    11


Exiting: One or more of the residuals, duality gap, or total relative error
 has stalled:
         the primal appears to be infeasible and the dual unbounded since
         the dual objective > 1e+10
         and the primal objective > -1e+6.

ans =

     1    12


Exiting: One or more of the residuals, duality gap, or total relative error
 has stalled:
         the primal appears to be infeasible and the dual unbounded since
         the dual objective > 1e+10
         and the primal objective > -1e+6.

ans =

     1    13


Exiting: One or more of the residuals, duality gap, or total relative error
 has stalled:
         the primal appears to be infeasible and the dual unbounded since
         the dual objective > 1e+10
         and the primal objective > -1e+6.

ans =

     1    14


Exiting: One or more of the residuals, duality gap, or total relative error
 has stalled:
         both the primal and the dual appear to be infeasible.


ans =

     1    15


Exiting: One or more of the residuals, duality gap, or total relative error
 has stalled:
         the primal appears to be infeasible and the dual unbounded since
         the dual objective > 1e+10
         and the primal objective > -1e+6.

ans =

     1    16


Exiting: One or more of the residuals, duality gap, or total relative error
 has stalled:
         the primal appears to be infeasible and the dual unbounded since
         the dual objective > 1e+10
         and the primal objective > -1e+6.

ans =

     1    17


Exiting: One or more of the residuals, duality gap, or total relative error
 has stalled:
         the primal appears to be infeasible and the dual unbounded since
         the dual objective > 1e+10
         and the primal objective > -1e+6.

ans =

     1    18


Exiting: One or more of the residuals, duality gap, or total relative error
 has stalled:
         the primal appears to be infeasible and the dual unbounded since
         the dual objective > 1e+10
         and the primal objective > -1e+6.

ans =

     1    19


Exiting: One or more of the residuals, duality gap, or total relative error
 has stalled:
         the primal appears to be infeasible and the dual unbounded since
         the dual objective > 1e+10
         and the primal objective > -1e+6.

ans =

     1    20


Exiting: One or more of the residuals, duality gap, or total relative error
 has stalled:
         the primal appears to be infeasible and the dual unbounded since
         the dual objective > 1e+10
         and the primal objective > -1e+6.

ans =

     1    21


Exiting: One or more of the residuals, duality gap, or total relative error
 has stalled:
         the primal appears to be infeasible and the dual unbounded since
         the dual objective > 1e+10
         and the primal objective > -1e+6.

ans =

     1    22


Exiting: One or more of the residuals, duality gap, or total relative error
 has stalled:
         the primal appears to be infeasible and the dual unbounded since
         the dual objective > 1e+10
         and the primal objective > -1e+6.

ans =

     1    23


Exiting: One or more of the residuals, duality gap, or total relative error
 has stalled:
         the primal appears to be infeasible and the dual unbounded since
         the dual objective > 1e+10
         and the primal objective > -1e+6.

ans =

     1    24


Exiting: One or more of the residuals, duality gap, or total relative error
 has stalled:
         the primal appears to be infeasible and the dual unbounded since
         the dual objective > 1e+10
         and the primal objective > -1e+6.

Expected_Profit_for_One_Day =

     1.258647821067048e+04


Expected_Value_of_Negative_Profits_for_One_Day =

 -18.750161110157411

>>

Sonja Mars

unread,
Sep 23, 2016, 12:29:47 AM9/23/16
to gur...@googlegroups.com
Hi,

These error messages are not Gurobi errors, I have never seen them before.

It looks like you are using linprog: https://de.mathworks.com/help/optim/ug/linprog.html

Best regards,

Mohamed Kareem

unread,
Sep 23, 2016, 3:48:09 PM9/23/16
to Gurobi Optimization


Thanks for your helpful reply. As I use more than one PC, mistakenly, Gurobi is not installed on that one I used for this problem.

After I installed it and ran the code, I received a message as below indicating that the problem is infeasible or unbounded. However, I get an output from the optimizer. Is this normal?

Message:
Optimize a model with 1629 rows, 750 columns and 2998 nonzeros
Coefficient statistics:
  Matrix range    [2e-05, 2e+01]
  Objective range [5e-05, 6e-01]
  Bounds range    [0e+00, 0e+00]
  RHS range       [6e+00, 2e+03]
Presolve removed 876 rows and 125 columns
Presolve time: 0.06s

Solved in 0 iterations and 0.06 seconds
Infeasible or unbounded model

Sonja Mars

unread,
Sep 26, 2016, 12:14:08 AM9/26/16
to gur...@googlegroups.com
Hi,

Yes, the output of the Gurobi optimizer is normal. You can change this following the instructions here:
http://www.gurobi.com/documentation/6.5/quickstart_windows/matlab_modifying_gurobi_pa.html

For more details you can also take a look here:
http://www.gurobi.com/documentation/6.5/refman/matlab_gurobi.html

And a complete list of Gurobi parameters can be found here:
http://www.gurobi.com/documentation/6.5/refman/parameters.html

Best regards,
Sonja


----
Dr. Sonja Mars
Gurobi Optimization - Technical Support







> --
>
> ---
> You received this message because you are subscribed to the Google Groups "Gurobi Optimization" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to gurobi+un...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages