# pritam0112/cvrp-with-or-tools architecture

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

- Interactive diagram: https://gitdiagram.com/pritam0112/cvrp-with-or-tools
- Repository: https://github.com/pritam0112/cvrp-with-or-tools

## Overview

This is a small CVRP command-line solver. It reads the assignment JSON, aggregates and normalizes delivery demands, builds an OR-Tools routing model with vehicle-specific costs and weight/volume limits, then reports and saves a solution. Runtime responsibilities are concentrated in main.py; the graph separates its domain stages while keeping the external solver and input/output artifacts distinct.

Main entry points: [`main.py`](https://github.com/pritam0112/cvrp-with-or-tools/blob/master/main.py) (Route optimization), [`assignment_cvrp.json`](https://github.com/pritam0112/cvrp-with-or-tools/blob/master/assignment_cvrp.json) (CVRP input), [`solution.json`](https://github.com/pritam0112/cvrp-with-or-tools/blob/master/solution.json) (Solution JSON)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_operator(("Operator"))
node_input["CVRP input"]
node_prep["Data preparation<br/>[main.py]"]
node_model["Route optimization<br/>[main.py]"]
node_ortools["OR-Tools"]
node_report["Console report<br/>[main.py]"]
node_export["Solution export<br/>[main.py]"]
node_output["Solution JSON<br/>[solution.json]"]

node_operator -->|"runs solver"| node_model
node_input -->|"provides data"| node_prep
node_model -->|"builds data"| node_prep
node_model -->|"solves model"| node_ortools
node_model -->|"prints solution"| node_report
node_model -->|"saves solution"| node_export
node_export -->|"writes JSON"| node_output

click node_input "https://github.com/pritam0112/cvrp-with-or-tools/blob/master/assignment_cvrp.json"
click node_prep "https://github.com/pritam0112/cvrp-with-or-tools/blob/master/main.py"
click node_model "https://github.com/pritam0112/cvrp-with-or-tools/blob/master/main.py"
click node_report "https://github.com/pritam0112/cvrp-with-or-tools/blob/master/main.py"
click node_export "https://github.com/pritam0112/cvrp-with-or-tools/blob/master/main.py"
click node_output "https://github.com/pritam0112/cvrp-with-or-tools/blob/master/solution.json"

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_operator,node_ortools toneIndigo
class node_input,node_prep,node_report,node_export,node_output toneTeal
class node_model toneMint
```

## Components

### Other components

- **Operator**
- [CVRP input](https://github.com/pritam0112/cvrp-with-or-tools/blob/master/assignment_cvrp.json): `assignment_cvrp.json`
- [Data preparation](https://github.com/pritam0112/cvrp-with-or-tools/blob/master/main.py): `main.py`
- [Route optimization](https://github.com/pritam0112/cvrp-with-or-tools/blob/master/main.py): `main.py`
- **OR-Tools**
- [Console report](https://github.com/pritam0112/cvrp-with-or-tools/blob/master/main.py): `main.py`
- [Solution export](https://github.com/pritam0112/cvrp-with-or-tools/blob/master/main.py): `main.py`
- [Solution JSON](https://github.com/pritam0112/cvrp-with-or-tools/blob/master/solution.json): `solution.json`

## Connections

- Operator → Route optimization: runs solver (evidence: `README.md`)
- CVRP input → Data preparation: provides data (evidence: `main.py`)
- Route optimization → Data preparation: builds data (evidence: `main.py`)
- Route optimization → OR-Tools: solves model (evidence: `main.py`)
- Route optimization → Console report: prints solution (evidence: `main.py`)
- Route optimization → Solution export: saves solution (evidence: `main.py`)
- Solution export → Solution JSON: writes JSON (evidence: `main.py`)
