You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert

166
+
---
164
167
165
-
## Project Overview
168
+
## Project Summary
166
169
167
-
This repository provides a comprehensive comparison and implementation of several heuristic and metaheuristic algorithms for solving the **Vehicle Routing Problem with Time Windows (VRPTW)**. Developed as part of a master's thesis, the project offers reproducible experiments, insightful analysis, and visualizations of solutions across different algorithms.
170
+
This repository provides a comprehensive comparison and implementation of several heuristic and metaheuristic algorithms for solving the **Vehicle Routing Problem with Time Windows (VRPTW)**. Developed as part of an advanced study project, it showcases reproducible computational experiments, detailed analysis, and visualizations of solution quality for different algorithms. The target audience includes researchers, students, and practitioners interested in operations research, optimization, and applied machine learning.
168
171
169
172
---
170
173
171
174
## Table of Contents
172
175
173
-
-[Project Overview](#project-overview)
176
+
-[Project Summary](#project-summary)
177
+
-[Project Details](#project-details)
174
178
-[Features](#features)
175
179
-[Technologies Used](#technologies-used)
176
180
-[Project Structure](#project-structure)
@@ -184,9 +188,9 @@ This repository provides a comprehensive comparison and implementation of severa
184
188
185
189
---
186
190
187
-
## Project Overview
191
+
## Project Details
188
192
189
-
The VRPTW is a classic combinatorial optimization problem that extends the Vehicle Routing Problem (VRP) by adding time windows for customer visits. This project benchmarks and compares several well-known algorithms on standard datasets (e.g., Solomon's instances) and visualizes their performance.
193
+
The Vehicle Routing Problem with Time Windows (VRPTW) is a classic combinatorial optimization problem that extends the basic Vehicle Routing Problem (VRP) by adding constraints on service time windows for each customer. The challenge is to determine optimal routes for a fleet of vehicles to service a set of customers within their specified time windows, minimizing total travel cost. This project benchmarks and compares several well-known metaheuristic algorithms on standard datasets (e.g., Solomon's instances) and visualizes their performance.
190
194
191
195
**Algorithms Compared:**
192
196
- Hybrid Genetic Search (HGS)
@@ -225,7 +229,12 @@ The VRPTW is a classic combinatorial optimization problem that extends the Vehic
225
229
├── main.py # Main script to run all algorithms and generate results
226
230
├── solver.ipynb # Jupyter Notebook for interactive exploration
227
231
├── aco/ # Implementation of Ant Colony Optimization
232
+
│ ├── vrptw_base.py # Node and graph structures for ACO
233
+
│ ├── basic_aco.py # Core ACO logic and route extraction
234
+
│ ├── ant.py # Ant agent behaviors and movement
228
235
├── gls/ # Implementation of Guided Local Search
236
+
│ ├── base_solver.py # GLS algorithm and solver logic
A population-based metaheuristic that simulates ant foraging behavior using pheromone trails to discover optimal routes.
275
288
289
+
**Key Classes:**
290
+
-`Node` (in `aco/vrptw_base.py`): Represents each location (customer or depot), including time windows and demand.
291
+
-`Ant` (in `aco/ant.py`): Each ant constructs a route, considering vehicle load, time windows, and updates its path.
292
+
-`BasicACO` (in `aco/basic_aco.py`): Core logic for iteratively building solutions and updating pheromones.
293
+
294
+
**Example Code Excerpt:**
295
+
```python
296
+
# Example: Extracting routes from the best path (aco/basic_aco.py)
297
+
defget_best_route(self):
298
+
routes = []
299
+
route = []
300
+
for node inself.best_path:
301
+
if node !=0:
302
+
route.append(node)
303
+
else:
304
+
if route:
305
+
routes.append(route)
306
+
route = []
307
+
return routes
308
+
```
309
+
310
+
---
311
+
276
312
### 4. Simulated Annealing (SA)
277
313
A probabilistic algorithm that explores the solution space by occasionally accepting worse solutions, allowing escape from local minima.
278
314
@@ -281,6 +317,7 @@ A probabilistic algorithm that explores the solution space by occasionally accep
281
317
## How to Run
282
318
283
319
### 1. Environment Setup
320
+
284
321
```sh
285
322
python -m venv .venv
286
323
# Activate the virtual environment:
@@ -292,14 +329,22 @@ source .venv/bin/activate
292
329
pip install -r requirements.txt
293
330
```
294
331
332
+
---
333
+
295
334
### 2. Running the Algorithms
335
+
296
336
To run all algorithms and generate comparative results:
337
+
297
338
```sh
298
339
python main.py
299
340
```
300
341
342
+
---
343
+
301
344
### 3. Interactive Exploration
345
+
302
346
For a step-by-step interactive analysis:
347
+
303
348
```sh
304
349
jupyter notebook solver.ipynb
305
350
```
@@ -333,6 +378,8 @@ The following table summarizes the results of each algorithm on the `rc108.txt`
333
378
334
379
*All images are retained from the original README and illustrate the route solutions for each algorithm.*
335
380
381
+
*(See README for full image list)*
382
+
336
383
---
337
384
338
385
## Keywords
@@ -351,6 +398,12 @@ The following table summarizes the results of each algorithm on the `rc108.txt`
351
398
352
399
---
353
400
401
+
## Conclusion
402
+
403
+
This project serves as a hands-on, extensible, and educational platform for benchmarking and understanding metaheuristic algorithms applied to the VRPTW. You are encouraged to explore, modify, and extend the codebase for learning, research, or practical use cases.
0 commit comments