Bachelor thesis - July 2024
Before you can compile and run this program, make sure you have the following prerequisites installed on your system:
-
Homebrew (for package management)
To install Homebrew, open your terminal and run this command:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
You can use the link for detailled installation directives.
-
g++-13
To install this version of the compiler for C++, open your terminal and run this command:
brew install gcc
-
MinGW-w64 (for GCC)
- Download and install from Mingw-w64.
-
Add MinGW-w64 to PATH
- Add the path to the
bin
directory of your MinGW-w64 installation to the system environment variables.
- Add the path to the
Open your terminal and navigate to the project directory. Use the following command to compile the program:
/usr/local/bin/g++-13 -fdiagnostics-color=always -g chromosome.cpp crossover.cpp distance_helper.cpp file_reader.cpp mutation.cpp point.cpp population.cpp tsp_ga.cpp main.cpp -o executable_output
Open your Command Prompt (or PowerShell) and navigate to the project directory. Use the following command to compile the program:
g++ -g chromosome.cpp crossover.cpp distance_helper.cpp file_reader.cpp mutation.cpp point.cpp population.cpp tsp_ga.cpp main.cpp -o executable_output.exe
After compiling, you can run the executable. Make sure that you put the executable in the project directory folder src
, otherwise add your dataset in an outer directory from your executable, in a folder named data
.
Run the following command in your terminal, which is navigated to the correct directory:
./executable_output
*You might need to add the sudo
prefix to your command, depending on the needed permissions for acceess
Run the following command in your Command Prompt (or PowerShell), which is navigated to the correct directory:
executable_output.exe