Expand description
KSG weighted square lattice gadgets for resolving crossings.
This module contains weighted gadget implementations for the King’s SubGraph (KSG) weighted mapping. Each weighted gadget implements the Pattern trait directly with actual weight methods, following Julia’s formula: mis_overhead(weighted) = mis_overhead(unweighted) * 2.
Structs§
- Weighted
KsgBranch - Weighted branch gadget for T-junctions.
- Weighted
KsgBranch Fix - Weighted branch fix gadget for simplifying branches.
- Weighted
KsgBranch FixB - Weighted alternate branch fix gadget.
- Weighted
KsgCross - Weighted crossing gadget for resolving two crossing copy-lines.
- Weighted
KsgDangling Leg - Weighted dangling leg simplifier pattern.
- Weighted
KsgEnd Turn - Weighted end turn gadget for line terminations.
- Weighted
KsgT Con - Weighted T-connection gadget.
- Weighted
KsgTape Entry - A tape entry recording a weighted gadget application.
- Weighted
KsgTrivial Turn - Weighted trivial turn gadget for simple diagonal turns.
- Weighted
KsgTurn - Weighted turn gadget for 90-degree turns in copy-lines.
- Weighted
KsgW Turn - Weighted W-shaped turn gadget.
Enums§
- Weighted
KsgPattern - Enum wrapping all weighted KSG square lattice patterns for dynamic dispatch during unapply.
Traits§
- Weighted
KsgPattern Boxed - Trait for boxed weighted pattern operations.
Functions§
- apply_
weighted_ crossing_ gadgets - Apply all weighted crossing gadgets to the grid.
- apply_
weighted_ gadget - Apply a weighted gadget pattern at position (i, j) with proper weights. Uses mapped_graph locations and mapped_weights for each node.
- apply_
weighted_ simplifier_ gadgets - Apply weighted simplifier gadgets (WeightedKsgDanglingLeg variants).
- map_
config_ back_ pattern - Map configuration back through a single gadget.
- weighted_
tape_ entry_ mis_ overhead - Calculate MIS overhead for a weighted tape entry.
Type Aliases§
- Source
Graph - Type alias for source graph representation: (locations, pin_edges, source_pins).