Skip to content

Commit

Permalink
metromap: reduce unnecessary constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
Marika-K committed Jun 20, 2024
1 parent 646f50d commit 02263ca
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions src/gurobi_optimods/metromap.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,38 +557,22 @@ def _compute_bends(graph, model, edge_direction, obj, linepaths, penalty_line_be
bend[w1, u1, w2, 0] = model.addVar(
vtype="B", name=f"bends[{w1},{u1},{w2},0]"
)
bend[w2, u1, w1, 0] = model.addVar(
vtype="B", name=f"bends[{w2},{u1},{w1},0]"
)
bend[w1, u1, w2, 1] = model.addVar(
vtype="B", name=f"bends[{w1},{u1},{w2},1]"
)
bend[w2, u1, w1, 1] = model.addVar(
vtype="B", name=f"bends[{w2},{u1},{w1},1]"
)
bend[w1, u1, w2, 2] = model.addVar(
vtype="B", name=f"bends[{w1},{u1},{w2},2]"
)
bend[w2, u1, w1, 2] = model.addVar(
vtype="B", name=f"bends[{w2},{u1},{w1},2]"
)
bend[w1, u1, w2, 3] = model.addVar(
vtype="B", name=f"bends[{w1},{u1},{w2},3]"
)
bend[w2, u1, w1, 3] = model.addVar(
vtype="B", name=f"bends[{w2},{u1},{w1},3]"
)
model.addConstr(
bend[w1, u1, w2, 0]
+ bend[w1, u1, w2, 1]
+ bend[w1, u1, w2, 2]
+ bend[w1, u1, w2, 3]
== 1
)
model.addConstrs(
bend[w1, u1, w2, k] == bend[w2, u1, w1, k] for k in range(4)
)

model.addConstrs(
bend[w1, u1, w2, 0]
>= (edge_direction[w1, u1, k] + edge_direction[u2, w2, k] - 1)
Expand Down

0 comments on commit 02263ca

Please sign in to comment.