algo — C++23 日本語リファレンス GitHub

shortest_path_spfa

関数 · 単一始点最短路 (shortest_path)

template <weighted_graph_type G, class T = graph_weight_t<G>>
std::vector<T> shortest_path_spfa(const G &g, int s = 0, T inf = std::numeric_limits<T>::max());

概要

単一始点最短路(負辺ありは SPFA)

テンプレートパラメータ

名前 説明
G 重み付きグラフ型(list_graph<T> / csr_graph<T> のいずれでも可)

計算量

備考

関連項目

参照