Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
接続された無向グラフのサイクルの総数とサイクルの長さを見つけることに興味があります。DFS を使用できますか? または、DFS は 1 つのサイクルしか検出できませんか? どのコードも間違いなく役に立ちます。
次のリファレンスを見てください。
https://www.me.utexas.edu/~bard/IP/Handouts/cycles.pdf