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

shortest_path_negative

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

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

概要

単一始点最短路(負辺ありはベルマンフォード法)

テンプレートパラメータ

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

計算量

備考

関連項目