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

Commit282d351

Browse files
authored
fix typo
Changed from "to just looking" to "to just look"
1 parentc748a22 commit282d351

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/graph/finding-negative-cycle-in-graph.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Bellman-Ford algorithm allows you to check whether there exists a cycle of negat
1919
The details of the algorithm are described in the article on the[Bellman-Ford](bellman_ford.md) algorithm.
2020
Here we'll describe only its application to this problem.
2121

22-
The standard implementation of Bellman-Ford 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.
22+
The standard implementation of Bellman-Ford 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.
2323
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.
2424

2525
Do $N$ iterations of Bellman-Ford algorithm. If there were no changes on the last iteration, there is no cycle of negative weight in the graph. Otherwise take a vertex the distance to which has changed, and go from it via its ancestors until a cycle is found. This cycle will be the desired cycle of negative weight.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp