Add star-topology layout optimization for single-module diagrams

Three-pass optimization eliminates cable crossings:
1. Order boundary components by average header pin position
2. Regroup header pins by boundary component (reduces inter-cable crossings)
3. Reorder boundary component pins to parallel header (eliminates within-cable
   crossings)

Safety hardening from Apollo review:
- Duplicate header pin deduplication (prevents silent mapping corruption)
- Connection structure validation at entry
- Fan-out averaging for component pins connected to multiple header pins
- Explicit ValueError on pin remapping failures with diagnostic context

145 tests passing (was 130).
This commit is contained in:
Ryan Malloy 2026-02-13 03:07:50 -07:00
parent b8ff2d19da
commit c2197f6fe6
3 changed files with 482 additions and 3 deletions

View file

@ -20,8 +20,8 @@ connectors:
J2:
type: SIG_CONN
pinlabels:
- SIGNAL_IN
- VOUT
- SIGNAL_IN
notes: 'SPICE ref: J2, nets: SIGNAL_IN, VOUT'
TP1:
type: TP
@ -63,5 +63,5 @@ connections:
- 1
- 2
- J2:
- 2
- 1
- 2