Last active
August 29, 2015 14:05
-
-
Save shirayuca/a0ee3d51657f9e5124b5 to your computer and use it in GitHub Desktop.
木グラフの描画と平均経路長算出
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 木グラフを描画し、平均経路長を算出します。 | |
# 頂点の数を 50, 100, 200 と変化させ、作図と平均経路長を算出してみましょう | |
library(igraph) | |
graph1 <- graph.tree(20) # 頂点の数は20 | |
plot(graph1) # graph1をプロット | |
dev.off() # 描画デバイスを閉じる | |
average.path.length(graph1) # graph1の平均経路長算出 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment