How can I read MST files from Gurobi command line?

626 views
Skip to first unread message

Pablito (Malaga, Spain)

unread,
Nov 12, 2010, 5:06:20 PM11/12/10
to Gurobi Optimization, pab...@lcc.uma.es
Dear group members:

I was wondering how to read MST files from Gurobi command line. I know
how
to proceed from Gurobi Interactive Shell, e.g.,

gurobi> m = read("c:\Gurobi400\win32\examples\data\Music08b.mps")
gurobi> m.optimize()
gurobi> m.reset()
gurobi> m.read("c:\Gurobi400\win32\examples\data\Music08b.mst")
gurobi> m.optimize()

but I don't know how to do it from the command line, because issuing

C:\Gurobi400\win32\bin> gurobi_cl ..\examples\data\Music08b.mps
..\examples\data\Music08b.mst > ..\examples\data\Music08b.out

does not work properly. Any help would be welcome :-).

Thank you very much in advance,
Pablo.
----------------------------------------------
Pablo Guerrero-Garcia (pab...@lcc.uma.es)
http://www.matap.uma.es/profesor/pablito
http://www.matap.uma.es/investigacion/tr.html
Dpt. Applied Mathematics, University of Malaga
Complejo Tecnologico, ETSI Telecomunicacion
Campus Teatinos s/n, 29071 Malaga (Spain)
----------------------------------------------

qiong jia

unread,
Nov 12, 2010, 8:38:12 PM11/12/10
to gur...@googlegroups.com
/*initialize the env/
GRBenv *env = NULL,
GRBmodel *m = NULL,

char *name=""c:\Gurobi400\win32\examples\data\Music08b.mps"" ;
int error = 0;

/* Read model */
error = GRBreadmodel(env, name, &m);
if (error) goto QUIT;

/* optimize model */
error = GRBoptimize(m);
if (error) goto QUIT;

//I hope it can help u, I use this to open the 'lp' files. i think it
is the same way to open the .mst files.
There are many such examples in the "examples" guidebook of Gurobi.
You can know more by referring to the examples in the
guidebook.(*^__^*)


2010/11/13, Pablito (Malaga, Spain) <pablo.guer...@gmail.com>:


--
贾琼 Qiong Jia
Intelligent System Design Lab
Information management engineering
Korea University

Mobile phone:+82-10-8340-1223
Lab:+82-02-3290-3872
Address: Intelligent System Design lab, Engineering building, Science
campus, Korea University,Anam-dong,Seoul,Korea
Zip code:139-713
E-mail: jiaqi...@gmail.com
MSN: jiaqio...@msn.com

Greg Glockner

unread,
Nov 12, 2010, 8:58:11 PM11/12/10
to gur...@googlegroups.com, pab...@lcc.uma.es
Can't be done with gurobi_cl but it's easy to do with the interactive shell or with the APIs, as you've noted.

Pablito (Malaga, Spain)

unread,
Nov 13, 2010, 1:38:12 PM11/13/10
to Gurobi Optimization
Dear group members:

Thank you very much for your accurate suggestions and quick answers. I
have just developed a Python script to perform the same task from
within the interactive shell:

for k in range(4,8+1):
setParam('ResultFile','c:\Gurobi400\win32\examples\data
\Music0'+str(k)+'bout.mst')
setParam('LogFile','c:\Gurobi400\win32\examples\data\Music0'+str(k)
+'.out')
m = read('c:\Gurobi400\win32\examples\data\Music0'+str(k)+'b.mps');
m.read('c:\Gurobi400\win32\examples\data\Music0'+str(k)+'b.mst')
m.optimize();
m.reset()
else:
print 'Whole computational work has been succesfully completed'

This Python script allows me to solve "Music04b.mps",
"Music05b.mps", ..., and "Music08b.mps", with MIP start taken from
files "Music0?b.mst", solutions in files "Music0?bout.mst" and screen
outputs redirected to files "Music0?b.out".

All my best,
Pablo.
----------------------------------------------
Pablo Guerrero-Garcia (pabl...@lcc.uma.es)
Reply all
Reply to author
Forward
0 new messages