# drtanng26/bai-tap-gk-ttnt-nhom-3 architecture

> Architecture diagram of the GitHub repository drtanng26/bai-tap-gk-ttnt-nhom-3, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/drtanng26/bai-tap-gk-ttnt-nhom-3
- Repository: https://github.com/drtanng26/bai-tap-gk-ttnt-nhom-3

## Overview

MetaOpt-Bench is an optimization benchmarking and visualization application for simulated annealing on TSP and GTO on continuous problems, with Hill Climbing, PSO, GWO, and WOA as comparison algorithms. Users run experiments through the Streamlit dashboard or CLI, choose benchmark problems and algorithms, and inspect optimization results and plots; batch runs also produce statistical summaries. The graph includes README-documented capabilities where source excerpts are incomplete; edges are limited to relationships shown by excerpts, the source index, or the README.

Main entry points: [`app.py`](https://github.com/drtanng26/bai-tap-gk-ttnt-nhom-3/blob/main/app.py) (Streamlit Dashboard), [`src/core/base_problem.py`](https://github.com/drtanng26/bai-tap-gk-ttnt-nhom-3/blob/main/src/core/base_problem.py) (Problem Interface), [`src/core/base_optimizer.py`](https://github.com/drtanng26/bai-tap-gk-ttnt-nhom-3/blob/main/src/core/base_optimizer.py) (Optimizer Results), [`main_cli.py`](https://github.com/drtanng26/bai-tap-gk-ttnt-nhom-3/blob/main/main_cli.py) (Experiment CLI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User Interfaces"]
  node_dashboard["Streamlit Dashboard<br/>[app.py]"]
  node_cli["Experiment CLI<br/>[main_cli.py]"]
end

subgraph group_problem["Optimization Problems"]
  node_tsplib["TSPLIB Instances"]
  node_tsp["TSP Problem<br/>[tsp.py]"]
  node_continuous["Continuous SA Problem<br/>[continuous_sa.py]"]
  node_benchmarks["F1–F23 Benchmarks<br/>[benchmark_23.py]"]
  node_fm["FM Sound Problem<br/>[fm_sound.py]"]
end

subgraph group_algorithm["Optimization Algorithms"]
  node_sa["Simulated Annealing<br/>[sa.py]"]
  node_hill["Hill Climbing<br/>[hill_climbing.py]"]
  node_gto["GTO<br/>[gto.py]"]
  node_pso["PSO<br/>[pso.py]"]
  node_gwo["GWO<br/>[gwo.py]"]
  node_woa["WOA<br/>[woa.py]"]
end

subgraph group_shared["Optimization Core"]
  node_problem_base["Problem Interface<br/>[base_problem.py]"]
  node_optimizer_base["Optimizer Results<br/>[base_optimizer.py]"]
end

subgraph group_analysis["Experiment Analysis"]
  node_runner["Experiment Runner<br/>[runner.py]"]
  node_statistics["Run Statistics<br/>[statistics.py]"]
  node_visualizer["Plots and Tours<br/>[visualizer.py]"]
end

node_user(("User"))

node_user -->|"uses"| node_dashboard
node_user -->|"runs"| node_cli
node_dashboard -->|"creates"| node_tsp
node_dashboard -->|"runs"| node_sa
node_dashboard -->|"compares"| node_hill
node_dashboard -->|"runs"| node_gto
node_dashboard -->|"compares"| node_pso
node_dashboard -->|"compares"| node_gwo
node_dashboard -->|"compares"| node_woa
node_dashboard -->|"selects"| node_benchmarks
node_dashboard -->|"selects"| node_fm
node_dashboard -->|"displays"| node_visualizer
node_cli -->|"runs"| node_runner
node_cli -->|"summarizes"| node_statistics
node_cli -->|"generates plots"| node_visualizer
node_tsp -->|"reads instances"| node_tsplib
node_tsp -->|"implements"| node_problem_base
node_continuous -->|"implements"| node_problem_base
node_benchmarks -->|"implements"| node_problem_base
node_fm -->|"implements"| node_problem_base
node_sa -->|"evaluates"| node_problem_base
node_sa -->|"returns result"| node_optimizer_base
node_hill -->|"evaluates"| node_problem_base
node_hill -->|"returns result"| node_optimizer_base
node_gto -->|"evaluates"| node_problem_base
node_gto -->|"returns result"| node_optimizer_base
node_pso -->|"evaluates"| node_problem_base
node_pso -->|"returns result"| node_optimizer_base
node_gwo -->|"evaluates"| node_problem_base
node_gwo -->|"returns result"| node_optimizer_base
node_woa -->|"evaluates"| node_problem_base
node_woa -->|"returns result"| node_optimizer_base
node_runner -->|"accepts problems"| node_problem_base
node_runner -->|"uses results"| node_optimizer_base
node_visualizer -->|"plots results"| node_optimizer_base
node_visualizer -->|"plots tours"| node_tsp

click node_dashboard "https://github.com/drtanng26/bai-tap-gk-ttnt-nhom-3/blob/main/app.py"
click node_cli "https://github.com/drtanng26/bai-tap-gk-ttnt-nhom-3/blob/main/main_cli.py"
click node_tsplib "https://github.com/drtanng26/bai-tap-gk-ttnt-nhom-3/tree/main/data/tsplib"
click node_tsp "https://github.com/drtanng26/bai-tap-gk-ttnt-nhom-3/blob/main/src/problems/tsp.py"
click node_continuous "https://github.com/drtanng26/bai-tap-gk-ttnt-nhom-3/blob/main/src/problems/continuous_sa.py"
click node_benchmarks "https://github.com/drtanng26/bai-tap-gk-ttnt-nhom-3/blob/main/src/problems/benchmark_23.py"
click node_fm "https://github.com/drtanng26/bai-tap-gk-ttnt-nhom-3/blob/main/src/problems/fm_sound.py"
click node_sa "https://github.com/drtanng26/bai-tap-gk-ttnt-nhom-3/blob/main/src/algorithms/sa_branch/sa.py"
click node_hill "https://github.com/drtanng26/bai-tap-gk-ttnt-nhom-3/blob/main/src/algorithms/sa_branch/hill_climbing.py"
click node_gto "https://github.com/drtanng26/bai-tap-gk-ttnt-nhom-3/blob/main/src/algorithms/gto_branch/gto.py"
click node_pso "https://github.com/drtanng26/bai-tap-gk-ttnt-nhom-3/blob/main/src/algorithms/gto_branch/pso.py"
click node_gwo "https://github.com/drtanng26/bai-tap-gk-ttnt-nhom-3/blob/main/src/algorithms/gto_branch/gwo.py"
click node_woa "https://github.com/drtanng26/bai-tap-gk-ttnt-nhom-3/blob/main/src/algorithms/gto_branch/woa.py"
click node_problem_base "https://github.com/drtanng26/bai-tap-gk-ttnt-nhom-3/blob/main/src/core/base_problem.py"
click node_optimizer_base "https://github.com/drtanng26/bai-tap-gk-ttnt-nhom-3/blob/main/src/core/base_optimizer.py"
click node_runner "https://github.com/drtanng26/bai-tap-gk-ttnt-nhom-3/blob/main/src/experiments/runner.py"
click node_statistics "https://github.com/drtanng26/bai-tap-gk-ttnt-nhom-3/blob/main/src/experiments/statistics.py"
click node_visualizer "https://github.com/drtanng26/bai-tap-gk-ttnt-nhom-3/blob/main/src/experiments/visualizer.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_dashboard,node_cli,node_user toneBlue
class node_tsplib,node_tsp,node_continuous,node_benchmarks,node_fm toneAmber
class node_sa,node_hill,node_gto,node_pso,node_gwo,node_woa toneMint
class node_problem_base,node_optimizer_base toneRose
class node_runner,node_statistics,node_visualizer toneIndigo
```

## Components

### User Interfaces

- [Streamlit Dashboard](https://github.com/drtanng26/bai-tap-gk-ttnt-nhom-3/blob/main/app.py): `app.py`
- [Experiment CLI](https://github.com/drtanng26/bai-tap-gk-ttnt-nhom-3/blob/main/main_cli.py): `main_cli.py`

### Optimization Problems

- [TSPLIB Instances](https://github.com/drtanng26/bai-tap-gk-ttnt-nhom-3/tree/main/data/tsplib): `data/tsplib`
- [TSP Problem](https://github.com/drtanng26/bai-tap-gk-ttnt-nhom-3/blob/main/src/problems/tsp.py): `src/problems/tsp.py`
- [Continuous SA Problem](https://github.com/drtanng26/bai-tap-gk-ttnt-nhom-3/blob/main/src/problems/continuous_sa.py): `src/problems/continuous_sa.py`
- [F1–F23 Benchmarks](https://github.com/drtanng26/bai-tap-gk-ttnt-nhom-3/blob/main/src/problems/benchmark_23.py): `src/problems/benchmark_23.py`
- [FM Sound Problem](https://github.com/drtanng26/bai-tap-gk-ttnt-nhom-3/blob/main/src/problems/fm_sound.py): `src/problems/fm_sound.py`

### Optimization Algorithms

- [Simulated Annealing](https://github.com/drtanng26/bai-tap-gk-ttnt-nhom-3/blob/main/src/algorithms/sa_branch/sa.py): `src/algorithms/sa_branch/sa.py`
- [Hill Climbing](https://github.com/drtanng26/bai-tap-gk-ttnt-nhom-3/blob/main/src/algorithms/sa_branch/hill_climbing.py): `src/algorithms/sa_branch/hill_climbing.py`
- [GTO](https://github.com/drtanng26/bai-tap-gk-ttnt-nhom-3/blob/main/src/algorithms/gto_branch/gto.py): `src/algorithms/gto_branch/gto.py`
- [PSO](https://github.com/drtanng26/bai-tap-gk-ttnt-nhom-3/blob/main/src/algorithms/gto_branch/pso.py): `src/algorithms/gto_branch/pso.py`
- [GWO](https://github.com/drtanng26/bai-tap-gk-ttnt-nhom-3/blob/main/src/algorithms/gto_branch/gwo.py): `src/algorithms/gto_branch/gwo.py`
- [WOA](https://github.com/drtanng26/bai-tap-gk-ttnt-nhom-3/blob/main/src/algorithms/gto_branch/woa.py): `src/algorithms/gto_branch/woa.py`

### Optimization Core

- [Problem Interface](https://github.com/drtanng26/bai-tap-gk-ttnt-nhom-3/blob/main/src/core/base_problem.py): `src/core/base_problem.py`
- [Optimizer Results](https://github.com/drtanng26/bai-tap-gk-ttnt-nhom-3/blob/main/src/core/base_optimizer.py): `src/core/base_optimizer.py`

### Experiment Analysis

- [Experiment Runner](https://github.com/drtanng26/bai-tap-gk-ttnt-nhom-3/blob/main/src/experiments/runner.py): `src/experiments/runner.py`
- [Run Statistics](https://github.com/drtanng26/bai-tap-gk-ttnt-nhom-3/blob/main/src/experiments/statistics.py): `src/experiments/statistics.py`
- [Plots and Tours](https://github.com/drtanng26/bai-tap-gk-ttnt-nhom-3/blob/main/src/experiments/visualizer.py): `src/experiments/visualizer.py`

### Other components

- **User**

## Connections

- User → Streamlit Dashboard: uses (evidence: `README.md`)
- User → Experiment CLI: runs (evidence: `README.md`)
- Streamlit Dashboard → TSP Problem: creates (evidence: `app.py`)
- Streamlit Dashboard → Simulated Annealing: runs (evidence: `app.py`)
- Streamlit Dashboard → Hill Climbing: compares (evidence: `README.md`)
- Streamlit Dashboard → GTO: runs (evidence: `README.md`)
- Streamlit Dashboard → PSO: compares (evidence: `README.md`)
- Streamlit Dashboard → GWO: compares (evidence: `README.md`)
- Streamlit Dashboard → WOA: compares (evidence: `README.md`)
- Streamlit Dashboard → F1–F23 Benchmarks: selects (evidence: `app.py`)
- Streamlit Dashboard → FM Sound Problem: selects (evidence: `app.py`)
- Streamlit Dashboard → Plots and Tours: displays (evidence: `app.py`)
- Experiment CLI → Experiment Runner: runs (evidence: `main_cli.py`)
- Experiment CLI → Run Statistics: summarizes (evidence: `main_cli.py`)
- Experiment CLI → Plots and Tours: generates plots (evidence: `main_cli.py`)
- TSP Problem → TSPLIB Instances: reads instances (evidence: `README.md`)
- TSP Problem → Problem Interface: implements (evidence: `src/problems/tsp.py`)
- Continuous SA Problem → Problem Interface: implements (evidence: `src/problems/continuous_sa.py`)
- F1–F23 Benchmarks → Problem Interface: implements (evidence: `src/problems/benchmark_23.py`)
- FM Sound Problem → Problem Interface: implements (evidence: `src/problems/fm_sound.py`)
- Simulated Annealing → Problem Interface: evaluates (evidence: `src/algorithms/sa_branch/sa.py`)
- Simulated Annealing → Optimizer Results: returns result (evidence: `src/algorithms/sa_branch/sa.py`)
- Hill Climbing → Problem Interface: evaluates (evidence: `src/algorithms/sa_branch/hill_climbing.py`)
- Hill Climbing → Optimizer Results: returns result (evidence: `src/algorithms/sa_branch/hill_climbing.py`)
- GTO → Problem Interface: evaluates (evidence: `src/algorithms/gto_branch/gto.py`)
- GTO → Optimizer Results: returns result (evidence: `src/algorithms/gto_branch/gto.py`)
- PSO → Problem Interface: evaluates (evidence: `src/algorithms/gto_branch/pso.py`)
- PSO → Optimizer Results: returns result (evidence: `src/algorithms/gto_branch/pso.py`)
- GWO → Problem Interface: evaluates (evidence: `src/algorithms/gto_branch/gwo.py`)
- GWO → Optimizer Results: returns result (evidence: `src/algorithms/gto_branch/gwo.py`)
- WOA → Problem Interface: evaluates (evidence: `src/algorithms/gto_branch/woa.py`)
- WOA → Optimizer Results: returns result (evidence: `src/algorithms/gto_branch/woa.py`)
- Experiment Runner → Problem Interface: accepts problems (evidence: `src/experiments/runner.py`)
- Experiment Runner → Optimizer Results: uses results (evidence: `src/experiments/runner.py`)
- Plots and Tours → Optimizer Results: plots results (evidence: `src/experiments/visualizer.py`)
- Plots and Tours → TSP Problem: plots tours (evidence: `src/experiments/visualizer.py`)
