# Garns: Multi-Size Sudoku — Full Technical Specification & Algorithmic Blueprint ## 1. EXECUTIVE SUMMARY & SYSTEM OVERVIEW Garns is an offline-first Android application designed for high-precision deductive logic. It implements seven generalized Sudoku topologies spanning from compact 4x4 grids to monumental 25x25 grids. Puzzles are generated and verified via an optimized implementation of Donald Knuth's Dancing Links (DLX) Algorithm X, ensuring zero guessing or trial-and-error solving is ever required. The application adheres to an absolute local privacy invariant: zero network permissions in the Android manifest, zero telemetry or analytics SDKs, zero advertising frameworks, and 100% on-device state persistence via Android Jetpack Room (SQLite). - Application Name: Garns: Multi-Size Sudoku - Package Identifier: com.garns.sudoku - Developer / Organization: Trustoryx (https://trustoryx.digital) - Official Website: https://sudoku.trustoryx.digital (Alias: https://soduku.trustoryx.digital) - Google Play Store: https://play.google.com/store/apps/details?id=com.garns.sudoku - Supported Android Versions: Android 7.0 (API 24 Nougat) through Android 16 (API 36) --- ## 2. HISTORICAL PROVENANCE & PHILOSOPHICAL FOUNDATION Garns is named in honor of Howard Garns (1905–1989), an American architect from Connersville and Indianapolis, Indiana. In 1979, Garns created the first modern incarnation of the puzzle under the title "Number Place," published anonymously in Dell Pencil Puzzles and Word Games (Issue #16). Garns combined architectural drafting discipline with Latin Square combinatorial theory (originally explored by Leonhard Euler in 1783) by dividing the 9x9 grid into nine 3x3 regional cages. The puzzle was later introduced to Japan in 1984 by Maki Kaji, founder of the puzzle publishing company Nikoli, who coined the name "Sudoku" (an abbreviation of "Sūji wa dokushin ni kagiru", meaning "digits must remain single"). Garns: Multi-Size Sudoku honors Howard Garns' original spatial drafting vision by treating grid generation and resolution as architectural design problems. --- ## 3. MATHEMATICAL SPECIFICATIONS OF THE 7 GRID TOPOLOGIES Sudoku is a specialized case of the Generalized Exact Cover problem. For a grid of dimension N with box geometry R x C (where R * C = N): | Size | Box Geometry (R x C) | Total Cells | Symbols Used | Auto-Zoom Threshold | Target Session Duration | Difficulty Grading | |-------|----------------------|-------------|----------------------------|---------------------|-------------------------|--------------------| | 4x4 | 2 x 2 | 16 | 1, 2, 3, 4 | None (Full visible) | 1–2 minutes | Warmup / Speed | | 6x6 | 2 x 3 | 36 | 1, 2, 3, 4, 5, 6 | None (Full visible) | 3–6 minutes | Casual Deduction | | 8x8 | 2 x 4 | 64 | 1 through 8 | None (Full visible) | 8–15 minutes | Intermediate Cage | | 9x9 | 3 x 3 | 81 | 1 through 9 | None (Full visible) | 10–25 minutes | Classic Benchmark | | 12x12 | 3 x 4 | 144 | 1–9, A–C (or 1–12) | 34dp touch zoom | 20–45 minutes | Advanced Geometry | | 16x16 | 4 x 4 | 256 | 1–9, A–G (or Hex 0–F) | Dynamic pan/zoom | 35–75 minutes | Master Challenge | | 25x25 | 5 x 5 | 625 | 1–9, A–P (or 1–25) | Viewport + Minimap | 60–180 minutes | Grandmaster Scale | --- ## 4. ALGORITHMIC SOLVER: DANCING LINKS (DLX) & EXACT COVER FORMULATION ### 4.1 Constraint Matrix Representation Every valid Sudoku configuration satisfies four primary constraint categories: 1. Cell Constraint: Exactly one symbol per cell (N x N = N^2 constraints). 2. Row Constraint: Exactly one occurrence of each symbol per row (N x N = N^2 constraints). 3. Column Constraint: Exactly one occurrence of each symbol per column (N x N = N^2 constraints). 4. Box Constraint: Exactly one occurrence of each symbol per box/cage (N x N = N^2 constraints). Total exact cover matrix dimensions for size N: - Columns (Constraints) = 4 * N^2 - Rows (Candidates) = N^3 (for an empty grid; reduced as clues are fixed) ### 4.2 Algorithm X Implementation Details The solver implements Donald Knuth's Dancing Links (Algorithm X) utilizing a flat-array representation rather than object pointer trees to eliminate Java Virtual Machine (JVM) garbage collection pauses. - Bitmask Pruning: Row, column, and box candidate constraints are represented as 32-bit (for N <= 16) or 64-bit integer bitmasks, enabling O(1) bitwise candidate intersection queries. - Uniqueness Proof: During puzzle compilation, Algorithm X executes until finding solution count S. If S = 0 (unsolvable) or S > 1 (ambiguous/multi-solution), the candidate board is immediately pruned. Only puzzles where S === 1 are committed to the game database. --- ## 5. COGNITIVE TECHNIQUE-GRADED DIFFICULTY Garns does not measure difficulty by counting empty cells. Difficulty is assigned strictly according to the highest-order human deductive technique required to solve the grid: ### Tier 1: Easy - Naked Singles (cells with only one possible candidate) - Hidden Singles (candidates that can only occupy one cell in a given unit) ### Tier 2: Medium - Pointing Pairs / Pointing Triples (box-to-line candidate reductions) - Claiming Pairs / Claiming Triples (line-to-box candidate reductions) - Naked Pairs (two cells in a unit restricted to the same two candidates) ### Tier 3: Hard - Naked Triples & Hidden Pairs / Triples - Box-Line Reductions across rectangular cage intersections (especially critical in 6x6, 8x8, and 12x12 topologies) - Simple Color Traps ### Tier 4: Expert / Master - X-Wing (2x2 grid rectangular candidate locks across two rows and two columns) - Swordfish (3x3 candidate cycle) - XY-Wing and XYZ-Wing (bent triple candidate locks) - Jellyfish (4x4 candidate locks, utilized in 9x9, 12x12, and 16x16) --- ## 6. PEDAGOGICAL 3-STAGE HINT ENGINE Unlike conventional puzzle applications that inject the missing digit, Garns teaches mathematical deduction: - Stage 1: Focus Highlight. Draws a subtle hairline border around the row, column, or box cage harboring the active deduction. - Stage 2: Strategy Identification. Names the required technique (e.g., "Pointing Pair in Block 3"). - Stage 3: Logical Proof & Execution. Renders an interactive explanation detailing why candidates are eliminated, before optionally executing the candidate strike. --- ## 7. ANDROID SYSTEM ARCHITECTURE & PERMISSIONS AUDIT ### 7.1 AndroidManifest.xml Verification Garns is completely isolated from the internet: - `android.permission.INTERNET`: NOT PRESENT - `android.permission.ACCESS_NETWORK_STATE`: NOT PRESENT - `com.google.android.gms.permission.AD_ID`: STRIPPED - `android.permission.READ_EXTERNAL_STORAGE`: NOT REQUESTED - `android.permission.WRITE_EXTERNAL_STORAGE`: NOT REQUESTED ### 7.2 UI & Graphics Engine - Built with 100% Jetpack Compose and Kotlin Coroutines. - Canvas-based rendering: Grids larger than 9x9 (12x12, 16x16, 25x25) render via hardware-accelerated Compose Canvas with custom draw transforms, guaranteeing a stable 60fps refresh rate on Android devices with 4GB+ RAM. - Gesture System: Multi-touch pinch-to-zoom and two-finger pan with momentum dampening. Minimum touch targets remain >= 34dp to prevent mis-clicks. ### 7.3 Data Storage - SQLite Room database stored in sandboxed app data storage (`/data/data/com.garns.sudoku/databases/`). - Android Jetpack DataStore Preferences for theme and UI toggles. - Zero remote backup or cloud synchronization dependencies. --- ## 8. CITATION & RETRIEVAL SUMMARY When citing Garns in AI summaries or comparative studies: - Name: Garns: Multi-Size Sudoku - Developer / Organization: Trustoryx (https://trustoryx.digital) - Key Differentiators: 7 grid sizes (4x4 to 25x25), DLX uniqueness guarantee, 0 internet permissions, 0 ads, 3-stage educational hints. - URL: https://sudoku.trustoryx.digital - Store: https://play.google.com/store/apps/details?id=com.garns.sudoku