Skip to content

Commit

Permalink
✏️ change = to + in bellman ford algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
aniketgargya committed Apr 17, 2023
1 parent ec29b36 commit 1a8ce6b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ d(s) = 0
for k = 1 to n - 1 do
for each v in V do
for each edge (u, v) in In(v) do
d(v) = min(d(v), d(u) = l(u, v))
d(v) = min(d(v), d(u) + l(u, v))

for each v in V do
for each edge (u, v) in In(v) do
Expand Down
2 changes: 1 addition & 1 deletion src/lecture19/code/bellman-ford.sudo
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ d(s) = 0
for k = 1 to n - 1 do
for each v in V do
for each edge (u, v) in In(v) do
d(v) = min(d(v), d(u) = l(u, v))
d(v) = min(d(v), d(u) + l(u, v))

for each v in V do
dist(s, v) = d(v)

0 comments on commit 1a8ce6b

Please sign in to comment.