Upload folder using huggingface_hub
Browse files- README.md +114 -0
- att48-aco.apr +0 -0
- berlin52-aco.apr +0 -0
- eil51-aco.apr +0 -0
README.md
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
tags:
|
| 4 |
+
- tsp
|
| 5 |
+
- traveling-salesman-problem
|
| 6 |
+
- combinatorial-optimization
|
| 7 |
+
- ant-colony-optimization
|
| 8 |
+
- metaheuristics
|
| 9 |
+
- rust
|
| 10 |
+
library_name: aprender-tsp
|
| 11 |
+
pipeline_tag: other
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
# aprender-tsp POC Models
|
| 15 |
+
|
| 16 |
+
Pre-trained TSP (Traveling Salesman Problem) optimization models using Ant Colony Optimization, built with [aprender-tsp](https://github.com/paiml/aprender).
|
| 17 |
+
|
| 18 |
+
## Models Included
|
| 19 |
+
|
| 20 |
+
| Model | Instance | Cities | Optimal | Achieved | Gap | Tier |
|
| 21 |
+
|-------|----------|--------|---------|----------|-----|------|
|
| 22 |
+
| berlin52-aco.apr | berlin52 | 52 | 7,542 | 7,687 | 1.92% | Good |
|
| 23 |
+
| att48-aco.apr | att48 | 48 | 10,628 | 11,085 | 4.30% | Acceptable |
|
| 24 |
+
| eil51-aco.apr | eil51 | 51 | 426 | 443 | 4.07% | Acceptable |
|
| 25 |
+
|
| 26 |
+
All models achieve < 5% gap from TSPLIB optimal solutions.
|
| 27 |
+
|
| 28 |
+
## Quick Start
|
| 29 |
+
|
| 30 |
+
```bash
|
| 31 |
+
# Install aprender-tsp
|
| 32 |
+
cargo install aprender-tsp
|
| 33 |
+
|
| 34 |
+
# Download a model
|
| 35 |
+
huggingface-cli download paiml/aprender-tsp-poc berlin52-aco.apr
|
| 36 |
+
|
| 37 |
+
# Solve a new instance using the model
|
| 38 |
+
aprender-tsp solve -m berlin52-aco.apr your-instance.tsp
|
| 39 |
+
|
| 40 |
+
# View model info
|
| 41 |
+
aprender-tsp info berlin52-aco.apr
|
| 42 |
+
|
| 43 |
+
# Benchmark against known optimal
|
| 44 |
+
aprender-tsp benchmark berlin52-aco.apr --instances berlin52.tsp
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
## Training Parameters
|
| 48 |
+
|
| 49 |
+
All models trained with identical ACO parameters for reproducibility:
|
| 50 |
+
|
| 51 |
+
| Parameter | Value | Description |
|
| 52 |
+
|-----------|-------|-------------|
|
| 53 |
+
| Algorithm | ACO (Ant Colony Optimization) | Uses core aprender::AntColony |
|
| 54 |
+
| Iterations | 2000 | Number of optimization iterations |
|
| 55 |
+
| Ants | 20 | Number of artificial ants |
|
| 56 |
+
| Alpha (α) | 1.0 | Pheromone importance |
|
| 57 |
+
| Beta (β) | 2.5 | Heuristic importance |
|
| 58 |
+
| Rho (ρ) | 0.1 | Evaporation rate |
|
| 59 |
+
| Seed | 42 | Random seed for reproducibility |
|
| 60 |
+
|
| 61 |
+
## Instance Sources
|
| 62 |
+
|
| 63 |
+
Models are trained on standard TSPLIB benchmark instances:
|
| 64 |
+
|
| 65 |
+
- **berlin52**: 52 locations in Berlin, Germany (Groetschel)
|
| 66 |
+
- **att48**: 48 state capitals of the contiguous USA (Padberg/Rinaldi)
|
| 67 |
+
- **eil51**: 51-city problem (Christofides/Eilon)
|
| 68 |
+
|
| 69 |
+
Reference: [TSPLIB](http://comopt.ifi.uni-heidelberg.de/software/TSPLIB95/)
|
| 70 |
+
|
| 71 |
+
## File Format
|
| 72 |
+
|
| 73 |
+
Models use the `.apr` binary format:
|
| 74 |
+
- Magic bytes: `APR\0`
|
| 75 |
+
- Version: 1
|
| 76 |
+
- CRC32 checksum for integrity
|
| 77 |
+
- Compact size: ~77 bytes per model
|
| 78 |
+
|
| 79 |
+
## Solution Quality Tiers
|
| 80 |
+
|
| 81 |
+
| Tier | Gap from Optimal |
|
| 82 |
+
|------|------------------|
|
| 83 |
+
| Optimal | < 0.1% |
|
| 84 |
+
| Excellent | < 1% |
|
| 85 |
+
| Good | < 2% |
|
| 86 |
+
| Acceptable | < 5% |
|
| 87 |
+
| Poor | >= 5% |
|
| 88 |
+
|
| 89 |
+
## Train Your Own
|
| 90 |
+
|
| 91 |
+
```bash
|
| 92 |
+
# Train on your instance
|
| 93 |
+
aprender-tsp train your-instance.tsp -o your-model.apr --algorithm aco --iterations 2000 --seed 42
|
| 94 |
+
|
| 95 |
+
# Or use other algorithms
|
| 96 |
+
aprender-tsp train your-instance.tsp -o model.apr --algorithm tabu # Tabu Search (2-opt)
|
| 97 |
+
aprender-tsp train your-instance.tsp -o model.apr --algorithm ga # Genetic Algorithm
|
| 98 |
+
aprender-tsp train your-instance.tsp -o model.apr --algorithm hybrid # GA + Tabu + ACO
|
| 99 |
+
```
|
| 100 |
+
|
| 101 |
+
## Citation
|
| 102 |
+
|
| 103 |
+
```bibtex
|
| 104 |
+
@software{aprender,
|
| 105 |
+
title = {Aprender: Machine Learning in Pure Rust},
|
| 106 |
+
author = {PAIML},
|
| 107 |
+
url = {https://github.com/paiml/aprender},
|
| 108 |
+
year = {2025}
|
| 109 |
+
}
|
| 110 |
+
```
|
| 111 |
+
|
| 112 |
+
## License
|
| 113 |
+
|
| 114 |
+
MIT License - see LICENSE file.
|
att48-aco.apr
ADDED
|
Binary file (77 Bytes). View file
|
|
|
berlin52-aco.apr
ADDED
|
Binary file (77 Bytes). View file
|
|
|
eil51-aco.apr
ADDED
|
Binary file (77 Bytes). View file
|
|
|