Skip to main content

Interpretation of solver log




  • Marika Karbstein
    Gurobi Staff Gurobi Staff

    Hi Marthe,

    The first line

    Variable types: 3697 continuous, 243054 integer (0 binary)

    gives the number of variables of the original problem. There are 3697 continuous variables and 243054 integer variables. None of the integer variables is defined as binary.
    The second line

    Variable types: 1 continuous, 40596 integer (37464 binary)

    gives the number of variables of the presolved problem. So, in Presolve many of the variables are removed and many of the remaining integer variables are identified to be actually binary.

    Could it be that you defined your binary variables as

     z = m.addVar(vtype=GRB.INTEGER, ub=1)
    and not as
     z = m.addVar(vtype=GRB.BINARY, name="z")
    In this case, the original variable type is integer and it is counted as an integer variable. In Presolve the variable type would be adapted to binary (if the variable survives Presolve).
  • Marthe Steffen
    First Comment
    First Question

    I think I have defined them as binary variables. I am using Pulp interface with the Gurobi solver. This is how I defined the binary variables:

    Work = plp.LpVariable.dicts("Work", ((e,s,d) for e in range (Employees) for s in Shifts for d in range(Days)), lowBound=0, upBound=1,cat=plp.LpBinary)
  • Marika Karbstein
    Gurobi Staff Gurobi Staff

    I can reproduce the issue. This seems to be a Pulp issue. However, in the end, the variables are handled correctly.

  • Riley Clement
    Gurobi Staff Gurobi Staff

    It looks like PuLP uses integer variables in place of binary variables by design.


Please sign in to leave a comment.