Module gadgets_weighted

Module gadgets_weighted 

Source
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§

WeightedKsgBranch
Weighted branch gadget for T-junctions.
WeightedKsgBranchFix
Weighted branch fix gadget for simplifying branches.
WeightedKsgBranchFixB
Weighted alternate branch fix gadget.
WeightedKsgCross
Weighted crossing gadget for resolving two crossing copy-lines.
WeightedKsgDanglingLeg
Weighted dangling leg simplifier pattern.
WeightedKsgEndTurn
Weighted end turn gadget for line terminations.
WeightedKsgTCon
Weighted T-connection gadget.
WeightedKsgTapeEntry
A tape entry recording a weighted gadget application.
WeightedKsgTrivialTurn
Weighted trivial turn gadget for simple diagonal turns.
WeightedKsgTurn
Weighted turn gadget for 90-degree turns in copy-lines.
WeightedKsgWTurn
Weighted W-shaped turn gadget.

Enums§

WeightedKsgPattern
Enum wrapping all weighted KSG square lattice patterns for dynamic dispatch during unapply.

Traits§

WeightedKsgPatternBoxed
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§

SourceGraph
Type alias for source graph representation: (locations, pin_edges, source_pins).