From 12afe719ce268bb10aa93a910079a44eb08999b8 Mon Sep 17 00:00:00 2001 From: MZuenni Date: Wed, 1 Mar 2023 11:36:26 +0100 Subject: removed trailing whitespaces and use more structured bindings --- graph/bellmannFord.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'graph/bellmannFord.cpp') diff --git a/graph/bellmannFord.cpp b/graph/bellmannFord.cpp index 730cad2..785a42d 100644 --- a/graph/bellmannFord.cpp +++ b/graph/bellmannFord.cpp @@ -4,7 +4,7 @@ void bellmannFord(int n, vector edges, int start) { for (int i = 1; i < n; i++) { for (edge& e : edges) { - if (dist[e.from] != INF && + if (dist[e.from] != INF && dist[e.from] + e.cost < dist[e.to]) { dist[e.to] = dist[e.from] + e.cost; parent[e.to] = e.from; -- cgit v1.2.3