Skip to content

Commit

Permalink
fix small bug with graph in shortest path
Browse files Browse the repository at this point in the history
  • Loading branch information
spirosmaggioros committed Sep 7, 2024
1 parent 1e6e925 commit 40dd101
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/classes/graph/graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,7 @@ template <typename T> double weighted_graph<T>::shortest_path(T start, T end) {
dist[start] = 0;
while (!pq.empty()) {
T currentNode = pq.top().second;
T currentDist = pq.top().first;
double currentDist = pq.top().first;
pq.pop();
for (std::pair<T, double> &edge : adj[currentNode]) {
if (currentDist + edge.second < dist[edge.first]) {
Expand Down

0 comments on commit 40dd101

Please sign in to comment.