[英]Algorithms for maximum weighted spanning weakly connected DAG
Is there an algorithm to find maximum weight spanning DAG that is weakly connected in a directed graph where every cut has sets that are weakly connected (There is at least one directed path from one set to another)? 是否有一种算法可以找到在有向图中弱连接的最大DAG跨度,该DAG中的每个切口都具有弱连接的集(从一组到另一组至少有一条有向路径)? Or it is a NP hard problem?
还是一个NP难题? The previous question on this topic did not specify https://mathoverflow.net/questions/31864/algorithms-for-maximum-weighted-spanning-connected-dag-directed-acyclic-graph weak or strong connectivity, so I wanted to be more precise.
关于此主题的上一个问题未指定https://mathoverflow.net/questions/31864/algorithms-for-maximum-weighted-spanning-connected-dag-directed-acyclic-graph弱连接或强连接,所以我想成为更确切。
Hope thisn't too late. 希望不会太晚。 It is easy to fail both Kruskal and Prim for the case mentioned.
对于上述情况,Kruskal和Prim都容易失败。 Consider a 2 node graph: A --> B (weight 10), B --> A (weight 6), B --> A (weight 6) (yes: two edges from B to A; nothing in the graph defn precludes that !).
考虑一个2节点图:A-> B(权重10),B-> A(权重6),B-> A(权重6)(是:从B到A的两条边;图defn中没有任何内容排除!)。 Kruskal would first pick the A --> B edge and gets stuck.
Kruskal首先会选择A-> B边缘并被卡住。 Prim would pick one of the edges from B to A and then gets stuck.
Prim会从B到A拾取一条边,然后卡住。 The max.
最高 weighted acyclic subgraph is one that contains both the edges from B to A. It is a subgraph and it is acyclic !
加权非循环子图是一个包含从B到A的两条边的子图。它是一个子图,它是非循环的!
Best Ravi 最佳拉维
Your weak connectivity condition just seems to be that the underlying undirected graph is connected. 您的弱连接条件似乎只是底层无向图已连接。 This is easy enough;
这很容易。 you can use Kruskal or Prim or whatever your favourite minimum spanning tree algorithm is.
您可以使用Kruskal或Prim或您喜欢的最小生成树算法。
Minimum-weight strongly connected subgraph is NP-complete; 最小权重的强连通子图是NP完全的; observe that any such subgraph has at least |V|
观察到任何此类子图至少具有| V | edges and that it has exactly |V|
边且具有正| V | edges if and only if it is a Hamiltonian cycle.
当且仅当它是哈密顿循环时才出现边沿。
You may want to pick a vertex to be the "root" and ask for there to be a path from every vertex to the root in your subgraph. 您可能希望选择一个顶点作为“根”,并要求从子图中的每个顶点到根都有一条路径。 This is the "minimum sppaning arbourescence" problem.
这是“最小扩展树状”问题。 As @matejpavouk pointed out, there is a quadratic algorithm for this due to Chu, Liu, and Edmonds.
正如@matejpavouk所指出的,由于Chu,Liu和Edmonds,对此有一个二次算法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.