We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 665559b commit ab01e81Copy full SHA for ab01e81
src/bmssp.mjs
@@ -13,11 +13,11 @@ class BMSSP {
13
// Add node IDs to the set
14
this.nodeIDs.add(edge[0]);
15
this.nodeIDs.add(edge[1]);
16
+ }
17
- // Initialize shortest paths with Infinity on each nodeID
18
- for (let nodeId of this.nodeIDs) {
19
- this.shortestPaths.push([nodeId, Infinity]);
20
- }
+ // Initialize shortest paths with Infinity on each nodeID (after all nodes are collected)
+ for (let nodeId of this.nodeIDs) {
+ this.shortestPaths.push([nodeId, Infinity]);
21
}
22
23
0 commit comments