Skip to main content

CVRP subtour elimination: Cannot convert MLinExpr to gurobipy.LinExpr

Answered

Comments

2 comments

  • David Torres Sanchez
    Gurobi Staff Gurobi Staff

    Hi,

    You can call the MVar.item() like:

    model.cbLazy(gp.quicksum(x[i,j].item() for i, j in combinations(tour_elem, 2)) - (len(tour_elem)-1) <= 0)

    Cheers,
    David

    2
  • Donghyeon Lee
    First Comment
    First Question

    It works! Thank you.

    1

Please sign in to leave a comment.