# deserve-crypto/vrpdtw-rl architecture

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

- Interactive diagram: https://gitdiagram.com/deserve-crypto/vrpdtw-rl
- Repository: https://github.com/deserve-crypto/vrpdtw-rl

## Overview

This repository implements multi-objective optimization for collaborative truck–drone routing with flexible time windows. The documented workflow runs benchmark experiments: construct a routing problem, execute selected algorithms to produce Pareto fronts, then compare and visualize results. HMOA is the proposed method; MOEAD, MOMAD, NSGA-II, and RL-PLS-MOEA are comparison methods. The graph includes shared solution/population machinery and metric reporting. Some algorithm and problem code was sampled only in excerpts, so unshown internal links are omitted.

Main entry points: [`experiment.py`](https://github.com/deserve-crypto/vrpdtw-rl/blob/master/experiment.py) (Experiment runner), [`population.py`](https://github.com/deserve-crypto/vrpdtw-rl/blob/master/population.py) (Population operations), [`individual.py`](https://github.com/deserve-crypto/vrpdtw-rl/blob/master/individual.py) (Solution representation), [`HMOA.py`](https://github.com/deserve-crypto/vrpdtw-rl/blob/master/HMOA.py) (HMOA / PLS)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Experiment workflow"]
  node_experiment["Experiment runner<br/>[experiment.py]"]
  node_benchmark["Benchmark instances"]
  node_reporting["Metrics and plots<br/>[experiment.py]"]
end

subgraph group_problem["Routing problem"]
  node_problem_model["Routing model<br/>[Myproblem.py]"]
  node_route_tools["Route utilities<br/>[tools.py]"]
end

subgraph group_algorithms["Optimization algorithms"]
  node_hmoa["HMOA / PLS<br/>[HMOA.py]"]
  node_moead["MOEA/D<br/>[MOEAD.py]"]
  node_momad["MOMAD<br/>[MOMAD.py]"]
  node_nsgaii["NSGA-II<br/>[NSGAII.py]"]
  node_rl_pls["RL-PLS-MOEA<br/>[RL-PLS-MOEA.py]"]
end

subgraph group_runtime["Shared runtime"]
  node_population["Population operations<br/>[population.py]"]
  node_individual["Solution representation<br/>[individual.py]"]
  node_metrics["Algorithm metrics<br/>[metrics.py]"]
end

node_user(("Researcher"))

node_user -->|"runs"| node_experiment
node_experiment -->|"loads instances"| node_benchmark
node_experiment -->|"creates problem"| node_problem_model
node_experiment -->|"runs"| node_hmoa
node_experiment -->|"runs"| node_moead
node_experiment -->|"runs"| node_momad
node_experiment -->|"runs"| node_nsgaii
node_experiment -->|"runs"| node_rl_pls
node_experiment -->|"compares and plots"| node_reporting
node_problem_model -->|"reads data"| node_route_tools
node_hmoa -->|"requests neighborhoods"| node_problem_model
node_hmoa -->|"creates population"| node_population
node_hmoa -->|"builds solutions"| node_individual
node_hmoa -->|"records metrics"| node_metrics
node_moead -->|"creates population"| node_population
node_moead -->|"copies solutions"| node_individual
node_moead -->|"records metrics"| node_metrics
node_momad -->|"creates population"| node_population
node_momad -->|"builds solutions"| node_individual
node_momad -->|"records metrics"| node_metrics
node_nsgaii -->|"creates population"| node_population
node_nsgaii -->|"builds solutions"| node_individual
node_nsgaii -->|"records metrics"| node_metrics
node_rl_pls -->|"creates population"| node_population
node_rl_pls -->|"builds solutions"| node_individual
node_rl_pls -->|"records metrics"| node_metrics
node_population -->|"creates individuals"| node_individual

click node_experiment "https://github.com/deserve-crypto/vrpdtw-rl/blob/master/experiment.py"
click node_benchmark "https://github.com/deserve-crypto/vrpdtw-rl/tree/master/benchmark"
click node_reporting "https://github.com/deserve-crypto/vrpdtw-rl/blob/master/experiment.py"
click node_problem_model "https://github.com/deserve-crypto/vrpdtw-rl/blob/master/Myproblem.py"
click node_route_tools "https://github.com/deserve-crypto/vrpdtw-rl/blob/master/tools.py"
click node_hmoa "https://github.com/deserve-crypto/vrpdtw-rl/blob/master/HMOA.py"
click node_moead "https://github.com/deserve-crypto/vrpdtw-rl/blob/master/MOEAD.py"
click node_momad "https://github.com/deserve-crypto/vrpdtw-rl/blob/master/MOMAD.py"
click node_nsgaii "https://github.com/deserve-crypto/vrpdtw-rl/blob/master/NSGAII.py"
click node_rl_pls "https://github.com/deserve-crypto/vrpdtw-rl/blob/master/RL-PLS-MOEA.py"
click node_population "https://github.com/deserve-crypto/vrpdtw-rl/blob/master/population.py"
click node_individual "https://github.com/deserve-crypto/vrpdtw-rl/blob/master/individual.py"
click node_metrics "https://github.com/deserve-crypto/vrpdtw-rl/blob/master/metrics.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_experiment,node_benchmark,node_reporting toneBlue
class node_problem_model,node_route_tools toneAmber
class node_hmoa,node_moead,node_momad,node_nsgaii,node_rl_pls toneMint
class node_population,node_individual,node_metrics toneRose
class node_user toneIndigo
```

## Components

### Experiment workflow

- [Experiment runner](https://github.com/deserve-crypto/vrpdtw-rl/blob/master/experiment.py): `experiment.py`
- [Benchmark instances](https://github.com/deserve-crypto/vrpdtw-rl/tree/master/benchmark): `benchmark`
- [Metrics and plots](https://github.com/deserve-crypto/vrpdtw-rl/blob/master/experiment.py): `experiment.py`

### Routing problem

- [Routing model](https://github.com/deserve-crypto/vrpdtw-rl/blob/master/Myproblem.py): `Myproblem.py`
- [Route utilities](https://github.com/deserve-crypto/vrpdtw-rl/blob/master/tools.py): `tools.py`

### Optimization algorithms

- [HMOA / PLS](https://github.com/deserve-crypto/vrpdtw-rl/blob/master/HMOA.py): `HMOA.py`
- [MOEA/D](https://github.com/deserve-crypto/vrpdtw-rl/blob/master/MOEAD.py): `MOEAD.py`
- [MOMAD](https://github.com/deserve-crypto/vrpdtw-rl/blob/master/MOMAD.py): `MOMAD.py`
- [NSGA-II](https://github.com/deserve-crypto/vrpdtw-rl/blob/master/NSGAII.py): `NSGAII.py`
- [RL-PLS-MOEA](https://github.com/deserve-crypto/vrpdtw-rl/blob/master/RL-PLS-MOEA.py): `RL-PLS-MOEA.py`

### Shared runtime

- [Population operations](https://github.com/deserve-crypto/vrpdtw-rl/blob/master/population.py): `population.py`
- [Solution representation](https://github.com/deserve-crypto/vrpdtw-rl/blob/master/individual.py): `individual.py`
- [Algorithm metrics](https://github.com/deserve-crypto/vrpdtw-rl/blob/master/metrics.py): `metrics.py`

### Other components

- **Researcher**

## Connections

- Researcher → Experiment runner: runs (evidence: `readme.txt`)
- Experiment runner → Benchmark instances: loads instances (evidence: `experiment.py`)
- Experiment runner → Routing model: creates problem (evidence: `experiment.py`)
- Experiment runner → HMOA / PLS: runs (evidence: `experiment.py`)
- Experiment runner → MOEA/D: runs (evidence: `experiment.py`)
- Experiment runner → MOMAD: runs (evidence: `experiment.py`)
- Experiment runner → NSGA-II: runs (evidence: `experiment.py`)
- Experiment runner → RL-PLS-MOEA: runs (evidence: `experiment.py`)
- Experiment runner → Metrics and plots: compares and plots (evidence: `experiment.py`)
- Routing model → Route utilities: reads data (evidence: `Myproblem.py`)
- HMOA / PLS → Routing model: requests neighborhoods (evidence: `HMOA.py`)
- HMOA / PLS → Population operations: creates population (evidence: `HMOA.py`)
- HMOA / PLS → Solution representation: builds solutions (evidence: `HMOA.py`)
- HMOA / PLS → Algorithm metrics: records metrics (evidence: `HMOA.py`)
- MOEA/D → Population operations: creates population (evidence: `MOEAD.py`)
- MOEA/D → Solution representation: copies solutions (evidence: `MOEAD.py`)
- MOEA/D → Algorithm metrics: records metrics (evidence: `MOEAD.py`)
- MOMAD → Population operations: creates population (evidence: `MOMAD.py`)
- MOMAD → Solution representation: builds solutions (evidence: `MOMAD.py`)
- MOMAD → Algorithm metrics: records metrics (evidence: `MOMAD.py`)
- NSGA-II → Population operations: creates population (evidence: `NSGAII.py`)
- NSGA-II → Solution representation: builds solutions (evidence: `NSGAII.py`)
- NSGA-II → Algorithm metrics: records metrics (evidence: `NSGAII.py`)
- RL-PLS-MOEA → Population operations: creates population (evidence: `RL-PLS-MOEA.py`)
- RL-PLS-MOEA → Solution representation: builds solutions (evidence: `RL-PLS-MOEA.py`)
- RL-PLS-MOEA → Algorithm metrics: records metrics (evidence: `RL-PLS-MOEA.py`)
- Population operations → Solution representation: creates individuals (evidence: `population.py`)
