1 min read

igraph: 生成网络

library(igraph)
notable_graph <- c("Bull", "Chvatal", "Coxeter", "Cubical", "Diamond", "Dodecahedral", "Dodecahedron", 
                   "Folkman", "Franklin", "Frucht", "Grotzsch", "Heawood", "Herschel", "House", 
                   "HouseX", "Icosahedral", "Icosahedron", "Krackhardt kite", "Levi", "McGee", 
                   "Meredith", "Noperfectmatching", "Nonline", "Octahedral", "Octahedron", 
                   "Petersen", "Robertson", "Smallestcyclicgroup", "Tetrahedral", "Tetrahedron", 
                   "Thomassen", "Tutte", "Uniquely3colorable", "Walther", "Zachary")

graph <- lapply(notable_graph,make_graph)

make_graph() 一共支持 35 个内置图形。

par(mfrow=c(5,7))

success <- lapply(notable_graph, function(x){
  graph <- make_graph(x)
  par(mar=c(1,1,1,1))
  plot(graph, main = x)
})

make_star(10) %>% plot

make_de_bruijn_graph(3,4) %>% plot

make_full_graph(10) %>% plot

make_kautz_graph(3,4) %>% plot