Skip to main content

TypeError:object of type 'gurobipy.gurobipy.LinExpr' has no len()

Answered

Comments

3 comments

  • Official comment
    Simranjit Kaur
    • Gurobi Staff
    This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?.
  • Eli Towle
    • Gurobi Staff

    The min_() helper function takes a list of Var objects and/or constants as arguments. Both of the arguments in your example are LinExpr objects.

    To resolve the issue, add auxiliary variables to the model and set them equal to the linear expressions passed as arguments to the min_() function. Then, pass the corresponding Var objects as arguments to min_() instead.

    0
  • FEI XUE
    • Gurobi-versary
    • Conversationalist
    • Curious

    Mr. Towle

    thank you for your reply. I will try again.

    0

Post is closed for comments.