Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想修改 Prim 的算法,以便它找到最大生成树如何做到这一点
Prim 的算法不介意负权重。
只需翻转每条边权重的符号,并使用最小生成树算法。
即使贪求最大边缘而不是最小边缘也会有所帮助。