Reputation: 75
I have a graph containing 16809 nodes an 173,393 edges. Now i want to generate a geometric random graph with same number of nodes and edges in r. How can I achieve that.
My example R script is as follows.
library(igraph)
g2 <- graph.formula(A:B - A:C, B:D - C:D , D:F - D:F )
g2
Then how can I model g2 in geometric random graph. Is there any function to create this random graphs in R.
Upvotes: 1
Views: 293
Reputation: 2718
There is a function to generate GRG by known radius and number of nodes, see sample_grg
. But the concept of GRGs means that nodes are placed randomly, so the number of edges will be random. The following code gives pretty close results to what you need:
g <- sample_grg(16809, 0.02)
But I don't think there is a way to somehow determine the number of edges.
Upvotes: 1