Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitda9e74b

Browse files
authored
Merge pull request#1522 from aleksmish/patch-5
fix typo
2 parents2b6905a +2f29662 commitda9e74b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/graph/bellman_ford.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ Due to the presence of a negative cycle, for $n$ iterations of the algorithm, th
201201
d[e.b] = max(-INF, d[e.a] + e.cost);
202202
```
203203

204-
The above implementation looks for a negative cycle reachable from some starting vertex $v$; however, the algorithm can be modified to justlooking for any negative cycle in the graph. For this we need to put all the distance $d[i]$ to zero and not infinity — as if we are looking for the shortest path from all vertices simultaneously; the validity of the detection of a negative cycle is not affected.
204+
The above implementation looks for a negative cycle reachable from some starting vertex $v$; however, the algorithm can be modified to justlook for any negative cycle in the graph. For this we need to put all the distance $d[i]$ to zero and not infinity — as if we are looking for the shortest path from all vertices simultaneously; the validity of the detection of a negative cycle is not affected.
205205

206206
For more on this topic — see separate article,[Finding a negative cycle in the graph](finding-negative-cycle-in-graph.md).
207207

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp