diff --git a/Graphs/NodeNeighbors.js b/Graphs/NodeNeighbors.js index 473cdf0f1..74d582525 100644 --- a/Graphs/NodeNeighbors.js +++ b/Graphs/NodeNeighbors.js @@ -16,7 +16,7 @@ class Graph { nodeNeighbors (node) { // Returns an array with all of the node neighbors - const neighbors = [] + const neighbors = new Set() for (let i = 0; i < this.edges.length; i++) { // Checks if they have an edge between them and if the neighbor is not // already in the neighbors array