Skip to main content

Conflict Concern with Conditional Battery Update Constraints for Drone-Only and Drone-with-Vehicle Scenarios in Gurobi Model

Answered

Comments

8 comments

  • Riley Clement
    Gurobi Staff Gurobi Staff

    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
  • Dong Hyun Kim
    Conversationalist
    First Question

    It’s kind of different questions. Thanks for the commet :)

    0
  • Riley Clement
    Gurobi Staff Gurobi Staff

    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
  • Dong Hyun Kim
    Conversationalist
    First Question

    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
  • Riley Clement
    Gurobi Staff Gurobi Staff

    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
  • Dong Hyun Kim
    Conversationalist
    First Question

    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
  • Riley Clement
    Gurobi Staff Gurobi Staff

    Yeh I think that looks right

    0
  • Dong Hyun Kim
    Conversationalist
    First Question

    Thank you so much!

     

    0

Please sign in to leave a comment.