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

提醒楼下的,SPFA无压力闪过。

Posted by lydliyudong at 2011-05-08 13:35:04 on Problem 3013 and last updated at 2011-05-09 14:46:59
SPFA明显比Bellmanford快一大截,是不能相提并论的。。。
SPFA的时间复杂度为O(kE),k为一个常数,而最坏时为O(n^2),Dijkstra为O(nlogn),这只是对于网格图。
本题中数据范围明确给出v,e<=50000,稀疏图,官方论文有证明,SPFA在稀疏图上【平均】每个点进队次数约为2次,则SPFA为O(ke),k是一个很小的常数级别的。当n=e=50000时比Dijkstra还要快。

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