This project demonstrates the use of Genetic Algorithms (GA) to solve the Travelling Salesman Problem (TSP). The TSP is a classic optimization problem where the goal is to find the shortest possible route that visits each city exactly once and returns to the origin city. To enhance performance, this implementation leverages CUDA for parallel computing.
- TSP_GA_CUDA.sln: The Visual Studio solution file for the project.
- TSP_GA_CUDA.vcxproj: The Visual Studio project file which contains the configuration for building the project.
- TSP_GA_CUDA.vcxproj.filters: This file contains filters for organizing the project files in Visual Studio.
- ga_kernels.cu: CUDA kernels implementing the genetic algorithm operations such as selection, crossover, and mutation.
- ga_kernels.cuh: Header file for
ga_kernels.cu
, declaring the CUDA kernel functions. - main.cu: The main file that initializes the TSP problem, sets up the GA, and handles the execution flow of the program.
- utils.cpp: Contains utility functions used throughout the project.
- utils.h: Header file for
utils.cpp
, declaring utility functions.
- Visual Studio with CUDA toolkit installed.
- CUDA Toolkit
- Clone the repository:
git clone https://github.com/yourusername/TSP_GA_CUDA.git
- Open the solution file TSP_GA_CUDA.sln in Visual Studio
- Build the solution by selecting Build > Build Solution or pressing Ctrl+Shift+B
After building the project, you can run the executable generated in the x64/Debug or x64/Release directory, depending on your build configuration. Or you can execute it directly on VS