Abstract
The Travelling Salesman Problem (TSP) is a fundamental challenge in combinatorial optimization. This study evaluates the performance of a brute-force approach to TSP across three parallel computing paradigms: OpenMP (shared memory), MPI (distributed memory), and CUDA (GPU acceleration). While the implementations achieve significant speedups—peaking at 9520x with CUDA—the results underscore the inherent limitations of brute-force algorithms when faced with factorial complexity.
Introduction
The Travelling Salesman Problem (TSP) requires finding the shortest possible route that visits a set of $N$ cities exactly once and returns to the origin. As an NP-Hard problem, its exact solution is computationally intensive. This paper explores the parallelization of the brute-force method, which evaluates all $(N-1)!$ permutations. Although inefficient for large $N$, brute force is an ideal candidate for parallel benchmarking due to its "embarrassingly parallel" nature, where each permutation can be calculated independently.
Methodology
The research compares a serial baseline against four parallel implementations: OpenMP for shared memory, MPI for distributed processes, a Hybrid (MPI + OpenMP) approach, and CUDA for massively parallel GPU execution on an NVIDIA Tesla V100. Performance was measured using execution time, speedup, and the Karp-Flatt metric to determine the serial fraction of the code across problem sizes $N=8$ to $N=17$.
Performance Analysis: MPI vs. OpenMP
A key finding of the study is that the MPI implementation consistently outperformed OpenMP. For 20 parallel elements, MPI achieved a speedup of approximately 18x, while OpenMP reached only 12x. This discrepancy is attributed to the overhead of thread management in OpenMP compared to the relatively efficient inter-process communication in MPI for this specific workload.
The Karp-Flatt analysis further revealed that as problem size $N$ increases, the serial fraction $e(N, p)$ generally decreases. This indicates that the computational load eventually dwarfs the parallelization overhead, confirming the "embarrassingly parallel" nature of the brute-force approach.
GPU Acceleration and the "Brute Force Wall"
The CUDA implementation provided the most significant performance gains. For $N=13$, the execution time dropped from approximately 395 seconds in the serial version to just 0.086 seconds on the GPU. By $N=17$, the estimated speedup reached a staggering 9520x.
Despite these gains, the factorial growth of the problem remains a hard barrier. As shown in the CUDA execution time trends, the time required increases exponentially with $N$ once the overhead is overcome. The authors estimate that even with high-end GPU acceleration, $N=18$ would require over 8 hours of computation, demonstrating that hardware cannot indefinitely compensate for algorithmic inefficiency.
Conclusion
Parallel computing paradigms like MPI and CUDA offer powerful tools for tackling computationally expensive problems. However, for TSP, the $O(N!)$ complexity of brute force quickly outpaces even the most advanced hardware. Future research should focus on applying these parallelization techniques to more efficient algorithms, such as Branch-and-Bound or heuristic-based Genetic Algorithms, to solve larger, real-world instances of the problem.
Summary updated