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.
我正在搜索以下问题的算法:给定一个有向加权图G,找到一棵树T,G使得 的平均权重T最大。
G
T
Given a graph G
Sort Edges in an ascending order (minimum weight first)
Cut Top edge (one with smallest weight)
Cut orphan vertices
Is it a tree now ?
Yes: go to step 6
No: go to step 3
Return G