Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:为何多了一步到终点就退出,就会错误In Reply To:为何多了一步到终点就退出,就会错误 Posted by:longniu at 2009-03-29 11:46:26 原因在于BFS 只是步数最小,而不是权值最小,应该BFS整张地图结束才行。在后面的点的访问中,可能有更小的值到达终点。除非你用优先队列,每次去最小权的先出队,然后才能保证到终点可以结束! Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator