Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

此题的Prim 和 Kruskal 解法论述:

Posted by 123454321 at 2007-08-26 22:20:58 on Problem 3357
如图
A-D 4
A-E 4
D-X 5
E-B 5
X-B 3
用Krus,找一的MST是:X-B A-D A-E E-B 
用Prim,找到的MST是:A-D A-E D-X X-B
此题,用Krus方法易求得正确结果,但优化Prim也是可以通过的。
例如用Prim,在选择了A-D A-E后,下一步有D-X B-E两边供选,我们选择B-E就OK了。

 

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator