library(igraph)Warning: package 'igraph' was built under R version 4.3.3
n=100 #頂点数
N=400 #サンプル数
cs=seq(0,0.1,0.005)
ratio=c()
for (c in cs){
count=0
for (i in 1:N){
p=c*sqrt(log(n)/n)
g=sample_gnp(n,p)
if(any(count_triangles(g) > 1/2)){
count=count+1
}
}
ratio=c(ratio,count/N)
}