• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
 






hebozi

 
 

Powered by 博客园
博客园 | 首页 | 新随笔 | 联系 | 订阅 订阅 | 管理

2012年10月17日

SPFA 算法
摘要: 算法简介 SPFA(Shortest Path Faster Algorithm)是Bellman-Ford算法的一种队列实现,减少了不必要的冗余计算。也有人说SPFA本来就是Bellman-Ford算法,现在广为流传的Bellman-Ford算法实际上是山寨版。求单源最短路的SPFA算法的全称是:ShortestPathFasterAlgorithm。 从名字我们就可以看出,这种算法在效率上一定有过人之处。 很多时候,给定的图存在负权边,这时类似Dijkstra等算法便没有了用武之地,而Bellman-Ford算法的复杂度又过高,SPFA算法便派上用场了。 简洁起见,我们约定有向加权图G不存 阅读全文
posted @ 2012-10-17 22:01 hebozi 阅读(273) 评论(0) 推荐(0)
 
poj 3013 Big Christmas Tree SPFA算法
摘要: Big Christmas TreeTime Limit: 3000MSMemory Limit: 131072KTotal Submissions: 17532Accepted: 3702DescriptionChristmas is coming to KCM city. Suby the loyal civilian in KCM city is preparing a big neat Christmas tree. The simple structure of the tree is shown in right picture.The tree can be represente 阅读全文
posted @ 2012-10-17 21:56 hebozi 阅读(164) 评论(0) 推荐(0)