Visualising the TSM problem in the context of local pubs.
Call this function to run the code
git clone https://github.com/abhyuday10/TSM-Visualisation
pip install -r requirements.txt
- Create a list of locations
from map import * NamesOfLocations = ['Oculus', 'Tesco']
You may want to restrict the search area by changing the value of maps.RESTRICTEDTO
-
Create a map generator object, and pass in the list
generator = MapGenerator(NamesOfLocations)
-
Decode them into a list of Location objects
locations = generator.decodeLocations()
You may do all calculations using these objects
Attribute Meaning name Location Name latitude Latitude longitude Longitude distanceTo() Distance to another location object in metres -
To render them on a map, specify the location objects to render, in the order required
generator.renderLocations(locationObjectsToRender)