是否存在不包含最小/最大加权边的最小生成树?

发布于 2024-08-28 09:51:21 字数 190 浏览 6 评论 0原文

如果我们有一个(任意)连通的无向图 G,其边具有不同的权重,那么

  1. G 的每个 MST 是否都包含最小加权边?
  2. G 是否存在不包含最大加权边的 MST?

另外,如果有人能给出一些在处理此类 MST 问题时必须牢记的关键事项的提示,我会更加感激。

这是一个家庭作业问题。谢谢。

If we have an (arbitrary) connected undirected graph G, whose edges have distinct weights,

  1. does every MST of G contains the minimum weighted edge?
  2. is there an MST of G that does not contain the maximum weighted edge?

Also, I'm more thankful if someone can give a hint of the key things one must keep in mind when dealing with such MST questions.

This is a homework problem. Thanks.

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

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

发布评论

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

评论(4

笙痞 2024-09-04 09:51:21

G是否存在不包含最大加权边的MST?

可能有,但不一定有。考虑如下 4 顶点图:

[A]--{2}--[B]
 |         |
 |         |
{1}       {3}
 |         |
 |         |
[C]-{50}--[D]

最小生成树由边集 {CA, AB, BD} 组成。沿 {CD} 的最大边权重为 50,但它不是 MST 的一部分。但如果 G 已经等于它自己的 MST,那么显然它会包含它自己的最大边。

G的每个MST是否包含最小加权边?

是的。 MST 具有剪切属性只是将图的顶点划分为两个不相交的集合。对于您可以进行的任何切割,如果该切割中的一条边的权重小于该切割中其他边的权重,则该边属于图中的所有 MST。因为您保证边权重不同,所以您还保证有一条边小于所有其他边。

此外,如果有人能够提示处理此类 MST 问题时必须牢记的关键事项,我会更加感激。

最好的选择是使用 MST 的一般属性来推理事物,并尝试构建您认为可以证明您的情况的具体反例。我对上面的每条推理都给出了一个例子。由于剪切和循环属性,您始终可以准确确定哪些边在 MST 中,因此您可以系统地测试每条边以确定它是否在 MST 中。

is there an MST of G that does not contain the maximum weighted edge?

There may be, but there doesn't have to be. Consider a 4-vertex graph as follows:

[A]--{2}--[B]
 |         |
 |         |
{1}       {3}
 |         |
 |         |
[C]-{50}--[D]

The minimum spanning tree consists of the edge set {CA, AB, BD}. The maximum edge weight is 50, along {CD}, but it's not part of the MST. But if G were already equal to its own MST, then obviously it would contain its own maximum edge.

does every MST of G contains the minimum weighted edge?

Yes. MSTs have a cut property. A cut is simply a partition of the vertices of the graph into two disjoint sets. For any cut you can make, if the weight of an edge in that cut is smaller than the weights of the other edges in the cut, then this edge belongs to all MSTs in the graph. Because you guaranteed that the edge weights are distinct, you have also guaranteed that there is an edge which is smaller than all other edges.

Also, I'm more thankful if someone can give a hint of the key things one must keep in mind when dealing with such MST questions.

Your best bet is to reason about things using the properties of MSTs in general, and to try to construct specific counterexamples which you think will prove your case. I gave an instance of each line of reasoning above. Because of the cut and cycle properties, you can always determine exactly which edges are in an MST, so you can systematically test each edge to determine whether or not it's in the MST.

咆哮 2024-09-04 09:51:21

G的每个MST是否包含最小加权边?

是的。假设我们有一个不包含最小权重边的 MST。现在,将此边包含到 MST 将导致一个循环。现在循环中总会有另一条边,可以将其删除以删除循环并仍然保持图(MST)连接。

G是否存在不包含最大加权边的MST?

取决于图表。如果本身是一棵树,那么我们需要将其所有n-1边包含在MST中,因此最大权重边不能被排除在外。此外,如果最大权重边是切边,因此排除它永远不会导致连通性,则不能排除最大权重边。但如果最大权重边缘是循环的一部分,则可以从MST中排除。

Does every MST of G contains the minimum weighted edge?

Yes. Lets assume we have a MST which does not contain the min weight edge. Now the inclusion of this edge to the MST will result in a cycle. Now there will always be another edge in the cycle which can be removed to remove the cycle and still maintain the graph(MST) connected.

Is there an MST of G that does not contain the maximum weighted edge?

Depends on the graph. If the graph itself is a tree then we need to include all of its n-1 edges in the MST, so the max weight edge cannot be excluded. Also if the max weight edge is a cut-edge so that its exclusion will never result in connectivity, then the max weight edge cannot be excluded. But if the max weight edge is a part of a cycle then it is possible to exclude from the MST.

所谓喜欢 2024-09-04 09:51:21

对于你的第一个问题,答案是否定的,kruskal 算法证明了这一点。它将始终选择最小成本边。

对于第二个问题,答案是肯定的,找到一个示例图很简单:

1 - 2 (cost 10)
2 - 3 (cost 100)
3 - 1 (cost 1000)

第三条边永远不会被选择,因为它引入了一个循环。所以基本上,如果成本最大的边插入到 MST 中会产生一个循环,那么它就不会被插入。

For your first question the answer is no, and kruskal's algorithm proves it. It will always select the minimum cost edge.

For the second question the answer is yes, and it's trivial to find an example graph:

1 - 2 (cost 10)
2 - 3 (cost 100)
3 - 1 (cost 1000)

The third edge will never be selected as it introduces a cycle. So basically, if the edge with the maximum cost would create a cycle if inserted in the MST, it won't be inserted.

无声无音无过去 2024-09-04 09:51:21

我看你也正在通过2009年的CSC263考试学习? (这里也一样!)

查看最小值始终位于 MST 中的另一种方法是简单地查看这个最小边(称之为 e):

<前><代码> e
v1 ---------------- v2

(假设这与其他顶点有连接)。现在,e 不包含在最终 MST 中意味着在不失一般性的情况下,我们在某个时刻有 v1 在 MST 中,但没有 v2。然而,添加 v2 而不添加 e 的唯一方法是说添加 v1 不会将 e 添加到队列中(因为根据定义,e 将位于队列顶部,因为它具有最低优先级),但是这个与 MST 构造定理相矛盾。

因此,本质上,不可能有一条具有最小权重的边不进入队列,这意味着构建的任何 MST 都会拥有它。

I see you too are studying for CSC263 through the 2009 test? (Same here!)

Another way to see that the minimum is always in the MST is to look simply at this minimum edge (call it e):

          e 
v1 ---------------- v2

(Assume this has connections to other verticies). Now, for e NOT to be included in the final MST means at one point we have, without loss of generality, v1 in the MST but not v2. However, the only way to add v2 without adding e would be to say that the addition of v1 didn't add e to the queue (because by definition, e would be at the top of the queue because it has lowest priority) but this contradicts the MST construction theorem.

So essentially, it is impossible to have an edge with minimum weight not get to the queue which means that any MST constructed would have it.

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