https://github.com/analiaburgosdev/java_greedy_traveling-salesman
The **Traveling Salesman Problem (TSP)** consists of finding the shortest route for a traveler to visit all cities in a weighted graph and return to the starting city. Given a **complete graph** where all cities are interconnected, the goal is to implement an **approximate algorithm** to solve the problem.
https://github.com/analiaburgosdev/java_greedy_traveling-salesman
greedy-algorithms java
Last synced: about 1 year ago
JSON representation
The **Traveling Salesman Problem (TSP)** consists of finding the shortest route for a traveler to visit all cities in a weighted graph and return to the starting city. Given a **complete graph** where all cities are interconnected, the goal is to implement an **approximate algorithm** to solve the problem.
- Host: GitHub
- URL: https://github.com/analiaburgosdev/java_greedy_traveling-salesman
- Owner: analiaBurgosDev
- Created: 2025-03-26T23:12:25.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-26T23:14:52.000Z (over 1 year ago)
- Last Synced: 2025-06-11T23:41:37.805Z (about 1 year ago)
- Topics: greedy-algorithms, java
- Language: Java
- Homepage:
- Size: 5.86 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Problema del Viajante (TSP)
## Descripción del Problema
El **problema del viajante (TSP)** consiste en encontrar la ruta más corta que permita a un viajante visitar todas las ciudades en un grafo ponderado y regresar a la ciudad de origen. Dado un **grafo completo** donde todas las ciudades están interconectadas, el objetivo es implementar un **algoritmo aproximado** para resolver el problema.
## Enfoque
Dado que encontrar la solución óptima es computacionalmente costoso (problema NP-hard), se emplean **heurísticas de aproximación** como:
- **Algoritmo del Vecino Más Cercano**: Selecciona iterativamente la ciudad más cercana aún no visitada.
- **Algoritmo de Inserción Más Barata**: Construye la ruta insertando en cada paso la ciudad con menor costo adicional.
- **Algoritmos Basados en Árbol de Expansión Mínima (MST)**: Generan una solución basada en un MST modificado.
## Aplicaciones
TSP tiene aplicaciones en:
- **Logística y Planificación de Rutas**: Optimización de recorridos para servicios de entrega.
- **Fabricación y Robótica**: Optimización de trayectorias para máquinas automatizadas.
- **Diseño de Redes**: Conexión eficiente de nodos en infraestructuras de telecomunicaciones.
----------------------------------------------------
# Traveling Salesman Problem (TSP)
## Problem Description
The **Traveling Salesman Problem (TSP)** consists of finding the shortest route for a traveler to visit all cities in a weighted graph and return to the starting city. Given a **complete graph** where all cities are interconnected, the goal is to implement an **approximate algorithm** to solve the problem.
## Approach
Since finding the optimal solution is computationally expensive (NP-hard problem), we use **approximate heuristics** such as:
- **Nearest Neighbor Algorithm**: Iteratively selects the closest unvisited city.
- **Cheapest Insertion Algorithm**: Builds the route by inserting the most cost-efficient city at each step.
- **Minimum Spanning Tree (MST)-based Algorithms**: Generates a solution using a modified MST approach.
## Applications
TSP has real-world applications in:
- **Logistics and Delivery Planning**: Optimizing travel routes for delivery services.
- **Manufacturing and Robotics**: Optimizing movement paths for automated machines.
- **Network Design**: Efficiently connecting network nodes in infrastructure planning.