zoukankan      html  css  js  c++  java
  • Relaxation step(Dijkstra's 最短路径算法)

    翻译成中文就是“松弛”,属于工程优化的范畴;

    Dijkstra 的单源最短路径算法,有一个重要的步奏,当访问到新的结点 u (加入到集合 S),然后遍历 u 的邻接顶点(Adj),如果经由该点 u 到达 v 的最短距离,比之前的估计距离(tentative distance)还要小,则进行更新(update),更新步便叫做,relaxation step。

    for v in Adj(u):
        if d[v] > d[u] + weight(u, v):
            d[v] = d[u] + weight(u, v)
    u ~~~~~~~> v
             ^ 
             |
       ----->s

    1. 数学上对 relaxation 的解释

    • Relaxation is making a change that reduces constraints. When the Dijkstra algorithm examines an edge, it removes an edge from the pool, thereby reducing the number of constraints.

    One of the meanings of the English word “relaxation” is decreasing something. Because at 最短路径的更新阶段 you are essentially checking if you can decrease (optimize) the currently computed distance, I guess that’s why it is called “relaxation condition”.

    What is the relaxation condition in graph theory

  • 相关阅读:
    单词小课堂
    js数组
    js规范
    css
    seajs
    IDEA快捷键
    移动端设备禁止页面滑动
    sass中的!default的作用
    【数据分析 R语言实战】学习笔记 第八章 方差分析与R实现
    excel合并单元格
  • 原文地址:https://www.cnblogs.com/mtcnn/p/9423952.html
Copyright © 2011-2022 走看看