|
|
--- |
|
|
language: en |
|
|
tags: |
|
|
- graph-neural-networks |
|
|
- combinatorial-optimization |
|
|
- tsp |
|
|
- floydnet |
|
|
- diffusion-models |
|
|
- pytorch |
|
|
license: mit |
|
|
datasets: |
|
|
- ocxlabs/FloydNet_TSP_demo |
|
|
--- |
|
|
|
|
|
# FloydNet (Metric TSP / Euclidean TSP) |
|
|
|
|
|
## Model Summary |
|
|
|
|
|
**FloydNet** is a graph reasoning architecture designed to mimic the execution of algorithms via a learned, global Dynamic Programming operator. This checkpoint (`_euc`) is trained to solve the **Metric (Euclidean) Traveling Salesman Problem**, where edge weights are defined by Euclidean distances between 2D coordinates. |
|
|
|
|
|
FloydNet operates directly on the pairwise relationship tensor (distance matrix), learning to refine global dependencies without explicit geometric engineering. |
|
|
|
|
|
## Model Details |
|
|
|
|
|
* **Model ID:** `ocxlabs/FloydNet_TSP_euc` |
|
|
* **Architecture:** FloydNet (Deep relational layers with Pivotal Attention) |
|
|
* **Task:** Metric Traveling Salesman Problem (Euclidean) |
|
|
* **Paper:** [FloydNet: A Learning Paradigm for Global Relational Reasoning](https://arxiv.org/abs/2601.19094) |
|
|
* **Demo Dataset:** [ocxlabs/FloydNet_TSP_demo](https://huggingface.co/datasets/ocxlabs/FloydNet_TSP_demo) |
|
|
|
|
|
## Performance |
|
|
|
|
|
On Metric TSP instances (N=100-200), FloydNet matches the performance of specialized geometric heuristics: |
|
|
* **Robustness:** Maintains robust performance (>96% optimality) within the training distribution ($N \le 100$). |
|
|
* **Generalization:** effectively generalizes to larger unseen graph sizes. |
|
|
|
|
|
## Usage: Inference & Evaluation |
|
|
|
|
|
### 1. Preparation |
|
|
Download the demo dataset from [Hugging Face](https://huggingface.co/datasets/ocxlabs/FloydNet_TSP_demo). Unzip it and place the extracted folder under `example/data/`. |
|
|
|
|
|
### 2. Inference |
|
|
Run inference in `--test_mode` using `torchrun`. Ensure `--subset` is set to `euc` and the checkpoint path matches. |
|
|
|
|
|
```bash |
|
|
source .venv/bin/activate |
|
|
cd example |
|
|
|
|
|
torchrun \ |
|
|
--nproc_per_node=8 \ |
|
|
-m TSP.run \ |
|
|
--subset euc \ |
|
|
--output_dir ./outputs/TSP_euc \ |
|
|
--load_checkpoint path/to/TSP_euc/epoch_01000.pt \ |
|
|
--test_mode \ |
|
|
--split_factor 1 \ |
|
|
--sample_count_per_case 10 |