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

Re:kruskal确实比prim慢

Posted by giggle at 2014-04-11 20:47:31 on Problem 1789
In Reply To:kruskal确实比prim慢 Posted by:Zenomyth at 2013-10-29 10:59:26
> 我的经过优化的kruskal用了422ms,而没有任何优化的prim只用360ms。
> 理论上kruskal的复杂度为ElogE,而prim为(E+V)logV,prim对于稠密图确实快一些

Kruscal 最耗时的部分是对所有边进行排序,时间复杂度为ElogE,在稠密图边很多的情况下自然更耗时了.

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