I have 122 nodes and I want to create a random graph, with node degree being fixed for each node. Is there any way to do it in R? I tried igraph, where I can fix the same degree for all nodes i.e. each of the 122 node will have a degree of 2. But, I want to create a random graph with fixed degree for each node (i.e. node A will have degree 4; node B will have degree 5)
I tried the following code , now it is working:
outdegrees <- c(2, 1, 2, 1, 2)
g <- sample_degseq(outdegrees, method = "Vl")
Thanks
Priya