Update README.md
Browse files
README.md
CHANGED
@@ -1,24 +1,70 @@
|
|
1 |
# π VRP Shanghai Transformer
|
2 |
|
3 |
-
|
4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
---
|
7 |
|
8 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
-
|
11 |
-
**Transformer architecture** to solve the **Vehicle Routing Problem with Time Windows (VRPTW)**.
|
12 |
-
The model is adapted from the paper [Attention, Learn to Solve Routing Problems!](https://arxiv.org/abs/1803.08475)
|
13 |
-
and is tested on real-world delivery data from Shanghai.
|
14 |
|
15 |
-
|
16 |
-
-
|
17 |
-
-
|
18 |
-
-
|
19 |
-
- OR-Tools for benchmarking
|
20 |
|
21 |
---
|
22 |
|
23 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
|
|
|
1 |
# π VRP Shanghai Transformer
|
2 |
|
3 |
+
**VRP Shanghai Transformer** is a research-grade implementation of a Transformer-based Reinforcement Learning model
|
4 |
+
designed to solve the **Vehicle Routing Problem (VRP)** with time windows. The model architecture
|
5 |
+
and learning strategy are inspired by the paper:
|
6 |
+
|
7 |
+
> **"Attention, Learn to Solve Routing Problems!"**
|
8 |
+
> Kool, W., van Hoof, H., & Welling, M. (2019)
|
9 |
+
> [arXiv:1803.08475](https://arxiv.org/abs/1803.08475)
|
10 |
+
|
11 |
+
This project adapts the original implementation to support the
|
12 |
+
**Shanghai Delivery Dataset** and includes compatibility with **Google OR-Tools** for benchmarking.
|
13 |
|
14 |
---
|
15 |
|
16 |
+
## π¦ Features
|
17 |
+
|
18 |
+
- Transformer-based Actor-Critic model for routing optimization.
|
19 |
+
- Multi-vehicle time window routing with dynamic constraints.
|
20 |
+
- Modular implementation with support for:
|
21 |
+
- Data batching and augmentation.
|
22 |
+
- Beam search and greedy decoding.
|
23 |
+
- Google OR-Tools as a baseline solver.
|
24 |
+
- Built-in dataset loader for the Shanghai delivery tasks.
|
25 |
+
- Easy deployment via Hugging Face Spaces (using Docker).
|
26 |
+
|
27 |
+
---
|
28 |
|
29 |
+
## π§ Tech Stack
|
|
|
|
|
|
|
30 |
|
31 |
+
- **PyTorch**: Core deep learning framework.
|
32 |
+
- **OR-Tools**: Baseline routing solver.
|
33 |
+
- **Docker**: Environment setup for reproducible training and inference.
|
34 |
+
- **Hugging Face Spaces**: Deployment and interactive testing.
|
|
|
35 |
|
36 |
---
|
37 |
|
38 |
+
## π Quick Start
|
39 |
+
|
40 |
+
```bash
|
41 |
+
# Clone the repository
|
42 |
+
git clone https://github.com/your-org/vrp-shanghai-transformer.git
|
43 |
+
cd vrp-shanghai-transformer
|
44 |
+
|
45 |
+
# Run using Docker
|
46 |
+
docker build -t vrp-transformer .
|
47 |
+
docker run -it vrp-transformer
|
48 |
+
|
49 |
+
π Project Structure
|
50 |
+
|
51 |
+
βββ Actor/ # Model components: Actor, Graph, Fleet
|
52 |
+
βββ google_solver/ # Google OR-Tools integration
|
53 |
+
βββ train_test_utils/ # Training loop, baseline evaluation
|
54 |
+
βββ utils/ # Helper functions (data manipulation, tensor ops)
|
55 |
+
βββ dataloader.py # Dataset loading logic
|
56 |
+
βββ build_data.py # Synthetic data generator
|
57 |
+
βββ README.md # This file
|
58 |
+
|
59 |
+
|
60 |
+
π References
|
61 |
+
|
62 |
+
Kool, W., van Hoof, H., & Welling, M. (2019). Attention, Learn to Solve Routing Problems!
|
63 |
+
arXiv:1803.08475
|
64 |
+
|
65 |
+
Google OR-Tools: https://developers.google.com/optimization
|
66 |
+
|
67 |
+
Hugging Face Spaces configuration reference:
|
68 |
+
https://huggingface.co/docs/hub/spaces-config-reference
|
69 |
+
|
70 |
|