Professional Documents
Culture Documents
• Select • Prod
x.prod(coeff) would contain term 2.0*var if
x[0,0] = var and coeff[0,0] = 2.0
Problem
Consider an LP problem as
where
Code of addVars
To write the formulation of the problem, use ‘*.lp’. Link to other file
format:
https://www.gurobi.com/documentation/9.5/refman/model_file_format
s.html#sec:FileFormats
Same Problem Using MVar
Results
of write()
Comparison of the Written File
Var MVar
Two indices for Var (the original definition). Only one index in MVar.
Var & MVar • Transfer Mvar to Var: tolist()
Use it directly by
https://www.gurobi.com/documenta
tion/9.5/quickstart_windows/cs_pyt
hon.html#section:Python