约束度的算法 +有界直径最小生成树?
假设我有 3 种限制来计算生成树:
- 约束度(例如: 生成树可能只 连接最多 3 个其他节点)
- 有界直径(例如:所有边' 权重一旦相加,就不能超过 100).
2.1.如果可能,显示满足此条件的所有子树。 - 有没有
什么好的算法可以解决这个问题,而且不会让我发疯?我将不得不使用相当大的输入(1000+ 个节点)来运行它,因此它的复杂性也不能太高。
Suppose I have 3 kinds of restrictions to computing a spanning tree:
- Constrained degree (eg: a node in
a spanning tree may only be
connected up to 3 other nodes) - Bounded diameter (eg: all edges'
weights, once summed, cannot exceed
100).
2.1. If possible, show all subtrees that meet this criteria. - Both
Are there any good algorithms to solve this that aren't gonna drive me insane? I'm gonna have to run this with rather large inpputs (1000+ nodes), so its complexity can't be too high either.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
度约束生成树问题是 NP 完全问题。请参阅 http://en.wikipedia.org/wiki/Degree-constrained_spanning_tree 。
因此,没有好的(即多项式)算法。不过,有一些近似算法。
谷歌搜索似乎表明有界直径生成树问题同样困难。
The degree-constrained spanning tree problem is NP-complete. See http://en.wikipedia.org/wiki/Degree-constrained_spanning_tree .
So, no good (i.e., polynomial) algorithms. There are approximation algorithms, though.
A Google search seems to indicate that the bounded diameter spanning tree problem is equally hard.