Conflict Concern with Conditional Battery Update Constraints for Drone-Only and Drone-with-Vehicle Scenarios in Gurobi Model
AnsweredI’m working on an optimization model that coordinates drones and vehicles for a pickup and delivery task. The model includes two constraints for updating the drone’s battery level[j, d] when it moves between nodes i and j. The constraints differ depending on whether the drone travels alone or follows a vehicle to recharge while moving. However, I’m concerned that both constraints might be active simultaneously when D[i, j, d] = 1, which could cause a conflict. Here are the constraints.
1. Battery update for solo drone travel
-
battery_level[j, d] <= battery_level[i, d] - e * time_drone[i, j] + M * (1 - D[i, j, d]
2. Battery update for drone following vehicle(charging)
battery_level[j, d] >= battery_level[i, d] + e * time_vehicle[i, j] - M * (2 - D[i, j, d] - X[i, j, v])
Since both constraints involve D[i, j, d]
, I am worried about unintended overlap or conflict in updating battery_level[j, d]
.
Would there be a recommended approach to structure these constraints so that only the appropriate one is enforced based on whether the drone is traveling solo or with a vehicle?
Thank you for your help and guidance!
-
Hi Dong Hyun Kim,
Is this fundamentally different from your other question:
https://support.gurobi.com/hc/en-us/community/posts/29709781064465-Proper-way-to-use-big-M-method
If not I'll remove the older one.
- Riley
0 -
It’s kind of different questions. Thanks for the commet :)
0 -
Hi,
whether the drone is traveling solo or with a vehicle
You will need a binary variable, perhaps two, to distinguish between these cases. Do you have such variables defined already in your model?
- Riley
0 -
Oh, I do have a binary variable that indicates whether the drone is traveling alongside the vehicle.
for i in range(2 * num_orders + 2):
for j in range(2 * num_orders + 2):
model.addConstrs((D[i, j, d] + X[i, j, v] >= 2 - M * (1 - bin_charging[i, j, d])
for d in range(drone) for v in range(vehicle)))
model.addConstrs((D[i, j, d] + X[i, j, v] <= 2 + M * bin_charging[i, j, d]
for d in range(drone) for v in range(vehicle)))0 -
Ok, can you introduce it into your constraints with a big M coefficient so that the appropriate constraint is redundant if this binary variable indicates the constraint shouldn't apply?
0 -
Ah, I see! Would it look something like this?
-
battery_level[j, d] <= battery_level[i, d] - e * time_drone[i, j] + M * (1 - D[i, j, d] + M*bin_charging(i, j, d)
0 -
-
Yeh I think that looks right
0 -
Thank you so much!
0
Please sign in to leave a comment.
Comments
8 comments