This algorithm deals with the general case, where G is a directed, weight graph, and it can contains negative edge weigths, cycles and even negative-weight cycles. It runs in O(VE) time, which means O(V^3) when the graph is dense.

This algorithm detects cycles by checking "v.d > u.d + w(u, v)", this is viable because if there are no negative-weight cycles,  and there is an edge which satisfies "v.d > u.d + w(u, v)", v.d would be replaced by u.d + w(u, v) which is exactly what Relax(u,v, w) does. Thus at the time of checking all edges would satisfiy "v.d <= u.d + w(u, v)". Consider the Relax(u,v,w) procedure as "If there are still space for optimizing, then optimize it."

If there are negative-weight cycles, we can consider this as there are infinite optimizing space which can never be fulled exploited. So there will always be some edge whose shortest distance can still be optimized after the "enough" Relax process.

最新文章

  1. 2D、3D形变
  2. VM环境下,快速复制多个SQLServer实例,环境调整
  3. 缺省servlet的使用
  4. IMX51启动模式
  5. Tensor神经网络进行知识库推理
  6. 2014.9.15HTML
  7. 一张地图告诉你,只JavaScript不够!
  8. webpack 4 简单介绍
  9. WRF安装过程
  10. k8s(一) kubeadm简单集群初始化
  11. hadoop 透明加密
  12. Java 中int、String的类型转换
  13. MySQL 数据类型说明解释
  14. C++雾中风景12:聊聊C++中的Mutex,以及拯救生产力的Boost
  15. 一个困扰了我N久的bug , android.enableAapt2=false 无效
  16. 利用nginx解决跨域问题
  17. Maven 环境的配置
  18. .gitignore 失效问题解决
  19. 单个APP页面支持屏幕旋转
  20. 学习Linux二(创建、删除文件和文件夹命令)

热门文章

  1. iOS 并行编程:Thread
  2. IIS限制ASP.Net 文件上传大小解决方案,修改IIS7/7.5配置
  3. 一步一步学NUnit
  4. SQL Server 阻止了对组件 &#39;xp_cmdshell&#39; 的 过程&#39;sys.xp_cmdshell&#39; 的访问
  5. _In_ 是什么意思
  6. #ifndef#define#endif的用法
  7. 学习笔记_过滤器概述(过滤器JavaWeb三大组件之一)
  8. /etc/sysconfig/目录详解
  9. 脱离Xcode,程序在模拟器中无法运行
  10. 下载和安装cocoaPods