Skip to main content

Retriving dual values from relaxed MIP

Answered

Comments

2 comments

  • Ronald van der Velden
    Gurobi Staff Gurobi Staff

    Hi,

    You could simply change the variable type without impacting the bounds:

    import gurobipy as gp
    from gurobipy import GRB

    with gp.Model() as m:
        v = m.addVar(vtype=GRB.BINARY)
      m.update()
      print(v.LB, v.UB) # Shows 0,1
        v.VType = GRB.CONTINUOUS
      print(v.LB, v.UB) # Still shows 0,1

    Kind regards,
    Ronald

    0
  • Riley Clement
    Gurobi Staff Gurobi Staff

    Also, if using Python, Model.relax()

    0

Please sign in to leave a comment.