朔の「状態」を晒す

1909615e :Anonymous 2023-01-08 17:50
>>e71b24c0
一番遠くて1ホップでした。
17ノード間の組み合わせ153通りのうち
0ホップ(直接): 82通り
1ホップ(1ノード経由): 71通り

NetworkXはshortest_path_lengthでノード間の最短長さが分かるのでそれから1引いたらホップ数
https://networkx.org/documentation/stable/reference/algorithms/generated/networkx.algorithms.shortest_paths.generic.shortest_path_length.html#shortest-path-length
Powered by shinGETsu.