简化 O((V + E) logV) 时间复杂度

问题描述 投票:0回答:1

dijkstra算法的时间复杂度为O((V + E) logV)

如果我的图表是 E < V like the image I attached below

graph

我可以去掉 E 并将其简化为 O(VlogV) 吗?

如果可以的话,我想知道为什么E可以忽略?

algorithm time-complexity graph-theory shortest-path dijkstra
1个回答
0
投票

如果 𝐸 < 𝑉, then the expression 𝑉 + 𝐸 is less than 2𝑉. That coefficient is 不显着 对于大 O 表示法,那么 O((𝑉 + 𝐸) log𝑉) = O(2𝑉log𝑉) = O(𝑉log𝑉)。

© www.soinside.com 2019 - 2024. All rights reserved.