# quanghuyuet/social-golfer-problem architecture

> Architecture diagram of the GitHub repository quanghuyuet/social-golfer-problem, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/quanghuyuet/social-golfer-problem
- Repository: https://github.com/quanghuyuet/social-golfer-problem

## Overview

This repository solves Social Golfer Problem instances, with a SAT command-line workflow that builds a CNF, selects encodings, runs a SAT backend, decodes a schedule, and verifies it. It also contains CP/MIP solver modules and a benchmarking subsystem, but their connections to the SAT workflow are not shown in the sampled source. The README is empty; those broader capabilities are represented from the file tree, without asserting unverified calls.

Main entry points: [`solvers/sat/model.py`](https://github.com/quanghuyuet/social-golfer-problem/blob/main/solvers/sat/model.py) (SGP model), [`solvers/sat/solver.py`](https://github.com/quanghuyuet/social-golfer-problem/blob/main/solvers/sat/solver.py) (Solver API), [`solvers/sat/encodings/__init__.py`](https://github.com/quanghuyuet/social-golfer-problem/blob/main/solvers/sat/encodings/__init__.py) (Encoding registry), [`benchmark`](https://github.com/quanghuyuet/social-golfer-problem/tree/main/benchmark) (Benchmark suite)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sat["SAT solving"]
  node_cli["Solve CLI<br/>[main.py]"]
  node_model["SGP model<br/>[model.py]"]
  node_solver["Solver API<br/>[solver.py]"]
  node_kissat["Kissat wrapper<br/>[solver.py]"]
  node_pysat["PySAT wrapper<br/>[solver.py]"]
  node_verifier["Schedule verifier<br/>[verify.py]"]
end

subgraph group_encoding["SAT encodings"]
  node_c1["Group assignment"]
  node_c2["Group size"]
  node_c3["Pairing uniqueness<br/>[unique_pairings.py]"]
  node_registry["Encoding registry<br/>[__init__.py]"]
end

subgraph group_alternatives["Other solvers"]
  node_cp["CP solver modules"]
  node_mip["MIP solver modules"]
end

subgraph group_bench["Benchmarking"]
  node_benchmark["Benchmark suite"]
  node_dataset["Dataset<br/>[data.txt]"]
  node_results[("Result records")]
end

node_user(("CLI user"))

node_user -->|"runs"| node_cli
node_cli -->|"calls"| node_solver
node_solver -->|"builds"| node_model
node_model -->|"imports encoders"| node_registry
node_model -->|"encodes assignment"| node_c1
node_model -->|"encodes size"| node_c2
node_model -->|"encodes pairings"| node_c3
node_registry -->|"registers"| node_c1
node_registry -->|"registers"| node_c2
node_registry -->|"registers"| node_c3
node_solver -->|"dispatches"| node_kissat
node_solver -->|"dispatches"| node_pysat
node_solver -->|"verifies schedule"| node_verifier
node_benchmark -.->|"may read"| node_dataset
node_benchmark -.->|"may record"| node_results

click node_cli "https://github.com/quanghuyuet/social-golfer-problem/blob/main/main.py"
click node_model "https://github.com/quanghuyuet/social-golfer-problem/blob/main/solvers/sat/model.py"
click node_solver "https://github.com/quanghuyuet/social-golfer-problem/blob/main/solvers/sat/solver.py"
click node_c1 "https://github.com/quanghuyuet/social-golfer-problem/tree/main/solvers/sat/encodings/c1_unique_group"
click node_c2 "https://github.com/quanghuyuet/social-golfer-problem/tree/main/solvers/sat/encodings/c2_group_size"
click node_c3 "https://github.com/quanghuyuet/social-golfer-problem/blob/main/solvers/sat/encodings/c3_unique_pairings/unique_pairings.py"
click node_registry "https://github.com/quanghuyuet/social-golfer-problem/blob/main/solvers/sat/encodings/__init__.py"
click node_kissat "https://github.com/quanghuyuet/social-golfer-problem/blob/main/solvers/sat/solver.py"
click node_pysat "https://github.com/quanghuyuet/social-golfer-problem/blob/main/solvers/sat/solver.py"
click node_verifier "https://github.com/quanghuyuet/social-golfer-problem/blob/main/benchmark/verify.py"
click node_cp "https://github.com/quanghuyuet/social-golfer-problem/tree/main/solvers/cp"
click node_mip "https://github.com/quanghuyuet/social-golfer-problem/tree/main/solvers/mip"
click node_benchmark "https://github.com/quanghuyuet/social-golfer-problem/tree/main/benchmark"
click node_dataset "https://github.com/quanghuyuet/social-golfer-problem/blob/main/dataset/data.txt"
click node_results "https://github.com/quanghuyuet/social-golfer-problem/tree/main/results"

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_cli,node_model,node_solver,node_kissat,node_pysat,node_verifier,node_user toneBlue
class node_c1,node_c2,node_c3,node_registry toneAmber
class node_cp,node_mip toneMint
class node_benchmark,node_dataset,node_results toneRose
```

## Components

### SAT solving

- [Solve CLI](https://github.com/quanghuyuet/social-golfer-problem/blob/main/main.py): `main.py`
- [SGP model](https://github.com/quanghuyuet/social-golfer-problem/blob/main/solvers/sat/model.py): `solvers/sat/model.py`
- [Solver API](https://github.com/quanghuyuet/social-golfer-problem/blob/main/solvers/sat/solver.py): `solvers/sat/solver.py`
- [Kissat wrapper](https://github.com/quanghuyuet/social-golfer-problem/blob/main/solvers/sat/solver.py): `solvers/sat/solver.py`
- [PySAT wrapper](https://github.com/quanghuyuet/social-golfer-problem/blob/main/solvers/sat/solver.py): `solvers/sat/solver.py`
- [Schedule verifier](https://github.com/quanghuyuet/social-golfer-problem/blob/main/benchmark/verify.py): `benchmark/verify.py`

### SAT encodings

- [Group assignment](https://github.com/quanghuyuet/social-golfer-problem/tree/main/solvers/sat/encodings/c1_unique_group): `solvers/sat/encodings/c1_unique_group`
- [Group size](https://github.com/quanghuyuet/social-golfer-problem/tree/main/solvers/sat/encodings/c2_group_size): `solvers/sat/encodings/c2_group_size`
- [Pairing uniqueness](https://github.com/quanghuyuet/social-golfer-problem/blob/main/solvers/sat/encodings/c3_unique_pairings/unique_pairings.py): `solvers/sat/encodings/c3_unique_pairings/unique_pairings.py`
- [Encoding registry](https://github.com/quanghuyuet/social-golfer-problem/blob/main/solvers/sat/encodings/__init__.py): `solvers/sat/encodings/__init__.py`

### Other solvers

- [CP solver modules](https://github.com/quanghuyuet/social-golfer-problem/tree/main/solvers/cp): `solvers/cp`
- [MIP solver modules](https://github.com/quanghuyuet/social-golfer-problem/tree/main/solvers/mip): `solvers/mip`

### Benchmarking

- [Benchmark suite](https://github.com/quanghuyuet/social-golfer-problem/tree/main/benchmark): `benchmark`
- [Dataset](https://github.com/quanghuyuet/social-golfer-problem/blob/main/dataset/data.txt): `dataset/data.txt`
- [Result records](https://github.com/quanghuyuet/social-golfer-problem/tree/main/results): `results`

### Other components

- **CLI user**

## Connections

- CLI user → Solve CLI: runs (evidence: `main.py`)
- Solve CLI → Solver API: calls (evidence: `main.py`)
- Solver API → SGP model: builds (evidence: `solvers/sat/solver.py`)
- SGP model → Encoding registry: imports encoders (evidence: `solvers/sat/model.py`)
- SGP model → Group assignment: encodes assignment (evidence: `solvers/sat/model.py`)
- SGP model → Group size: encodes size (evidence: `solvers/sat/model.py`)
- SGP model → Pairing uniqueness: encodes pairings (evidence: `solvers/sat/model.py`)
- Encoding registry → Group assignment: registers (evidence: `solvers/sat/encodings/__init__.py`)
- Encoding registry → Group size: registers (evidence: `solvers/sat/encodings/__init__.py`)
- Encoding registry → Pairing uniqueness: registers (evidence: `solvers/sat/encodings/__init__.py`)
- Solver API → Kissat wrapper: dispatches (evidence: `solvers/sat/solver.py`)
- Solver API → PySAT wrapper: dispatches (evidence: `solvers/sat/solver.py`)
- Solver API → Schedule verifier: verifies schedule (evidence: `solvers/sat/solver.py`)
- Benchmark suite → Dataset: may read
- Benchmark suite → Result records: may record
