开发者

How do I go about solving for Kruskal's union

I have trie开发者_如何学God going through the graph and changing every instance of some ID into a newer ID and it still led to a cycle. What is plan to solve for an acyclic solution?


You should never get cycles when adding new edges in the Kruskal's algorithm. If you are adding an edge that connects the same component to itself, you skip that edge. You will never get cycles because it won't be a minimal spanning tree

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜