Skip to content

ERElli/CS3201-Final

Repository files navigation

CS3201-Final

  1. Accessing the code
    1.1) Navigate to https://github.com/ERElli/CS3201-Final
    1.2) Click on “# branches”
    1.3) Click on “locations”
    1.4) Click on “Clone or Download”
    1.5) Download as a zip file of clone the repository

  2. Running the Code 2.1) Dependencies
    2.1.1) Navigate to https://matplotlib.org/users/installing.html and follow the build instructions that apply to your system
    2.2) In your terminal, navigate to the code directory in the project
    2.3) Type the following command: python3 main.py CountryName Where CountryName is WesternSahara, Uruguay or Canada (please see section 3 if you wish to run using Canada)
    2.4) Both the minimum path length and average path length for each generation is printed to the terminal
    2.5) Once the code has finished executing, all the individuals who have the best fitness are displayed and one of these paths are plotted

  3. Generating Distance Files
    Because the Canada.pickle file was so large, we were not able to upload it to github. Please follow instruction 3.3 below to generate the Canada.pickle file.

    The main code requires a serialized array of the distances of each city to all other cities If you wish to incorporate more countries you can follow the following instructions
    3.1) Given a text file with lines of the form:
    CityNumber X-Coordinate Y-Coordinate
    3.2) Make sure the text file is in the same directory as the code
    3.3) In the terminal, navigate to the directory containing the code
    3.3) Type the following command:
    python3 TSPTextFilename CountryName.pickle
    3.4) In main.py, in the getTSPfilename function you will have to add the following lines:
    elif countryName == "CountryName":
    filename = "pathToTSPTextfile"

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages