From 4321a29416164725555b205c7d1ad8df021ba90e Mon Sep 17 00:00:00 2001 From: "Aengus.Jiang" Date: Fri, 20 May 2022 17:13:56 +0800 Subject: [PATCH] Fix Dijkstra can not work with DirectedWeightedEdge #205 (#206) * Fix Dijkstra can not work with DirectedWeightedEdge #205 * Fix Dijkstra can not work with DirectedWeightedEdge #205 --- include/Graph/Graph.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/Graph/Graph.hpp b/include/Graph/Graph.hpp index eeb51d154..2f867600c 100644 --- a/include/Graph/Graph.hpp +++ b/include/Graph/Graph.hpp @@ -1004,9 +1004,9 @@ namespace CXXGRAPH // setting all the distances initially to INF_DOUBLE std::unordered_map *, double> dist; - for (const auto &elem : adj) + for (const auto &node : nodeSet ) { - dist[elem.first] = INF_DOUBLE; + dist[node] = INF_DOUBLE; } // creating a min heap using priority queue