From 906cce44c281d913db1449815db988ae5ced789b Mon Sep 17 00:00:00 2001 From: Jason Thomas <153630999+jasonthomassql@users.noreply.github.com> Date: Fri, 26 Sep 2025 01:32:32 -0400 Subject: [PATCH] fix: lowestcost to use correct sort fix lexicographic sort issue --- explorer-frontend/src/lib/GraphHelpers.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/explorer-frontend/src/lib/GraphHelpers.js b/explorer-frontend/src/lib/GraphHelpers.js index e1a73a9..3c0360e 100644 --- a/explorer-frontend/src/lib/GraphHelpers.js +++ b/explorer-frontend/src/lib/GraphHelpers.js @@ -31,13 +31,13 @@ function computeEdgeCosts(edges) { for (const edgePair of Object.keys(edgeCosts)) { const costsForThisPair = edgeCosts[edgePair].individualCosts; for (const nodeId of Object.keys(costsForThisPair)) { - costsForThisPair[nodeId].sort().reverse(); + costsForThisPair[nodeId].sort((a, b) => a - b); } } // Compute the lowest cost edge for each pair of nodes for (const edgePair of Object.keys(edgeCosts)) { - edgeCosts[edgePair].lowestCost = 100000000; + edgeCosts[edgePair].lowestCost = Infinity; const costsForThisPair = edgeCosts[edgePair].individualCosts; for (const nodeId of Object.keys(costsForThisPair)) { if (costsForThisPair[nodeId][0] < edgeCosts[edgePair].lowestCost)