|
9 | 9 | class AbstractWalkModelDiGraph(ABC): |
10 | 10 | # storing some defaults |
11 | 11 | optimize_with_safe_sequences = True |
12 | | - optimize_with_safe_sequences_allow_geq_constraints = True |
| 12 | + optimize_with_safe_sequences_allow_geq_constraints = False |
13 | 13 | # TODO: optimize_with_subset_constraints_as_safe_sequences = True |
14 | 14 | optimize_with_safety_as_subset_constraints = False |
15 | 15 | optimize_with_max_safe_antichain_as_subset_constraints = False |
@@ -365,12 +365,13 @@ def _apply_safety_optimizations(self): |
365 | 365 | # print("Fixing variables for safe list #", i) |
366 | 366 | # iterate over the edges in the safe list to fix variables to 1 |
367 | 367 | for u, v in self.walks_to_fix[i]: |
368 | | - if self.G._is_scc_edge(u, v) and self.optimize_with_safe_sequences_allow_geq_constraints: |
369 | | - self.solver.add_constraint( |
370 | | - self.edge_vars[(u, v, i)] >= 1, |
371 | | - name=f"safe_list_u={u}_v={v}_i={i}", |
372 | | - ) |
373 | | - self.solve_statistics["edge_variables>=1"] += 1 |
| 368 | + if self.G._is_scc_edge(u, v): |
| 369 | + if self.optimize_with_safe_sequences_allow_geq_constraints: |
| 370 | + self.solver.add_constraint( |
| 371 | + self.edge_vars[(u, v, i)] >= 1, |
| 372 | + name=f"safe_list_u={u}_v={v}_i={i}", |
| 373 | + ) |
| 374 | + self.solve_statistics["edge_variables>=1"] += 1 |
374 | 375 | else: |
375 | 376 | self.solver.add_constraint( |
376 | 377 | self.edge_vars[(u, v, i)] == 1, |
|
0 commit comments