# route-order-tsp

order delivery stops into a short round trip with nearest-neighbour plus 2-opt improvement

- **Space:** geospatial-public (https://github.com/Tech-Realm/space-geospatial-public/tree/main/route-order-tsp)
- **Level:** L2 (as the registry reports it)
- **Keys it needs (names only):** none
- **Tools:** python3
- **Routes:** python-stdlib, ortools; checks: 1
- **Uses:** new (no recorded use yet)
- **Install:** `logicpacks pack use geospatial-public/route-order-tsp` or MCP `get_pack geospatial-public/route-order-tsp`
- **Files:** CHANGELOG.md, code/route.py, outcome/EVIDENCE.md, outcome/checks.yaml, outcome/fixtures/stops.csv, outcome/results.json, pack.yaml, refs/refs.yaml, spec/SPEC.md, spec/source.md

## Purpose (spec/SPEC.md)

## Goal

Order delivery stops into a short round trip with nearest-neighbour plus 2-opt improvement.

## Steps

1. List the depot first, then stops.
2. Run route.py for a straight-line order.
3. For real road order and ETAs use OSRM/Valhalla (maps space) with this order as a start.

## Edge cases

- Time windows and vehicle capacity need a real VRP solver (OR-Tools).
- Over ~200 stops 2-opt gets slow in pure Python.

## Don'ts

- Don't promise ETAs from straight-line km.

## Routes (free first)

1. `python-stdlib`: `code/route.py` (no install).
2. `ortools` (free): Google OR-Tools for VRP with capacity/time windows (pip install ortools)



---

Canonical URL: https://logicpacks.io/packs/geospatial-public/route-order-tsp

Developed by TechRealm (techrealm.online), the software team. Operated by Al Jash Trading (Establishment), Abu Dhabi, since 1994, the legal entity that hosts and is responsible for the service. Economic licence CN-1030597, Abu Dhabi Registration Authority. Address: Office 5, Bani Yas West 4, Bani Yas, Abu Dhabi, UAE. Website: https://aljashtrading.com. Contact: hello@logicpacks.io, security@logicpacks.io, WhatsApp +1 713 632 2262 (https://wa.me/17136322262).

Machine-readable index: [/llms.txt](/llms.txt). Plain facts: [/about.md](/about.md). Safety: [/safety.md](/safety.md).
