(node)
| 6 | } |
| 7 | |
| 8 | addNode(node) { |
| 9 | // Function to add a node to the graph (connection represented by set) |
| 10 | this.connections[node] = {} |
| 11 | } |
| 12 | |
| 13 | addEdge(node1, node2, weight) { |
| 14 | // Function to add an edge (adds the node too if they are not present in the graph) |