Skip to main content

VRP problem with time constraints




  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    Did you have a look at the KB article How do I determine why my model is infeasible? This should help you find the source of your infeasibility.

  • Charitha Heendeniya

    Hi, thank you for the insight. I'm trying to use computeIIS, only including that particular constraint. From the documentation,

    "To give an example of when these attributes might be useful, consider the case where an initial model is known to be feasible, but it becomes infeasible after adding constraints or tightening bounds. If you are only interested in knowing which of the changes caused the infeasibility, you can force the unmodified bounds and constraints into the IIS. That allows the IIS algorithm to focus exclusively on the new constraints, which will often be substantially faster."

    Could you please give a small example of how I can force only a particular constraint to be checked? The information on IISConstrForce, unfortunately, is not very clear to me.

  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    You can force a particular constraint via setting the corresponding ISSQConstrForce attribute to 1. In your case this would look similar to

    Time constraint 
    cons = model.addConstrs(x[i, j] * (T[i] + time[i, j]) <= x[i, j] * T[j]
                   for i in trip_indices
                   for j in trip_indices)

    for i in trip_indices:
    for j in trip_indices:
    cons[i,i].ISSQConstrForce = 1

    Best regards, 


Please sign in to leave a comment.