diff options
| author | MZuenni <michi.zuendorf@gmail.com> | 2023-03-01 11:36:26 +0100 |
|---|---|---|
| committer | MZuenni <michi.zuendorf@gmail.com> | 2023-03-01 11:36:26 +0100 |
| commit | 12afe719ce268bb10aa93a910079a44eb08999b8 (patch) | |
| tree | 0937a117287eebe3942e0506d27143eff4980d09 /graph/bellmannFord.cpp | |
| parent | ad8456f7c5d44d3c647b3a368050a5d2f39ae3c3 (diff) | |
removed trailing whitespaces and use more structured bindings
Diffstat (limited to 'graph/bellmannFord.cpp')
| -rw-r--r-- | graph/bellmannFord.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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<edge> 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; |
