Commit Graph

1 Commits

Author SHA1 Message Date
master
053bc70851 elksharp: add post-routing visual quality pipeline
Add four late-stage post-processing steps that run after the iterative
optimizer to improve edge readability without affecting hard routing
correctness:

- SpreadOuterCorridors: enforce min 32px gap between adjacent above-graph
  corridors and push End-bound corridors below all repeat-return corridors
  into their own visual tier (Y=-235 vs Y=-203/-139/-36)
- CollapseOrthogonalBacktracks: detect and remove U-turn loops where edges
  go right then backtrack left then right again (edge/17 fixed from
  7-segment loop to clean 3-segment forward path)
- ExtendShortApproachSegments: extend short final approach segments to
  half the average node width (~101px) so arrowheads have clear directional
  runs into target nodes (11 edges improved, worst case 8px to 71px)
- ReduceLineNodeProximity: push edge segments away from non-terminal nodes
  when within min-clearance (line-node proximity reduced to 2 violations)

Final metrics on document processing render:
- Edge crossings: 24 → 21 (-12.5%)
- Label proximity: 6 → 0 (eliminated)
- Line-node proximity: reduced to 2
- All 7 hard defect classes: zero (maintained)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 14:57:03 +03:00