# NOT RUN {
library(igraph)
g <- threshold_graph(10,0.3)
# }
# NOT RUN {
plot(g)
# star graphs and complete graphs are threshold graphs
complete <- threshold_graph(10,1) #complete graph
plot(complete)
star <- threshold_graph(10,0) #star graph
plot(star)
# }
# NOT RUN {
# centrality scores are perfectly rank correlated
cor(degree(g),closeness(g),method = "kendall")
# }
Run the code above in your browser using DataLab