Skip to main content

How to represent the sum of binary variables ?

Answered

Comments

2 comments

  • Riley Clement
    • Gurobi Staff

    Hi,

    This looks sort of correct to me.

    You are creating TempConstr objects and then adding them to some constraint_scheduling object.  Generally you would add use addConstr( ) to add these TempConstr objects to the model.

    I guess it is possible you have created a constraint_scheduling object where the add operator appends these TempConstr to a list, and these TempConstr are added to the model later, but it seems more likely that a LLM has given you code that is a mixture of gurobipy and some other 3rd party framework.

    - Riley

    0
  • k k
    • First Comment
    • First Question

    Thank you,I have already found out where the problem lies.

    0

Please sign in to leave a comment.