Skip to main content

How to constrain MILP to allow only one agent in an area at a time

Awaiting user input

Comments

2 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?.
  • Maliheh Aramon
    • Gurobi Staff

    Hi Sydney, 

    Could you please help me to better understand your question? You mentioned that you would like to add a constraint such that at most one agent is assigned to an area. Your constraint below defined over inregion binary decision variables guarantees that at most one agent is assigned to each region.

    problem.addConstr((gurobipy.quicksum(inregion[j,i] for j in range(agents_num))) <= 1) #agents_num)

    I am not sure which constraint does not work as you expect.

    It would be great if you could share a minimal reproducible working example of the issue you are describing above.

    Best regards,

    Maliheh

     

    0

Post is closed for comments.