Status Code 0

233 views
Skip to first unread message

bShetty

unread,
Nov 13, 2015, 4:52:41 PM11/13/15
to Gurobi Optimization
Even though Gurobi correctly solves my problem, the status code is always 0.

I use int status = model.get(GRB_IntAttr_Status); to get the status. This is generally not a problem. However, I would like to know when my problem becomes infeasible and this is not possible as my status is 0.
I went through the documentation and I could not find anything about status code 0. I can run IIS and see the constraints when it is infeasible but status is 0 for all states.

Has anyone come across this issue?
Any help/suggestions is greatly appreciated.

Thanks,
BYS

Greg Glockner

unread,
Nov 13, 2015, 5:30:59 PM11/13/15
to gur...@googlegroups.com
There is no status code 0:

http://www.gurobi.com/documentation/6.5/refman/optimization_status_codes.html

To understand how to use the Status value, see a simple example such as lp from the examples subdirectory.

bShetty

unread,
Nov 13, 2015, 5:45:51 PM11/13/15
to Gurobi Optimization
Thank you. I know there is no status code 0 but I get this status code 0. I have seen and run the example code and they run fine. However when I use the same in my problem, I get 0 as status code.
As I said everything else works fine. It's just this status code quirkiness.

I can even attach my code if you would like to see.

Thanks again,
BYS

Kostja Siefen

unread,
Nov 16, 2015, 7:31:22 AM11/16/15
to Gurobi Optimization
Can you post a minimal example that prints 0?

int status = model.get(GRB_IntAttr_Status)
cout << status

bShetty

unread,
Nov 16, 2015, 11:55:17 AM11/16/15
to Gurobi Optimization
Thank you very much!

I have attached my test file along with the printscreen of status 0. My visual studio environment matches that given in the example file. I have /MTd selected in the run time library and the corresponding library file linked.

Thanks again!

BYS
examplecode.txt
status0.docx

Kostja Siefen

unread,
Nov 16, 2015, 12:18:11 PM11/16/15
to Gurobi Optimization
With Gurobi 6.5.0 (/MTd) and Visual Studio 2015 I cannot reproduce this. Your example gives status = 2 (OPTIMAL) like it should (see attached screenshot).
Can you give more information about your environment (Windows version, Visual Studio version, Gurobi version)?

Best wishes, 
Kostja
status2.png

bShetty

unread,
Nov 16, 2015, 1:16:59 PM11/16/15
to Gurobi Optimization
Windows 7 enterprise and Visual studio 2012. I have Gurobi 6.5. The interesting part is that when I paste my code to the example file, it gives the correct output. The problem arises when I try to run using my existing project.
As you can see, it solves the problem but gives wrong status. 
Thanks,
BYS

Kostja Siefen

unread,
Nov 16, 2015, 1:23:08 PM11/16/15
to Gurobi Optimization
Can you compare the Visual Studio project and solution files (i.e. look for differences between the example project and your project)?

Best wishes,
Kostja

Kostja Siefen

unread,
Nov 16, 2015, 1:48:05 PM11/16/15
to Gurobi Optimization
Please make sure you don't mix different versions or debug compiles with optimized libraries and that you use the right .lib file(s). With /MTd on Visual Studio 2012 you should have a linker dependency on gurobi_c++mtd2012.lib and gurobi65.lib.To check this please look at your project properties ("Linker" >> "Input").

Best wishes,
Kostja

Bhupesh Shetty

unread,
Nov 16, 2015, 5:08:44 PM11/16/15
to gur...@googlegroups.com
Thank you so much for taking time to help me debug this issue. The issue was with the header file! Even though I kept updating the library files, I forgot to update the corresponding gurobi_c++.h file!
Thanks again for solving this issue!

BYS

--

---
You received this message because you are subscribed to a topic in the Google Groups "Gurobi Optimization" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gurobi/hEo75rbThBc/unsubscribe.
To unsubscribe from this group and all its topics, 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