Výskum a vylepšenie algoritmov na riešenie problému obchodného cestujúceho (TSP)
Research and improvement of algorithms for solving the traveling salesman problem (TSP)
Problém obchodného cestujúceho (Traveling Salesman Problem - TSP) je jedným z najznámejších problémov v oblasti kombinatorickej optimalizácie. Problém spočíva v nájdení najkratšej možnej trasy, ktorá prechádza všetkými zadanými bodmi (mestami) práve raz a vracia sa do východiskového bodu.
The Traveling Salesman Problem (TSP) is one of the most famous problems in combinatorial optimization. The problem consists of finding the shortest possible route that passes through all given points (cities) exactly once and returns to the starting point.
TSP je NP-ťažký problém, čo znamená, že neexistuje známy algoritmus, ktorý by ho riešil v polynomiálnom čase. Pre praktické aplikácie sa preto používajú rôzne heuristické a aproximačné algoritmy, ktoré poskytujú dostatočne dobré riešenia v rozumnom čase.
TSP is an NP-hard problem, which means that there is no known algorithm that would solve it in polynomial time. For practical applications, various heuristic and approximation algorithms are therefore used, which provide sufficiently good solutions in a reasonable time.
Metóda najbližšieho suseda (Nearest Neighbor) je jedným z najjednoduchších a najrýchlejších algoritmov na riešenie TSP. Algoritmus začína v ľubovoľnom bode a postupne navštevuje najbližší ešte nenavštívený bod, až kým neprejde všetky body.
The Nearest Neighbor method is one of the simplest and fastest algorithms for solving TSP. The algorithm starts at any point and gradually visits the closest not yet visited point until it passes through all points.
Hoci je tento algoritmus veľmi rýchly, jeho výsledky často nie sú optimálne. V rámci môjho výskumu som vyvinul optimalizáciu tejto metódy, ktorá výrazne zlepšuje kvalitu výsledkov bez významného zvýšenia výpočtovej náročnosti.
Although this algorithm is very fast, its results are often not optimal. As part of my research, I developed an optimization of this method that significantly improves the quality of results without significantly increasing computational complexity.
Kľúčové vylepšenia zahŕňajú:
Key improvements include:
Tieto vylepšenia vedú k výraznému zlepšeniu kvality výsledkov, pričom zachovávajú rýchlosť a jednoduchosť pôvodného algoritmu.
These improvements lead to a significant improvement in the quality of results while maintaining the speed and simplicity of the original algorithm.
Okrem optimalizácie existujúcich algoritmov som vyvinul aj úplne nový algoritmus na riešenie TSP, nazvaný "Robopol algoritmus". Tento algoritmus je založený na princípe postupného pridávania bodov do trasy a jej priebežnej optimalizácie.
In addition to optimizing existing algorithms, I have also developed a completely new algorithm for solving TSP, called the "Robopol algorithm". This algorithm is based on the principle of gradually adding points to the route and continuously optimizing it.
Kľúčové vlastnosti Robopol algoritmu:
Key features of the Robopol algorithm:
Robopol algoritmus využíva NUMBA funkcie, ktoré konvertujú kód do strojového kódu pri prvom spustení, čo výrazne zrýchľuje následné výpočty. Tento prístup umožňuje efektívne spracovanie veľkých inštancií problému.
The Robopol algorithm uses NUMBA functions that convert the code to machine code during the first run, which significantly speeds up subsequent calculations. This approach allows for efficient processing of large problem instances.
Podrobný popis algoritmu a jeho implementácia sú dostupné v článku TSP - metóda postupného pridávania bodov Robopol.
A detailed description of the algorithm and its implementation are available in the article TSP - gradual point addition method Robopol.
V rámci výskumu som vykonal rozsiahle porovnanie rôznych algoritmov na riešenie TSP, vrátane:
As part of the research, I conducted an extensive comparison of various algorithms for solving TSP, including:
Výkonnostné testy ukázali, že:
Performance tests showed that:
Podrobné výsledky porovnania sú dostupné v článku Obchodný cestujúci - porovnanie algoritmov TSP.
Detailed comparison results are available in the article Traveling Salesman - comparison of TSP algorithms.
Jednou z zaujímavých aplikácií výskumu TSP algoritmov je tzv. TSP Art - technika vytvárania umeleckých diel pomocou riešenia problému obchodného cestujúceho. Princíp spočíva v konverzii obrázka na množinu bodov a následnom nájdení optimálnej trasy, ktorá prechádza všetkými bodmi.
One of the interesting applications of TSP algorithm research is the so-called TSP Art - a technique of creating artworks by solving the traveling salesman problem. The principle consists of converting an image into a set of points and then finding the optimal route that passes through all points.
Výsledkom je jediná spojitá čiara, ktorá vytvára vizuálne zaujímavý obraz. Táto technika je obzvlášť pôsobivá pri použití veľkého počtu bodov (desaťtisíce až státisíce).
The result is a single continuous line that creates a visually interesting image. This technique is particularly impressive when using a large number of points (tens to hundreds of thousands).
Vďaka vysokej efektívnosti vyvinutých algoritmov je možné vytvárať TSP Art s veľkým počtom bodov v rozumnom čase.
Thanks to the high efficiency of the developed algorithms, it is possible to create TSP Art with a large number of points in a reasonable time.
Výsledky výskumu TSP algoritmov majú široké praktické využitie v rôznych oblastiach:
The results of TSP algorithm research have a wide practical use in various areas:
Vyvinuté algoritmy sú implementované v programe TSP Solver, ktorý poskytuje užívateľsky prívetivé rozhranie pre riešenie TSP problémov v praxi.
The developed algorithms are implemented in the TSP Solver program, which provides a user-friendly interface for solving TSP problems in practice.