Skip to content

Repository files navigation

README for Alex's COMP5012 coursework repository

How to build:

  • Clone this repository to your local computer
  • Requirements are pygame and numpy which can be installed on your virtual environment using the following commands:
   pip install pygame
   pip install numpy

How to run:

  • This was originally made in visual studio community edition 2022 (17.13.6) and has visual studio .sln files if wanted
  • If visual studio is not used to run the program, simply run Travelling_Salesman.py using your environment and preferred IDE

How to use:

  • When the program begins, there will be a prompt asking you to enter the number of generations you wish to start with. Enter a number as a response. Each generation takes time to compute so I reccomend somewhere around 10 generations which took approximately 1 minute 40 to finish (an objective space graph of each generation is displayed in the pygame window as they are computed)
  • Ensure the pygame window is selected before trying to interact with it (it is not automatically selected on creation)
  • Instructions for controls are given on the pygame screen and are as follows:
 - "Press space to create the next generation"
 - "Use the arrow keys to scroll around the screen"
 - "Press enter to run pareto distance optimisation"
 - "Press S to enter selection mode"
  • entering into select mode the following instructions will appear:
 - "Use arrow keys to choose a solution on the pareto front"
 - "Press enter to optimise the distance of selected solution"
 - "Press S to exit selection mode"

Using alternative data

  • the code runs using data from vrp8.txt but this can be changed to use vrp9.txt or vrp10.txt on this line in Travelling_Salesman.py
...
with open("data//vrp8.txt", "r") as f:
...
  • if you wish to use other data create another .txt file in the same format as vrp8.txt

About

Repository containing code for the COMP5012 optimisation coursework

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages