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:为何多了一步到终点就退出,就会错误

Posted by 320586 at 2010-07-11 20:16:59 on Problem 2312
In Reply To:为何多了一步到终点就退出,就会错误 Posted by:longniu at 2009-03-29 11:46:26
原因在于BFS 只是步数最小,而不是权值最小,应该BFS整张地图结束才行。在后面的点的访问中,可能有更小的值到达终点。除非你用优先队列,每次去最小权的先出队,然后才能保证到终点可以结束!

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