From a660140f498396512f094ee562bb158f859a6adb Mon Sep 17 00:00:00 2001 From: rui hildt Date: Sat, 8 Feb 2020 21:09:36 +0100 Subject: [PATCH] Remove unused files --- data/test_data/cities.js | 50 ------------------------ data/test_data/roads.js | 84 ---------------------------------------- helpers/test_dijkstra.js | 18 --------- 3 files changed, 152 deletions(-) delete mode 100644 data/test_data/cities.js delete mode 100644 data/test_data/roads.js delete mode 100644 helpers/test_dijkstra.js diff --git a/data/test_data/cities.js b/data/test_data/cities.js deleted file mode 100644 index 214f0c4..0000000 --- a/data/test_data/cities.js +++ /dev/null @@ -1,50 +0,0 @@ -module.exports = [{ - "id": 1, - "name": 'bruges', - "country_id": 1 -}, -{ - "id": 2, - "name": 'antwerp', - "country_id": 1 -}, -{ - "id": 3, - "name": 'ghent', - "country_id": 1 -}, -{ - "id": 4, - "name": 'mechelen', - "country_id": 1 -}, -{ - "id": 5, - "name": 'brussels', - "country_id": 1 -}, -{ - "id": 6, - "name": 'mons', - "country_id": 1 -}, -{ - "id": 7, - "name": 'namur', - "country_id": 1 -}, -{ - "id": 8, - "name": 'liege', - "country_id": 1 -}, -{ - "id": 9, - "name": 'arlon', - "country_id": 1 -}, -{ - "id": 10, - "name": 'tournai', - "country_id": 1 -}] \ No newline at end of file diff --git a/data/test_data/roads.js b/data/test_data/roads.js deleted file mode 100644 index 9cd47eb..0000000 --- a/data/test_data/roads.js +++ /dev/null @@ -1,84 +0,0 @@ -module.exports = [{ -"id": 1, -"start_city_id": 1, -"end_city_id": 3, -"distance": 50 -}, -{ -"id": 2, -"start_city_id": 3, -"end_city_id": 10, -"distance": 80 -}, -{ -"id": 3, -"start_city_id": 10, -"end_city_id": 5, -"distance": 89 -}, -{ -"id": 4, -"start_city_id": 3, -"end_city_id": 5, -"distance": 56 -}, -{ -"id": 5, -"start_city_id": 3, -"end_city_id": 2, -"distance": 60 -}, -{ -"id": 6, -"start_city_id": 2, -"end_city_id": 4, -"distance": 25 -}, -{ -"id": 7, -"start_city_id": 4, -"end_city_id": 5, -"distance": 27 -}, -{ -"id": 8, -"start_city_id": 5, -"end_city_id": 6, -"distance": 80 -}, -{ -"id": 9, -"start_city_id": 6, -"end_city_id": 7, -"distance": 91 -}, -{ -"id": 10, -"start_city_id": 6, -"end_city_id": 10, -"distance": 51 -}, -{ -"id": 11, -"start_city_id": 7, -"end_city_id": 9, -"distance": 129 -}, -{ -"id": 12, -"start_city_id": 9, -"end_city_id": 7, -"distance": 123 -}, -{ -"id": 13, -"start_city_id": 8, -"end_city_id": 7, -"distance": 65 -}, -{ -"id": 14, -"start_city_id": 8, -"end_city_id": 5, -"distance": 97 -}] \ No newline at end of file diff --git a/helpers/test_dijkstra.js b/helpers/test_dijkstra.js deleted file mode 100644 index f07b860..0000000 --- a/helpers/test_dijkstra.js +++ /dev/null @@ -1,18 +0,0 @@ -const searchPath = require('../helpers/dijkstra_algo'); -const cities = require('../data/test_data/cities'); -const roads = require('../data/test_data/roads'); - -let { path, distance} = searchPath(cities, roads, 1, 9); - -const formatedPath = []; - -// I didn't use map or filter because it doesn't preserve the order -for (let path_city of path) { - for (let city of cities) { - if (city.id == path_city) { - formatedPath.push({ id: city.id, name: city.name }); - } - } -} - -console.log(formatedPath) \ No newline at end of file