Skip to main content

X-Variants (size_t) of GRBaddconstrs and GRBaddvars in C-API

Answered

Comments

3 comments

  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    Hi Thomas,

    if I have a model with a total of more than 2 billion non-zero values, even though I do not add more than 2 billion non-zero values in a single function call,

    or only if I add more than 2 billion non-zero values in a single function call?

    If you construct your model in < 2 billion non-zero chunks, you can do so with the regular C API functions. The X functions are there for calls with more than 2 billion non-zeros in one call.

    Also, I would like to ask if it is possible to build a model with more than 2 billion variables? In the X-variants of the functions, "numvars" and "*vind" only are int and not size_t.

    It is not possible. Currently the limit is set to 2 bil variables (and 2 bil constraints).

    Best regards, 
    Jaromił

     

    0
  • Thomas Leveringhaus
    Collaborator
    Investigator
    Gurobi-versary

    Hello Jaromił,

    thanks for your helpful answer.

    I can work with the limit on the number of variables at the moment by doing some variable eliminations myself, which I would have preferred to leave to Presolve and which has the disadvantage that I have more non-zero elements in total.
    My actual computing limit at the moment is 500 GB of RAM anyway. However, future computing servers will have more RAM. Is Gurobi planning to change the "numvars" to size_t in future releases?

    Kind regards

    Thomas

    0
  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    Hi Thomas,

    However, future computing servers will have more RAM. Is Gurobi planning to change the "numvars" to size_t in future releases?

    Currently, applications with this vast number of variables and constraints are very rare. But once the number of applications with huge variable and constraint numbers increase, we will definitely consider allowing for more variables and constraints in the future.

    Best regards, 
    Jaromił

    0

Please sign in to leave a comment.