为什么边缘比图理论中的顶点少?

发布于 2025-01-21 23:51:23 字数 140 浏览 1 评论 0原文

通过分析Kruskal的算法,Kruskal的算法显然被认为是e log e e,因为“对于MST存在,E不能小于V,因此假设它占主导地位”,

但是,最简单的树输入将比边缘更大。 。

​存在,E不能小于

V

Upon analyzing Kruskal's Algorithm, Kruskal's Algorithm is apparently considered to be E log E because "for an MST to exist, E can't be smaller than V so assume it dominates"

However, the simplest tree input would have more vertices than edges...

snippet of the lecture slide I was looking at

Can someone tell me why "for an MST to exist, E can't be smaller than V so assume it dominates"

hence run time is ElogE not ElogE + V

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

狼性发作 2025-01-28 23:51:23

在这里,“较小”一词应根据计算复杂性或大o来理解。

对于MST,E必须大于或等于V -1。虽然您是正确的,但这意味着E可能小于V,但它将其放在相同的复杂性类别中。

对于具有MST的图形,E可以是O(V)或O(V^2),或者之间的任何内容。

The term "smaller" here should be understood in terms of computational complexity, or big-O.

For an MST to exist, E must be greater than or equal to V - 1. While you are right that this means E can be less than V, it puts it in the same complexity class.

For graphs that have an MST, E can be O(V), or O(V^2), or anything in between.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文