Skip to content

Commit

Permalink
Fix Dijkstra can not work with DirectedWeightedEdge #205 (#206)
Browse files Browse the repository at this point in the history
* Fix Dijkstra can not work with DirectedWeightedEdge #205

* Fix Dijkstra can not work with DirectedWeightedEdge #205
  • Loading branch information
aengusjiang committed May 20, 2022
1 parent 52152fc commit 4321a29
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/Graph/Graph.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1004,9 +1004,9 @@ namespace CXXGRAPH
// setting all the distances initially to INF_DOUBLE
std::unordered_map<const Node<T> *, 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
Expand Down

0 comments on commit 4321a29

Please sign in to comment.