Developed with JetBrains WebStorm. Using it is optional, but will produce better-printed results on the console.
- Clone the repository
- Open a command prompt/terminal in the cloned project folder
- Run this command to install the project dependencies
$ npm install
- Run this command to build and run the project
$ node index.js
You just have to build and run, the project will look for a file coordenadas.csv
in the same folder for importing the coordinates. Then it will calculate the matrix of distances using the haversine formula, and lastly, it will determine the shortest distances between all cities. It will print on the console all the three steps results.
- csvtojson: Used for reading the CSV file.
- haversine: Used for calculating the distance between two coordinates.
- floyd-warshall: Used for determining the shortest distances between all cities.
- console.table: Used for a better-printed matrix on the console