Skip to content

Instantly share code, notes, and snippets.

@shirayuca
Created August 30, 2014 16:49
Show Gist options
  • Save shirayuca/7b1e86c8b26ed0f5d63e to your computer and use it in GitHub Desktop.
Save shirayuca/7b1e86c8b26ed0f5d63e to your computer and use it in GitHub Desktop.
格子グラフの描画と平均経路長算出
# 格子グラフを描画し、平均経路長を算出します。
# 20 × 20 の格子も、作図と平均経路長を算出してみましょう
library(igraph)
graph2 <- graph.lattice(c(10,10)) # 10×10 の格子
plot(graph2)
dev.off()
average.path.length(graph2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment