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

Commite43fa7d

Browse files
1 parentb92e791 commite43fa7d

File tree

7 files changed

+185
-175
lines changed

7 files changed

+185
-175
lines changed

‎main/feed_json_updated.json‎

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

‎main/feed_rss_created.xml‎

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

‎main/feed_rss_updated.xml‎

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

‎main/graph/finding-negative-cycle-in-graph.html‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6614,6 +6614,10 @@
66146614

66156615

66166616

6617+
6618+
6619+
6620+
66176621

66186622

66196623

@@ -6622,6 +6626,8 @@
66226626

66236627

66246628

6629+
6630+
66256631

66266632

66276633

@@ -6754,6 +6760,10 @@
67546760

67556761

67566762

6763+
6764+
6765+
6766+
67576767

67586768

67596769

@@ -6766,7 +6776,7 @@
67666776
<ulclass="metadata page-metadata"data-bi-name="page info"lang="en-us"dir="ltr">
67676777

67686778
Last update:
6769-
<spanclass="git-revision-date-localized-plugin git-revision-date-localized-plugin-date"title="April 16, 202500:46:24 UTC">April 16, 2025</span>&emsp;
6779+
<spanclass="git-revision-date-localized-plugin git-revision-date-localized-plugin-date"title="September 10, 202506:18:21 UTC">September 10, 2025</span>&emsp;
67706780

67716781
<!-- Tags -->
67726782

@@ -6800,7 +6810,7 @@ <h2 id="using-bellman-ford-algorithm">Using Bellman-Ford algorithm<a class="head
68006810
<p>Bellman-Ford algorithm allows you to check whether there exists a cycle of negative weight in the graph, and if it does, find one of these cycles.</p>
68016811
<p>The details of the algorithm are described in the article on the<ahref="bellman_ford.html">Bellman-Ford</a> algorithm.
68026812
Here we'll describe only its application to this problem.</p>
6803-
<p>The standard implementation of Bellman-Ford looks for a negative cycle reachable from some starting vertex<spanclass="arithmatex">$v$</span> ; however, the algorithm can be modified to justlooking for any negative cycle in the graph.
6813+
<p>The standard implementation of Bellman-Ford looks for a negative cycle reachable from some starting vertex<spanclass="arithmatex">$v$</span> ; however, the algorithm can be modified to justlook for any negative cycle in the graph.
68046814
For this we need to put all the distance  <spanclass="arithmatex">$d[i]$</span>  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.</p>
68056815
<p>Do<spanclass="arithmatex">$N$</span> 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.</p>
68066816
<h3id="implementation">Implementation<aclass="headerlink"href="#implementation"title="Permanent link">&para;</a></h3>
@@ -6880,7 +6890,7 @@ <h2 id="practice-problems">Practice Problems<a class="headerlink" href="#practic
68806890

68816891
<ulclass="metadata page-metadata"data-bi-name="page info"lang="en-us"dir="ltr">
68826892
<spanclass="contributors-text">Contributors:</span>
6883-
<ulclass="contributors"data-bi-name="contributors"><li><ahref="https://github.com/jakobkogler"title="jakobkogler"data-bi-name="contributorprofile"target="_blank">jakobkogler</a> (36.7%)</li><li><ahref="https://github.com/mukeshkharita"title="mukeshkharita"data-bi-name="contributorprofile"target="_blank">mukeshkharita</a> (35.78%)</li><li><ahref="https://github.com/tcNickolas"title="tcNickolas"data-bi-name="contributorprofile"target="_blank">tcNickolas</a> (7.34%)</li><li><ahref="https://github.com/adamant-pwn"title="adamant-pwn"data-bi-name="contributorprofile"target="_blank">adamant-pwn</a> (5.5%)</li><li><ahref="https://github.com/likecs"title="likecs"data-bi-name="contributorprofile"target="_blank">likecs</a> (3.67%)</li><li><ahref="https://github.com/mhayter"title="mhayter"data-bi-name="contributorprofile"target="_blank">mhayter</a> (2.75%)</li><li><ahref="https://github.com/svaderia"title="svaderia"data-bi-name="contributorprofile"target="_blank">svaderia</a> (2.75%)</li><li><ahref="https://github.com/sunil-sangwan"title="sunil-sangwan"data-bi-name="contributorprofile"target="_blank">sunil-sangwan</a> (2.75%)</li><li><ahref="https://github.com/Harsh-Mathur-1503"title="Harsh-Mathur-1503"data-bi-name="contributorprofile"target="_blank">Harsh-Mathur-1503</a> (1.83%)</li><li><ahref="https://github.com/deepanshu-Raj"title="deepanshu-Raj"data-bi-name="contributorprofile"target="_blank">deepanshu-Raj</a> (0.92%)</li></ul>
6893+
<ulclass="contributors"data-bi-name="contributors"><li><ahref="https://github.com/jakobkogler"title="jakobkogler"data-bi-name="contributorprofile"target="_blank">jakobkogler</a> (36.7%)</li><li><ahref="https://github.com/mukeshkharita"title="mukeshkharita"data-bi-name="contributorprofile"target="_blank">mukeshkharita</a> (35.78%)</li><li><ahref="https://github.com/tcNickolas"title="tcNickolas"data-bi-name="contributorprofile"target="_blank">tcNickolas</a> (7.34%)</li><li><ahref="https://github.com/adamant-pwn"title="adamant-pwn"data-bi-name="contributorprofile"target="_blank">adamant-pwn</a> (5.5%)</li><li><ahref="https://github.com/likecs"title="likecs"data-bi-name="contributorprofile"target="_blank">likecs</a> (3.67%)</li><li><ahref="https://github.com/mhayter"title="mhayter"data-bi-name="contributorprofile"target="_blank">mhayter</a> (2.75%)</li><li><ahref="https://github.com/sunil-sangwan"title="sunil-sangwan"data-bi-name="contributorprofile"target="_blank">sunil-sangwan</a> (2.75%)</li><li><ahref="https://github.com/Harsh-Mathur-1503"title="Harsh-Mathur-1503"data-bi-name="contributorprofile"target="_blank">Harsh-Mathur-1503</a> (1.83%)</li><li><ahref="https://github.com/svaderia"title="svaderia"data-bi-name="contributorprofile"target="_blank">svaderia</a> (1.83%)</li><li><ahref="https://github.com/aleksmish"title="aleksmish"data-bi-name="contributorprofile"target="_blank">aleksmish</a> (0.92%)</li><li><ahref="https://github.com/deepanshu-Raj"title="deepanshu-Raj"data-bi-name="contributorprofile"target="_blank">deepanshu-Raj</a> (0.92%)</li></ul>
68846894
</ul>
68856895

68866896
</article>

‎main/search/search_index.json‎

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp