I read over the the method for penalty drop if solution is not feasible (e.g. total demand exceed total capacity) https://developers.google.com/optimization/routing/penalties
the example only takes account into one dimsion of constraint which is the vehicle capacity. Hence the disjunction method is added under the "add_capacity_constaint" method. If I have multiple constaints: weight limit, space limit, driving distance limit, driving time limit, and time window for each location, do I have to add the disjunction method multiple times to all of them?
I tested, if I just add disjunction under demand_callback, but the constraint violation happens in max driving distance, it won't work. If I further add below disjunction to "add_distance_constraint" method, it works to omit the locations far beyond the driving distance limit.
# Allow to drop nodes.
penalty = 1000
for node in range(1, len(data['distance_matrix'])):
routing.AddDisjunction([manager.NodeToIndex(node)], penalty)