Coursera - Algorithm (Princeton) - 习题与解答 - Week 8

Week 8

Bottleneck minimum spanning tree.

题目

Given a connected edge-weighted graph, design an efficient algorithm to find a minimum bottleneck spanning tree. The bottleneck capacity of a spanning tree is the weights of its largest edge. A minimum bottleneck spanning tree is a spanning tree of minimum bottleneck capacity.

思路

根据这个定义……MST就是瓶颈生成树呀,因为其最大的权重边已经是所有生成结果里面最小的——这是MST的定义

设计

如上

Is an edge in a MST.

题目

Given an edge-weighted graph G and an edge e, design a linear-time algorithm to determine whether e appears in some MST of G.

Note: Since your algorithm must take linear time in the worst case, you cannot afford to compute the MST itself.

思路(非原创)

https://stackoverflow.com/questions/15049864/check-if-edge-is-included-in-some-mst-in-linear-time-non-distinct-values

MST环性质:如果图上存在一个环,其上一边的权重大于环上的其他边,那么这条边必不属于该图的MST

设计

对于指定的边,从其中一个端点DFS到另一端点,过程中只能走比指定边权重小的边

如果可达,那么指定边一定不在MST中

如果不可达,那么指定便一定在MST中(因为这种情况下,其不是两端点所在环上的权重最大边)

由于算法只涉及DFS,因此复杂度 ο ( E + V ) \omicron(E+V) ο(E+V)

Minimum-weight feedback edge set.

题目

A feedback edge set of a graph is a subset of edges that contains at least one edge from every cycle in the graph. If the edges of a feedback edge set are removed, the resulting graph is acyclic. Given an edge-weighted graph, design an efficient algorithm to find a feedback edge set of minimum weight. Assume the edge weights are positive.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值