# bruju/solveurdefutoshiki architecture

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

- Interactive diagram: https://gitdiagram.com/bruju/solveurdefutoshiki
- Repository: https://github.com/bruju/solveurdefutoshiki

## Overview

SolveurDeFutoshiki is a command-line Futoshiki constraint-satisfaction solver. The main workflow selects an algorithm and heuristic, loads a puzzle into a CSP, searches for a solution, then displays the grid and performance. The C implementation offers backtracking, forward checking, and deductive forward checking; a separate Java implementation uses Choco. The graph focuses on runtime components and documented capabilities. Some implementation details are unsampled, so uncertain connections are omitted rather than inferred.

Main entry points: [`principal.c`](https://github.com/bruju/solveurdefutoshiki/blob/master/principal.c) (CLI orchestration), [`gestHeuristique.c`](https://github.com/bruju/solveurdefutoshiki/blob/master/gestHeuristique.c) (Heuristic state management), [`lecture.c`](https://github.com/bruju/solveurdefutoshiki/blob/master/lecture.c) (Puzzle file reader), [`heuristique.c`](https://github.com/bruju/solveurdefutoshiki/blob/master/heuristique.c) (Variable heuristics)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["Command-line workflow"]
  node_entry["CLI orchestration<br/>[principal.c]"]
end

subgraph group_model["CSP model and input"]
  node_input["Puzzle file reader<br/>[lecture.c]"]
  node_csp["CSP representation<br/>[definitions.h]"]
  node_csp_lifecycle["CSP allocation<br/>[definitions.c]"]
end

subgraph group_search["Search and heuristics"]
  node_heuristic_registry["Heuristic selection<br/>[gestHeuristique.c]"]
  node_heuristics["Variable heuristics<br/>[heuristique.c]"]
  node_heuristic_state["Heuristic state management<br/>[gestHeuristique.c]"]
  node_backtracking["Backtracking search<br/>[resolution.c]"]
  node_forward_checking["Forward checking<br/>[resolution.c]"]
  node_deductive_fc["Deductive forward checking"]
end

subgraph group_results["Results and alternate solver"]
  node_display["Grid display<br/>[affichage.c]"]
  node_java_solver["Choco Java solver<br/>[Futoshiki.java]"]
end

node_user(("Solver user"))
node_choco["Choco library"]

node_user -->|"runs solver"| node_entry
node_entry -->|"loads puzzle"| node_input
node_input -->|"builds model"| node_csp
node_entry -->|"selects heuristic"| node_heuristic_registry
node_heuristic_registry -->|"registers heuristics"| node_heuristics
node_backtracking -->|"manages variables"| node_heuristic_state
node_forward_checking -->|"manages variables"| node_heuristic_state
node_deductive_fc -->|"manages variables"| node_heuristic_state
node_heuristics -->|"uses variable state"| node_heuristic_state
node_entry -->|"dispatches"| node_backtracking
node_entry -->|"dispatches"| node_forward_checking
node_entry -->|"dispatches"| node_deductive_fc
node_entry -->|"prints grid"| node_display
node_entry -->|"frees model"| node_csp_lifecycle
node_user -->|"runs Java API"| node_java_solver
node_java_solver -.->|"solves with"| node_choco

click node_entry "https://github.com/bruju/solveurdefutoshiki/blob/master/principal.c"
click node_input "https://github.com/bruju/solveurdefutoshiki/blob/master/lecture.c"
click node_csp "https://github.com/bruju/solveurdefutoshiki/blob/master/definitions.h"
click node_csp_lifecycle "https://github.com/bruju/solveurdefutoshiki/blob/master/definitions.c"
click node_heuristic_registry "https://github.com/bruju/solveurdefutoshiki/blob/master/gestHeuristique.c"
click node_heuristics "https://github.com/bruju/solveurdefutoshiki/blob/master/heuristique.c"
click node_heuristic_state "https://github.com/bruju/solveurdefutoshiki/blob/master/gestHeuristique.c"
click node_backtracking "https://github.com/bruju/solveurdefutoshiki/blob/master/resolution.c"
click node_forward_checking "https://github.com/bruju/solveurdefutoshiki/blob/master/resolution.c"
click node_deductive_fc "https://github.com/bruju/solveurdefutoshiki/blob/master/resolutionDeductive.c"
click node_display "https://github.com/bruju/solveurdefutoshiki/blob/master/affichage.c"
click node_java_solver "https://github.com/bruju/solveurdefutoshiki/blob/master/Futoshiki.java"

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_entry,node_user toneBlue
class node_input,node_csp,node_csp_lifecycle toneAmber
class node_heuristic_registry,node_heuristics,node_heuristic_state,node_backtracking,node_forward_checking,node_deductive_fc toneMint
class node_display,node_java_solver toneRose
class node_choco toneIndigo
```

## Components

### Command-line workflow

- [CLI orchestration](https://github.com/bruju/solveurdefutoshiki/blob/master/principal.c): `principal.c`

### CSP model and input

- [Puzzle file reader](https://github.com/bruju/solveurdefutoshiki/blob/master/lecture.c): `lecture.c`
- [CSP representation](https://github.com/bruju/solveurdefutoshiki/blob/master/definitions.h): `definitions.h`
- [CSP allocation](https://github.com/bruju/solveurdefutoshiki/blob/master/definitions.c): `definitions.c`

### Search and heuristics

- [Heuristic selection](https://github.com/bruju/solveurdefutoshiki/blob/master/gestHeuristique.c): `gestHeuristique.c`
- [Variable heuristics](https://github.com/bruju/solveurdefutoshiki/blob/master/heuristique.c): `heuristique.c`
- [Heuristic state management](https://github.com/bruju/solveurdefutoshiki/blob/master/gestHeuristique.c): `gestHeuristique.c`
- [Backtracking search](https://github.com/bruju/solveurdefutoshiki/blob/master/resolution.c): `resolution.c`
- [Forward checking](https://github.com/bruju/solveurdefutoshiki/blob/master/resolution.c): `resolution.c`
- [Deductive forward checking](https://github.com/bruju/solveurdefutoshiki/blob/master/resolutionDeductive.c): `resolutionDeductive.c`

### Results and alternate solver

- [Grid display](https://github.com/bruju/solveurdefutoshiki/blob/master/affichage.c): `affichage.c`
- [Choco Java solver](https://github.com/bruju/solveurdefutoshiki/blob/master/Futoshiki.java): `Futoshiki.java`

### Other components

- **Solver user**
- **Choco library**

## Connections

- Solver user → CLI orchestration: runs solver (evidence: `README.md`)
- CLI orchestration → Puzzle file reader: loads puzzle (evidence: `principal.c`)
- Puzzle file reader → CSP representation: builds model
- CLI orchestration → Heuristic selection: selects heuristic (evidence: `principal.c`)
- Heuristic selection → Variable heuristics: registers heuristics (evidence: `gestHeuristique.c`)
- Backtracking search → Heuristic state management: manages variables (evidence: `resolution.c`)
- Forward checking → Heuristic state management: manages variables (evidence: `resolution.c`)
- Deductive forward checking → Heuristic state management: manages variables (evidence: `resolutionDeductive.c`)
- Variable heuristics → Heuristic state management: uses variable state (evidence: `heuristique.c`)
- CLI orchestration → Backtracking search: dispatches (evidence: `principal.c`)
- CLI orchestration → Forward checking: dispatches (evidence: `principal.c`)
- CLI orchestration → Deductive forward checking: dispatches (evidence: `principal.c`)
- CLI orchestration → Grid display: prints grid (evidence: `principal.c`)
- CLI orchestration → CSP allocation: frees model (evidence: `principal.c`)
- Solver user → Choco Java solver: runs Java API (evidence: `README.md`)
- Choco Java solver → Choco library: solves with (evidence: `README.md`)
