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

Commit2b6905a

Browse files
authored
Merge pull request#1523 from aleksmish/patch-6
fix typo
2 parents5509c60 +5dbf37a commit2b6905a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/graph/01_bfs.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ while (!q.empty()) {
4242
We can notice that the difference between the distances between the source`s` and two other vertices in the queue differs by at most one.
4343
Especially, we know that $d[v] \le d[u] \le d[v] + 1$ for each $u \in Q$.
4444
The reason for this is, that we only add vertices with equal distance or with distance plus one to the queue during each iteration.
45-
Assuming there exists a $u$ in the queue with $d[u] - d[v] > 1$, then $u$ must have beeninsert in the queue via a different vertex $t$ with $d[t] \ge d[u] - 1 > d[v]$.
45+
Assuming there exists a $u$ in the queue with $d[u] - d[v] > 1$, then $u$ must have beeninserted into the queue via a different vertex $t$ with $d[t] \ge d[u] - 1 > d[v]$.
4646
However this is impossible, since Dijkstra's algorithm iterates over the vertices in increasing order.
4747

4848
This means, that the order of the queue looks like this:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp