-
Step 1: Open the command prompt/terminal. Go inside the
terminal
folder. -
Step 2: Compile the project using the following command:
g++ -Wall *.cpp -o aco
g++
: Denotes the compiler used (GNU compiler).-Wall
: Enables all warnings.*.cpp
: Compiles all the files inside thesrc
folder.-o aco
: Specifies the output file name.
-
Step 3: Provide the points in the
points.txt
file in the formatx y
, and the result will also be stored inresult.txt
. -
Step 4: Run the executable using:
start aco.exe
-
Step 5: The program will ask you for the number of iterations, the number of ants, and the number of cities. It will then build a complete graph.
-
Step 6: The program will give you the most optimal route.
- This method requires you to install OpenCV from its official website: OpenCV Official Website.
- Add the
bin
folder path to the user variables and system variables paths. - Now open VS Code and configure using CMake.
- Use only the MS compiler for C++ configuration because OpenCV doesn't work with the MinGW compiler.
- Build the project and run the
main.cpp
file. - A map of India will appear. Mark the required number of cities on the map and then press
ESC
. - Leave the VS Code terminal running.
- Open the command prompt/terminal. Go inside the
terminal
folder. - Compile the project using the following command:
g++ -Wall *.cpp -o aco
g++
: Denotes the compiler used (GNU compiler).-Wall
: Enables all warnings.*.cpp
: Compiles all the files inside thesrc
folder.-o aco
: Specifies the output file name.
- Run the executable using:
start aco.exe
- The program will ask you for the number of iterations, the number of ants, and the number of cities. It will build a complete graph.
- The program exits, giving us the best route.
- Go to the VS Code terminal and enter any digit.
- Now it should display the optimal route on the map.
- Press
ESC
to exit.
- Object Detection does not work with the MinGW compiler.
- Also, do not forget to change the path of
jennai.jpg
,result.txt
, andpoints.txt
, otherwise the program will not work for Method 2 using OpenCV. - To run Object Detection, VS Code build tools must be downloaded, which contains the MS C++ compiler.