Tobias Achterberg
unread,Feb 6, 2019, 5:23:05 AM2/6/19Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to gur...@googlegroups.com
Memory consumption in Gurobi is mainly driven by the non-zero elements in the constraint
matrix. To define the problem, Gurobi stores the model only in column-wise format. This
means, that each non-zero consumes 12 bytes: 4 bytes for the row index, 8 bytes for the
coefficient value.
When Gurobi goes into presolve, it needs a different and more flexible data structure to
represent the problem, and it needs a column- and a row-wise representation of the model.
This means, that each non-zero consumes about 32 bytes.
After presolve is done, the presolved model is represented again in the regular
column-wise form (12 bytes per non-zero) and the presolve data structures are discarded.
But for the solving process, Gurobi also needs a row-wise representation (another 12 bytes
per non-zero). Moreover, each parallel thread (including the master thread) needs a copy
of the model for solving LP relaxations, again with a (partial) row-wise representation.
This means another T*24 bytes, with T being the number of threads. Finally, for solving
the LP relaxation with the simplex algorithm, one needs memory to store the LU
factorization of the basis matrix. The number of non-zeros in this LU factorization
heavily depend on the structure of the model and the selection of columns in the current
basis.
So, as a summary, we have:
model construction: 12 bytes per non-zero
presolve: +32 bytes per non-zero, discarded after presolve is done
solving: +24*(T+1) bytes per non-zero + T*(size of LU factoruzation)
Regards,
Tobias