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

tree_dist

関数 · 木の基本関数

template <weighted_graph_type G, class U = graph_weight_t<G>>
std::vector<U> tree_dist(const G &g, int r = 0);

概要

木の距離を求める

テンプレートパラメータ

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

計算量

関連項目