--rollback: undo a rip-up that leaves fewer connections routed

The connections a rip-up route crosses are rerouted at once in free
space. If that leaves fewer connections routed than before, the new
route comes out and every displaced connection goes back on its old
path, with its rip count as it was. Even trades are kept.
This commit is contained in:
2026-09-28 14:54:29 -06:00
parent 35891c02ff
commit 3462089e09
6 changed files with 109 additions and 4 deletions
+2
View File
@@ -98,6 +98,7 @@ def route_board_exact(
seed: int | None = None,
route_first: frozenset | None = None,
access_cost: float = 0.0,
rollback: bool = False,
) -> ExactRouteResult:
"""Route ``board`` orthogonally and verify the result with exact geometry.
@@ -129,6 +130,7 @@ def route_board_exact(
seed=seed,
route_first=route_first,
access_cost=access_cost,
rollback=rollback,
)
edge = 0 if edge_clearance is None else edge_clearance
outline = board.outline