Per-instance TSP Solver with No Pre-training (1.66% gap on d1291)
Details
- External ID
- 46420670
- Source
- HN
- Company
- —
- Product
- —
- Website domain
- —
- Launched
- Dec. 29, 2025
- Cohort
- —
- Upvotes
- 21
- Upvotes percentile
- 0.6612595419847328
- Tags
- —
- Fetched at
- Sept. 7, 2026, 9:25 p.m.
- Updated at
- Sept. 7, 2026, 9:25 p.m.
Description
OP here.Most Deep Learning approaches for TSP rely on pre-training with large-scale datasets. I wanted to see if a solver could learn "on the fly" for a specific instance without any priors from other problems.I built a solver using PPO that learns from scratch per instance. It achieved a 1.66% gap on TSPLIB d1291 in about 5.6 hours on a single A100.The Core Idea: My hypothesis was that while optimal solutions are mostly composed of 'minimum edges' (nearest neighbors), the actual difficulty comes from a small number of 'exception edges' outside of that local scope.Instead of pre-training, I designed an inductive bias based on the topological/geometric structure of these exception edges. The agent receives guides on which edges are likely promising based on micro/macro structures, and PPO fills in the gaps through trial and error.It is interesting to see RL reach this level without a dataset. I have open-sourced the code and a Colab notebook for anyone who wants to verify the results or tinker with the 'exception edge' hypothesis.Code & Colab: https://github.com/jivaprime/TSP_exception-edgeHappy to answer any questions about the geometric priors or the PPO implementation!
Enrichment
- Theme
- specialized AI models and agent reasoning tools
- Vertical
- Horizontal
- Function
- Dev tools
- Audience
- Developer
- AI stance
- AI-native
- Project type
- Hobby / open-source project
- Normalized one-liner
- tsp solver without pretraining
- Manually corrected
- False
Could you build this?
No Designing an un-pretrained, per-instance reinforcement learning solver using PPO that achieves near-optimal TSP solutions requires deep, non-trivial machine learning research and algorithm design.
What it would actually take: A production version requires PyTorch/JAX combined with custom CUDA/C++ graph traversal kernels to rapidly simulate environments for a single TSP instance. The hard part is designing the policy representation, action space parametrization, and reward shaping to ensure PPO converges rapidly without collapsing into local minima or requiring huge offline datasets. This requires advanced expertise in deep reinforcement learning, combinatorial optimization, and GPU kernel acceleration.
Discussion
5 comments analyzed.
Competitors mentioned: LKH3, Concorde solver
Concerns raised: 1200 node TSP is too small/toy problem, Much slower than existing solvers on standard instances, RL not suitable for deterministic TSP problems
Competitors
Other products that read as similar to this one — 21 launches clear the similarity bar, closest 8 shown.
Attention rank: #9 of 22 (itself plus its competitors, highest first — normalized so YC and Product Hunt are compared fairly).
Looks like the first mover among its competitors.
- The Hessian of tall-skinny networks is easy to invert · hn · 2026-01-15 · 31 upvotes · similarity 0.35
- We scored 50k PRs with AI · hn · 2026-03-30 · 11 upvotes · similarity 0.34
- Flow Matching model inference in C · hn · 2026-07-23 · 5 upvotes · similarity 0.34
- TabPFN MCP, gives LLMs tools for predictions on tabular data (beta) · hn · 2026-02-05 · 11 upvotes · similarity 0.34
- Tensor Spy: inspect NumPy and PyTorch tensors in the browser, no upload · hn · 2026-03-02 · 22 upvotes · similarity 0.33
- Algotrek · hn · 2026-07-16 · 13 upvotes · similarity 0.33
- zkGolf · hn · 2026-07-02 · 69 upvotes · similarity 0.33
- Duplicate 3 layers in a 24B LLM, logical deduction .22→.76. No training · hn · 2026-03-18 · 265 upvotes · similarity 0.33
Other launches for this product
- No other launches for this product.
Same idea, different domain
Nobody's really built a dev tools tool for Sales yet.