# navv8/sudoku-solver architecture

> Architecture diagram of the GitHub repository navv8/sudoku-solver, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/navv8/sudoku-solver
- Repository: https://github.com/navv8/sudoku-solver

## Overview

This is a small Tkinter Sudoku application. The user enters a 9×9 puzzle, the GUI parses and checks it, then invokes the recursive backtracking solver and displays a solution when one is found. The solver searches for an empty cell and tests candidates against row, column, and box constraints. GUI behavior is documented in the excerpt; the graph does not infer additional capabilities or unsampled modules.

Main entry points: [`gui.py`](https://github.com/navv8/sudoku-solver/blob/main/gui.py) (GUI controller), [`solver.py`](https://github.com/navv8/sudoku-solver/blob/main/solver.py) (Backtracking solver)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("Puzzle user"))
node_gui["GUI controller<br/>[gui.py]"]
node_input["Board input<br/>[gui.py]"]
node_validation["Puzzle validation<br/>[gui.py]"]
node_solver["Backtracking solver<br/>[solver.py]"]
node_constraints["Constraint checks<br/>[solver.py]"]
node_empty["Empty-cell search<br/>[solver.py]"]
node_display["Result display<br/>[gui.py]"]

node_user -->|"enters puzzle"| node_gui
node_gui -->|"reads board"| node_input
node_gui -->|"validates puzzle"| node_validation
node_validation -->|"checks clues"| node_constraints
node_gui -->|"calls solve"| node_solver
node_solver -->|"finds cell"| node_empty
node_solver -->|"tests candidates"| node_constraints
node_gui -->|"fills solution"| node_display

click node_gui "https://github.com/navv8/sudoku-solver/blob/main/gui.py"
click node_input "https://github.com/navv8/sudoku-solver/blob/main/gui.py"
click node_validation "https://github.com/navv8/sudoku-solver/blob/main/gui.py"
click node_solver "https://github.com/navv8/sudoku-solver/blob/main/solver.py"
click node_constraints "https://github.com/navv8/sudoku-solver/blob/main/solver.py"
click node_empty "https://github.com/navv8/sudoku-solver/blob/main/solver.py"
click node_display "https://github.com/navv8/sudoku-solver/blob/main/gui.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_user,node_gui toneBlue
class node_input,node_validation,node_solver,node_constraints,node_empty,node_display toneTeal
```

## Components

### Other components

- **Puzzle user**
- [GUI controller](https://github.com/navv8/sudoku-solver/blob/main/gui.py): `gui.py`
- [Board input](https://github.com/navv8/sudoku-solver/blob/main/gui.py): `gui.py`
- [Puzzle validation](https://github.com/navv8/sudoku-solver/blob/main/gui.py): `gui.py`
- [Backtracking solver](https://github.com/navv8/sudoku-solver/blob/main/solver.py): `solver.py`
- [Constraint checks](https://github.com/navv8/sudoku-solver/blob/main/solver.py): `solver.py`
- [Empty-cell search](https://github.com/navv8/sudoku-solver/blob/main/solver.py): `solver.py`
- [Result display](https://github.com/navv8/sudoku-solver/blob/main/gui.py): `gui.py`

## Connections

- Puzzle user → GUI controller: enters puzzle (evidence: `README.md`)
- GUI controller → Board input: reads board (evidence: `gui.py`)
- GUI controller → Puzzle validation: validates puzzle (evidence: `gui.py`)
- Puzzle validation → Constraint checks: checks clues (evidence: `gui.py`)
- GUI controller → Backtracking solver: calls solve (evidence: `gui.py`)
- Backtracking solver → Empty-cell search: finds cell (evidence: `solver.py`)
- Backtracking solver → Constraint checks: tests candidates (evidence: `solver.py`)
- GUI controller → Result display: fills solution (evidence: `gui.py`)
