rewire.edges {igraph} | R Documentation |
This function rewires the endpoints of the edges with a constant probability uniformly randomly to a new vertex in a graph.
rewire.edges(graph, prob)
graph |
The input graph |
prob |
The rewiring probability, a real number between zero and one. |
Note that this function might create graphs with multiple and/or loop edges.
A new graph object.
Gabor Csardi csardi@rmki.kfki.hu
# Some random shortcuts shorten the distances on a lattice g <- graph.lattice( length=100, dim=1, nei=5 ) average.path.length(g) g <- rewire.edges( g, prob=0.05 ) average.path.length(g)