traveling-salesman-problem

Solve the Traveling Salesman Problem with exact, heuristic, and metaheuristic algorithms.

56|16|Updated Oct 18, 2025
One-click install
npx skills add https://github.com/kishorkukreja/awesome-supply-chain --skill traveling-salesman-problem
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: traveling-salesman-problem
Source: https://github.com/kishorkukreja/awesome-supply-chain/tree/main/skills/traveling-salesman-problem
Command: npx skills add https://github.com/kishorkukreja/awesome-supply-chain --skill traveling-salesman-problem

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires numpy, pulp, ortools, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill solves the Traveling Salesman Problem (TSP) by finding the shortest possible route that visits each city exactly once and returns to the origin city.

Core Features & Use Cases

  • Exact Algorithms: Solves small TSP instances optimally using dynamic programming (Held-Karp).
  • MIP Formulation: Solves medium-sized instances using Mixed-Integer Programming (MTZ formulation with PuLP).
  • Heuristics: Provides efficient solutions for larger instances using Nearest Neighbor, Cheapest Insertion, 2-Opt, 3-Opt, and Or-Opt.
  • Metaheuristics: Employs Simulated Annealing, Genetic Algorithms, and Ant Colony Optimization for complex problems.
  • Google OR-Tools: Leverages a powerful solver for practical, large-scale TSP instances.
  • Use Case: A logistics company needs to find the most efficient delivery route for its fleet, visiting 50 different customer locations. This Skill can calculate the optimal sequence of stops to minimize fuel consumption and delivery time.

Quick Start

Use the traveling-salesman-problem skill to find the shortest route for 10 cities using the provided distance matrix.

Frequently Asked Questions about traveling-salesman-problem

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is the best way to optimize delivery routes for logistics operations?

To optimize delivery routes, this Skill solves the Traveling Salesman Problem by finding the shortest route visiting each city exactly once. It uses Google OR-Tools and metaheuristics to minimize travel distance for large-scale logistics instances.

How do I solve the Traveling Salesman Problem using Google OR-Tools and PuLP?

To solve the Traveling Salesman Problem, use PuLP for Mixed-Integer Programming on medium instances or Google OR-Tools for large-scale routing. Both dependencies are supported to calculate optimal sequences and minimize distance.

When should I use heuristics like 2-Opt versus exact algorithms for route optimization?

Use exact algorithms like Held-Karp for small instances requiring optimal solutions, and heuristics like 2-Opt or metaheuristics such as Simulated Annealing for larger route optimization problems where near-optimal efficiency is acceptable.

Can I use Simulated Annealing and Genetic Algorithms for combinatorial optimization in Python?

Yes, this Skill implements Simulated Annealing, Genetic Algorithms, and Ant Colony Optimization in Python to find efficient solutions for complex Traveling Salesman Problem instances and combinatorial optimization challenges.

What are the limitations of using Nearest Neighbor heuristics for TSP?

Nearest Neighbor heuristics provide fast but often suboptimal Traveling Salesman Problem routes, making them suitable only as an initial solution before applying refinement methods like 2-Opt or 3-Opt to improve distance minimization.