Skip to main content

problemreductions/rules/unitdiskmapping/triangular/
mod.rs

1//! Triangular lattice mapping module.
2//!
3//! Maps arbitrary graphs to weighted triangular lattice graphs.
4//!
5//! # Example
6//!
7//! ```rust,ignore
8//! use problemreductions::rules::unitdiskmapping::triangular;
9//!
10//! let edges = vec![(0, 1), (1, 2), (0, 2)];
11//! let result = triangular::map_weighted(3, &edges).unwrap();
12//! ```
13
14pub mod gadgets;
15pub mod mapping;
16
17pub use super::weighted::{map_weights, trace_centers};
18pub use gadgets::{
19    apply_crossing_gadgets, apply_simplifier_gadgets, tape_entry_mis_overhead, SourceCell,
20    WeightedTriBranch, WeightedTriBranchFix, WeightedTriBranchFixB, WeightedTriCross,
21    WeightedTriEndTurn, WeightedTriTConDown, WeightedTriTConLeft, WeightedTriTConUp,
22    WeightedTriTapeEntry, WeightedTriTrivialTurnLeft, WeightedTriTrivialTurnRight, WeightedTriTurn,
23    WeightedTriWTurn, WeightedTriangularGadget,
24};
25pub use mapping::{
26    map_config_back, map_unit_weights, map_weighted, map_weighted_with_method,
27    map_weighted_with_order,
28};
29
30/// Spacing between copy lines for triangular mapping.
31pub const SPACING: usize = 6;
32
33/// Padding around the grid for triangular mapping.
34pub const PADDING: usize = 2;