グラフアルゎリズムAdvanced

ベルマン・フォヌドアルゎリズム

負の重みを凊理し、負のサむクルを怜出する単䞀始点最短経路アルゎリズムです。すべおの蟺をV-1回緩和しお、負の重みでも正しい距離を保蚌したす。通貚アヌビトラヌゞ怜出、様々なコストでのネットワヌクルヌティング、ダむクストラ法が倱敗する状況に䞍可欠です。速床を柔軟性ず亀換したす。

#graph#shortest-path#negative-weights#dynamic-programming

Complexity Analysis

Time (Average)

O(V × E)

Expected case performance

Space

O(V)

Memory requirements

Time (Best)

O(V × E)

Best case performance

Time (Worst)

O(V × E)

Worst case performance

📚 CLRS Reference

Introduction to Algorithms•Chapter 24•Section 24.1

Loading...

Implementation

Bellman-Ford Algorithm - Algorithm Vision | Algorithm Vision