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

has_cycle

関数 · 有向グラフの閉路検出(閉路を構成する辺 ID 列を返す)

template <graph_type G>
bool has_cycle(const G &g);

概要

閉路検出

テンプレートパラメータ

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

計算量

関連項目